/*
  Cape Luxury Mobile Detailing — booking.css
  ---------------------------------------------------------------------------
  Booking + contact page styles. Loaded after main.css on book.html only.
  Uses main.css tokens exclusively — no new colors, no new radii beyond
  --r-lg which main.css already reserves for cards/panels.

  Table of contents:
    1.  Page intro
    2.  Step nav
    3.  Booking form shell
    4.  Fields (inputs / textarea / select)
    5.  Field errors + hints
    6.  Choice panels (service / size / time)
    7.  Add-on grid
    8.  Step actions (back / next)
    9.  Summary
    10. Estimate box
    11. Handoff actions
    12. Confirmation state
    13. Honeypot
    14. Contact section
    15. Reduced motion
  ---------------------------------------------------------------------------
*/

/* ══════════════════════════════ 1. PAGE INTRO ══════════════════════════ */

.book-hero {
  padding-block: var(--s-9) var(--s-7);
}

.book-hero h1 {
  margin-top: var(--s-3);
  max-width: 18ch;
}

.book-hero .lede {
  margin-top: var(--s-5);
}

@media (max-width: 640px) {
  .book-hero { padding-block: var(--s-7) var(--s-6); }
}

/* ══════════════════════════════ 2. STEP NAV ══════════════════════════════ */

.booking { padding-block: 0 var(--s-9); }

.step-nav {
  display: flex;
  gap: var(--s-6);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding-block: var(--s-4);
  margin-bottom: var(--s-8);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.step-nav::-webkit-scrollbar { display: none; }

/* Same [hidden] vs. author `display: flex` issue as .field-error above. */
.step-nav[hidden] { display: none; }

.step-nav__item { flex: none; }

.step-nav__btn {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  white-space: nowrap;
  color: var(--fog-400);
  cursor: default;
  padding-block: var(--s-1);
}

.step-nav__num {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: inherit;
}

.step-nav__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: inherit;
}

.step-nav__item[data-current] .step-nav__btn {
  color: var(--white);
}

.step-nav__item[data-current] .step-nav__num {
  color: var(--red-400);
}

.step-nav__item[data-done] .step-nav__btn {
  color: var(--fog-200);
  cursor: pointer;
}

.step-nav__item[data-done] .step-nav__btn:hover {
  color: var(--red-400);
}

/* ══════════════════════ 3. BOOKING FORM SHELL ══════════════════════ */

.booking-form {
  max-width: 760px;
  min-width: 0;
}

/* ══════════════════ 3b. WIZARD + RUNNING ESTIMATE LAYOUT ══════════════════
   Single column on mobile. On desktop the estimate moves into a sticky right
   column so the steps are not a narrow strip floating in a wide container. */

.booking-layout {
  display: grid;
  gap: var(--s-7);
  align-items: start;
}

@media (min-width: 900px) {
  .booking-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--s-8);
  }

  .booking-aside {
    position: sticky;
    top: calc(var(--header-offset, 86px) + var(--s-5));
  }
}

.booking-aside {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--ink-700);
  padding: var(--s-5);
}

.booking-aside .estimate-box {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
}

.booking-aside__help {
  margin-top: var(--s-4);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-400);
}

.booking-step {
  border: 0;
  margin: 0;
  padding: 0;
}

.booking-step:focus {
  outline: none;
}

.step-legend {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--white);
  font-size: clamp(1.4rem, 1.4vw + 1rem, 1.9rem);
  margin-bottom: var(--s-6);
  padding: 0;
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}

.step-legend__num {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: var(--red-400);
}

.sub-block {
  margin-top: var(--s-6);
}

.field-group-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fog-400);
  margin-bottom: var(--s-3);
}

.field-group-label__hint,
.field-optional {
  text-transform: none;
  letter-spacing: 0;
  color: #5C6167;
}

/* ══════════════════ 4. FIELDS (INPUTS / TEXTAREA / SELECT) ══════════════════ */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-6);
}

.booking-step > .field:first-child,
.field-row:first-child { margin-top: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  margin-top: var(--s-6);
}

@media (min-width: 640px) {
  .field-row { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .field-row .field { margin-top: 0; }
}

.field label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fog-400);
}

