/* Hauling Auto V2: base + reusable components.
   Uses tokens.css variables only (no literal colors). → blocksy-child/assets/css/components.css */

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--white); color: var(--text);
  font-family: var(--font); font-size: var(--fs-body); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-synthesis: none;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cta); text-underline-offset: 3px; }
a:hover { color: var(--cta-hover); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; color: inherit; line-height: var(--lh-heading); font-weight: 850; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 6px; }
.on-dark :focus-visible { box-shadow: var(--focus-ring-dark); }
body.menu-open { overflow: hidden; }

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: var(--r-sm); background: var(--charcoal); color: var(--white); font-weight: 700; }
.skip-link:focus { top: 12px; color: var(--white); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
a[href^="tel:"] { white-space: nowrap; }   /* phone numbers never wrap */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Eyebrow / section header ---- */
.eyebrow {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--cta);
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--orange); flex: none; }
.on-dark .eyebrow { color: var(--orange-on-dark); }
.section-title { font-size: var(--fs-h2); letter-spacing: -.03em; margin-top: var(--space-4); }
.section-sub { margin-top: var(--space-4); max-width: 620px; color: var(--text-muted); font-size: var(--fs-lead); }
.on-dark .section-sub { color: var(--text-muted-on-dark); }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-6); margin-bottom: var(--space-7); }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 750; font-size: var(--fs-small); color: var(--cta); text-decoration: none; white-space: nowrap; }
.text-link:hover { text-decoration: underline; }
.text-link .icon { width: 16px; height: 16px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: var(--r-sm); border: 1.5px solid transparent;
  font-size: .9375rem; font-weight: 750; line-height: 1.1; text-decoration: none; white-space: nowrap;
  transition: background var(--dur), box-shadow var(--dur), transform var(--dur), border-color var(--dur), color var(--dur);
}
.btn .icon { width: 18px; height: 18px; }
.btn--primary { background: var(--cta); color: var(--white); box-shadow: var(--shadow-cta); }
.btn--primary:hover { background: var(--cta-hover); color: var(--white); transform: translateY(-1px); }
.btn--ghost-dark { color: var(--white); border-color: color-mix(in srgb, var(--white) 34%, transparent); background: color-mix(in srgb, var(--white) 5%, transparent); }
.btn--ghost-dark:hover { color: var(--white); background: color-mix(in srgb, var(--white) 12%, transparent); }
.btn--light { background: var(--white); color: var(--charcoal); }
.btn--light:hover { background: var(--gray-50); color: var(--charcoal); }
.btn--quiet { background: var(--gray-50); color: var(--charcoal); border-color: var(--gray-200); }
.btn--quiet:hover { color: var(--charcoal); background: var(--gray-200); }
.btn--block { width: 100%; justify-content: space-between; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ---- Form fields ---- */
.field { margin-bottom: var(--space-4); position: relative; }
.field__label { display: block; margin-bottom: 6px; font-size: var(--fs-small); font-weight: 700; color: var(--text); }
.field__label .opt { font-weight: 500; color: var(--text-muted); }
.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--gray-300); background: var(--white); color: var(--text); font-size: 1rem;
  transition: border-color var(--dur), box-shadow var(--dur); appearance: none; -webkit-appearance: none;
}
select.input {
  padding-right: 40px; cursor: pointer;
  /* chevron drawn with token color (no literal color in a data URI) */
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%;
}
.input::placeholder { color: var(--text-muted); opacity: .8; }
.input:hover { border-color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--cta); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cta) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--error); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 16%, transparent); }
.field__hint { margin-top: 6px; font-size: var(--fs-xs); color: var(--text-muted); min-height: 0; }
.field__hint:empty { display: none; }
.field__hint.is-ok { color: var(--success); font-weight: 650; }
.field-error { display: none; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: var(--fs-xs); font-weight: 650; color: var(--error); }
.field-error.is-visible { display: flex; }
.field-error .icon { width: 14px; height: 14px; margin-top: 1px; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }

/* Segmented choice (radio buttons styled as tiles) */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); border: 0; margin: 0; padding: 0; min-width: 0; }
.choices legend { padding: 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 10px;
  border: 1.5px solid var(--gray-300); border-radius: var(--r-sm); background: var(--white);
  font-size: var(--fs-small); font-weight: 700; color: var(--text); text-align: center; line-height: 1.25;
  transition: border-color var(--dur), background var(--dur);
}
.choice input:hover + span { border-color: var(--text-muted); }
.choice input:checked + span { border-color: var(--cta); background: var(--orange-tint); color: var(--cta-hover); }
.choice input:focus-visible + span { box-shadow: var(--focus-ring); }
.choices[aria-invalid="true"] .choice span { border-color: var(--error); }

/* Checkbox (consent) */
.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; font-size: var(--fs-xs); line-height: 1.55; color: var(--text-muted); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cta); }

/* Combobox suggestions (location autocomplete) */
.combo { position: relative; }
.combo__list {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--r-md); box-shadow: var(--shadow-md);
  max-height: 264px; overflow-y: auto;
}
.combo__list[hidden] { display: none; }
.combo__opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: var(--fs-small); color: var(--text); }
.combo__opt .icon { width: 16px; height: 16px; color: var(--text-muted); }
.combo__opt small { margin-left: auto; color: var(--text-muted); font-size: var(--fs-xs); }
.combo__opt[aria-selected="true"], .combo__opt:hover { background: var(--orange-tint); }
.combo__attr { padding: 6px 12px 4px; font-size: var(--fs-xs); color: var(--text-muted); text-align: right; }

/* ---- Cards & chips ---- */
.card { background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--r-md); box-shadow: var(--shadow-sm); }
.icon-well { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--orange-tint); color: var(--cta); }
.icon-well .icon { width: 20px; height: 20px; }
.on-dark .icon-well { background: var(--charcoal-line); color: var(--orange-on-dark); }

/* ---- Reveal on scroll (progressive enhancement) ---- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ==== PROTOTYPE-ONLY (not shipped to production) ==== */
.ph {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--r-pill);
  border: 1.5px dashed var(--proto-amber); background: var(--proto-amber-bg); color: var(--proto-amber);
  font-size: .6875rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; line-height: 1.5; white-space: normal; vertical-align: middle;
}
.sample-ribbon {
  position: absolute; top: 14px; right: 14px; padding: 3px 9px; border-radius: 8px;
  border: 1.5px dashed var(--proto-amber); background: var(--proto-amber-bg); color: var(--proto-amber);
  font-size: .625rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
html.hide-ph .ph, html.hide-ph .sample-ribbon, html.hide-ph [data-unverified] { display: none !important; }
html.hide-ph [data-production-only] { display: revert !important; }
[data-production-only] { display: none !important; }

.proto { position: fixed; left: 14px; bottom: 14px; z-index: 90; font-size: var(--fs-small); }
.proto__btn { padding: 8px 14px; border-radius: var(--r-pill); border: 1.5px dashed var(--proto-amber); background: var(--proto-amber-bg); color: var(--proto-amber); font-weight: 800; box-shadow: var(--shadow-md); }
.proto__panel { display: none; position: absolute; left: 0; bottom: 48px; width: 290px; padding: 16px; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--gray-200); box-shadow: var(--shadow-md); }
.proto__panel.is-open { display: block; }
.proto__panel p { color: var(--text-muted); font-size: var(--fs-xs); margin-bottom: 10px; }
.proto__panel label { display: flex; gap: 8px; align-items: center; padding: 5px 0; }
.proto__panel input { accent-color: var(--cta); }
.proto__toast { display: none; position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 95; max-width: min(92vw, 520px); padding: 12px 16px; border-radius: var(--r-sm); background: var(--charcoal); color: var(--white); font-size: var(--fs-small); box-shadow: var(--shadow-md); }
html.sim-reduced-motion .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
html.sim-reduced-motion * { transition: none !important; scroll-behavior: auto !important; }
/* On phones the review button shrinks to an icon at top-right so it never covers the form */
@media (max-width: 920px) {
  .proto { left: auto; right: 10px; bottom: auto; top: calc(var(--header-h) + 10px); }
  .proto__btn { padding: 6px 10px; font-size: var(--fs-xs); opacity: .9; }
  .proto__panel { bottom: auto; top: 40px; left: auto; right: 0; }
}