.field input,
.field textarea,
.field select {
  background: var(--ink-800);
  border: 1px solid var(--line);
  border-radius: var(--r-0);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  padding: var(--s-3) var(--s-4);
  transition: border-color var(--dur-fast) var(--ease);
  width: 100%;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #5C6167;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--red-400);
  outline: none;
}

.field textarea { resize: vertical; min-height: 84px; }

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--red-400);
}

.field-hint {
  margin-top: var(--s-2);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fog-400);
}

/* ══════════════════════ 5. FIELD ERRORS ══════════════════════ */

.field-error {
  display: flex;
  align-items: baseline;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--red-400);
  margin: var(--s-2) 0 0;
  max-width: none;
}

/* .field-error's own `display: flex` would otherwise beat the native [hidden]
   UA style at equal specificity — force it explicitly (same issue as
   .menu-overlay[hidden] in main.css). */
.field-error[hidden] { display: none; }

.field-error::before {
  content: '!';
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--red-400);
  font-size: 10px;
}

.choice-grid + .field-error,
.addon-grid + .field-error {
  margin-top: var(--s-4);
}

/* ══════════════════ 6. CHOICE PANELS (SERVICE / SIZE / TIME) ══════════════════ */

.choice-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: 1fr;
}

.choice-grid--service,
.choice-grid--size {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .choice-grid--service { grid-template-columns: repeat(2, 1fr); }
  .choice-grid--size { grid-template-columns: repeat(3, 1fr); }
}

.choice-grid--time {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
}

.choice-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-5);
  border: 1px solid var(--line);
  background: var(--ink-700);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.choice-panel:hover {
  border-color: var(--fog-400);
}

.choice-panel:focus-within {
  outline: 2px solid var(--red-400);
  outline-offset: 3px;
}

.choice-panel__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.choice-panel.is-selected {
  border-color: var(--red-500);
  background: var(--red-900);
}

.choice-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}

.choice-panel__index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--fog-400);
  transition: color var(--dur-fast) var(--ease);
}

.choice-panel.is-selected .choice-panel__index {
  color: var(--red-400);
}

.choice-panel__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--white);
  letter-spacing: -0.01em;
}

.choice-panel__tagline {
  font-size: 13px;
  color: var(--fog-400);
  line-height: 1.5;
}

.choice-panel__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  margin-top: auto;
  padding-top: var(--s-3);
}

.choice-panel__price {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fog-200);
}

.choice-panel__badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--red-400);
  border: 1px solid var(--red-500);
  padding: 2px 8px;
}

.choice-panel--compact {
  padding: var(--s-4) var(--s-3);
  align-items: center;
  text-align: center;
}

.choice-panel--compact .choice-panel__name {
  font-size: 14px;
}

@media (max-width: 480px) {
  .choice-grid--time { grid-template-columns: 1fr; }
}

/* ══════════════════════════ 7. ADD-ON GRID ══════════════════════════ */

.addon-grid {
  display: grid;
  gap: var(--s-3);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .addon-grid { grid-template-columns: repeat(2, 1fr); }
}

.addon-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.addon-item:hover { border-color: var(--fog-400); }

.addon-item:focus-within {
  outline: 2px solid var(--red-400);
  outline-offset: 3px;
}

.addon-item.is-selected {
  border-color: var(--red-500);
  background: var(--red-900);
}

.addon-item__box {
  flex: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--fog-400);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.addon-item.is-selected .addon-item__box {
  border-color: var(--red-400);
  background: var(--red-500);
}

.addon-item__box svg { opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.addon-item.is-selected .addon-item__box svg { opacity: 1; }

.addon-item__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.addon-item__name {
  font-size: 14px;
  color: var(--fog-200);
  flex: 1;
}

.addon-item__price {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fog-400);
  white-space: nowrap;
}

/* ══════════════════ 8. STEP ACTIONS (BACK / NEXT) ══════════════════ */

.step-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  margin-top: var(--s-8);
  padding-top: var(--s-6);
  border-top: 1px solid var(--line);
}

/* ══════════════════════════════ 9. SUMMARY ══════════════════════════════ */

.summary {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.summary__group {
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-2) var(--s-5);
}

@media (min-width: 640px) {
  .summary__group { grid-template-columns: 160px 1fr; align-items: baseline; }
}

.summary__label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog-400);
}

.summary__value {
  color: var(--fog-200);
  font-size: 15px;
  line-height: 1.6;
}

.summary__value strong {
  color: var(--white);
  font-weight: 400;
}

.summary__edit {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fog-400);
  border-bottom: 1px solid var(--line);
  justify-self: start;
}

@media (min-width: 640px) {
  .summary__edit { justify-self: end; }
}

.summary__edit:hover { color: var(--red-400); border-color: var(--red-400); }

/* ══════════════════════════ 10. ESTIMATE BOX ══════════════════════════ */

.estimate-box {
  margin-top: var(--s-7);
  padding: var(--s-6);
  background: var(--ink-700);
  border: 1px solid var(--red-500);
  border-radius: var(--r-lg);
}

.estimate-box__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fog-400);
}

.estimate-box__amount {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--white);
  font-size: clamp(1.6rem, 4vw + 1rem, 3.2rem);
  overflow-wrap: anywhere;
  margin-top: var(--s-2);
}

.estimate-box__note {
  margin-top: var(--s-3);
  font-size: 13px;
  color: var(--fog-400);
  max-width: 48ch;
}

/* ══════════════════════════ 11. HANDOFF ACTIONS ══════════════════════════ */

.handoff {
  margin-top: var(--s-7);
}

.handoff__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin-top: var(--s-3);
}

/* Send outcome for both forms. One element carries both results: the contact
   form toggles .is-error, and the booking wizard's copy is failure-only so it
   carries .form-status--error from the markup. */
.form-status {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-top: var(--s-4);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--fog-200);
  max-width: 46ch;
}

/* Author `display: flex` beats the native [hidden] UA style at equal
   specificity — same trap as .field-error above. */
.form-status[hidden] { display: none; }

/* JS moves focus here on failure so a screen reader lands on the reason. */
.form-status:focus { outline: none; }
.form-status:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}

.form-status::before {
  content: '\2713';
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  font-size: 9px;
  transform: translateY(1px);
}

.form-status.is-error,
.form-status--error {
  color: var(--red-400);
}

.form-status.is-error::before,
.form-status--error::before {
  content: '!';
  font-size: 10px;
}

/* ══════════════════════════ 12. CONFIRMATION STATE ══════════════════════════ */

.booking-confirm {
  max-width: 640px;
}

.booking-confirm:focus { outline: none; }

.booking-confirm h3 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--white);
  font-size: clamp(1.8rem, 2.5vw + 1rem, 2.6rem);
  margin-top: var(--s-3);
}

.booking-confirm .lede {
  margin-top: var(--s-5);
  max-width: 52ch;
}

.booking-confirm__list {
  margin-top: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.booking-confirm__list li {
  position: relative;
  padding-left: var(--s-6);
  color: var(--fog-200);
  font-size: 15px;
}

.booking-confirm__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 10px;
  height: 1px;
  background: var(--red-400);
}

.booking-confirm .btn {
  margin-top: var(--s-7);
}

.booking-confirm__reset {
  display: block;
  margin-top: var(--s-5);
}

/* ══════════════════════════════ 13. HONEYPOT ══════════════════════════════ */

.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ══════════════════════════════ 14. CONTACT SECTION ══════════════════════════════ */

.contact {
  padding-block: var(--s-9);
}

.contact__grid {
  display: grid;
  gap: var(--s-8);
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .contact__grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

.contact__info h2 {
  margin-top: var(--s-3);
  max-width: 14ch;
}

.contact__info .lede { margin-top: var(--s-5); }

.contact__facts {
  margin-top: var(--s-7);
  display: grid;
  gap: var(--s-5);
}

.contact__facts div {
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.contact__facts dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-400);
  margin-bottom: var(--s-2);
}

.contact__facts dd {
  margin: 0;
  color: var(--fog-200);
  font-size: 15px;
  line-height: 1.5;
}

.contact__facts a { color: var(--fog-200); border-bottom: 1px solid var(--line); }
.contact__facts a:hover { color: var(--red-400); border-color: var(--red-400); }

.contact-form {
  background: var(--ink-700);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.contact-form .field:first-of-type { margin-top: 0; }

/* ══════════════════════════════ 15. REDUCED MOTION ══════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .choice-panel,
  .addon-item,
  .field input,
  .field textarea {
    transition-duration: 0.001ms;
  }
}
