/* Booking wizard — calm, premium, fully token-driven so it inherits each theme's
   palette, fonts, and radius automatically (looks right on salon, cafe, and any
   re-skin). The /book/ page renders on the base shell (body.theme-base); the
   shared chrome is styled by public-shell.css and this file styles the wizard
   end-to-end, consuming only the design-token custom properties. Linked (after
   public-shell.css) only on the booking page. Every step is a plain GET/POST —
   nothing here depends on JS; the #booking-wizard swap target and the form's
   hidden/honeypot inputs are left untouched. Large tap targets, visible focus,
   accessible step indicator. */

/* The shared base-shell chrome (header/footer/container/body font) lives in
   public-shell.css, linked just before this file on /book/. This file only
   defines the wizard's local, token-derived vars (on <body> so the whole wizard
   inherits them) and styles the wizard end-to-end. All brand colour stays in
   the design tokens. */
body {
  --bk-display: var(--font-heading), Georgia, "Times New Roman", serif;
  --bk-sans: var(--font-body), system-ui, -apple-system, "Segoe UI", sans-serif;
  --bk-line: 1px solid var(--color-border);
  --bk-tint: color-mix(in srgb, var(--color-primary) 6%, var(--color-surface));
  --bk-tint-line: color-mix(in srgb, var(--color-primary) 22%, var(--color-border));
}

.section--booking { padding-block: clamp(3rem, 7vw, 6rem); }
.section--booking .container { max-width: 50rem; }

.section--booking .section__heading {
  font-family: var(--bk-display);
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 1.1;
  margin: 0 0 1.6rem;
  padding-bottom: 1.4rem;
  border-bottom: var(--bk-line);
}

#booking-wizard { font-family: var(--bk-sans); color: var(--color-text); }

/* --- Step indicator ------------------------------------------------------- */
/* The <ol> grows as the customer advances; the current step carries
   aria-current="step". Numbers come from a CSS counter (decorative); the visible
   labels are the real, accessible content. */
.booking-steps {
  list-style: none; margin: 0 0 2.75rem; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem 0.9rem;
  counter-reset: bkstep;
}
.booking-steps li {
  counter-increment: bkstep;
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-family: var(--bk-sans); font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--color-muted);
}
.booking-steps li::before {
  content: counter(bkstep);
  display: grid; place-items: center; flex: none;
  width: 1.9rem; height: 1.9rem;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  font-variant-numeric: tabular-nums; letter-spacing: 0;
  color: var(--color-muted); background: var(--color-surface);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
/* Steps before the current one are "done". */
.booking-steps li { color: var(--color-text); }
.booking-steps li::before { color: var(--color-text); border-color: var(--color-text); }
/* Current step: filled with the primary. */
.booking-steps li[aria-current="step"] { color: var(--color-primary); }
.booking-steps li[aria-current="step"]::before {
  background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-contrast);
}
/* Hairline connector between steps. */
.booking-steps li:not(:last-child)::after {
  content: ""; width: 1.4rem; height: 1px; background: var(--color-border); margin-left: 0.2rem;
}
@media (max-width: 30rem) { .booking-steps li:not(:last-child)::after { display: none; } }

/* --- Back / forward inline nav links (e.g. "← Change service") ------------- */
.section--booking #booking-wizard > p { margin: -1rem 0 2rem; }
.section--booking #booking-wizard > p > a {
  display: inline-block; font-family: var(--bk-sans);
  font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.13em;
  color: var(--color-primary); text-decoration: none;
}
.section--booking #booking-wizard > p > a:hover,
.section--booking #booking-wizard > p > a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }

/* --- Shared list-row look (services + days) ------------------------------- */
.booking-services, .booking-days { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.booking-services a, .booking-days a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem 1.5rem;
  padding: 1.15rem 1.35rem; min-height: 3.5rem;
  text-decoration: none; color: var(--color-text);
  background: var(--color-surface); border: var(--bk-line); border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.booking-services a:hover, .booking-days a:hover,
.booking-services a:focus-visible, .booking-days a:focus-visible {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--color-primary) 14%, transparent);
}
.booking-services__name { font-weight: 600; font-size: 1.1rem; }
.booking-services__meta { color: var(--color-muted); font-size: 0.9rem; white-space: nowrap; }

.booking-days a { font-size: 1.05rem; }
.booking-days__count {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--color-primary); white-space: nowrap;
}

/* --- Slot grid (time chips) ----------------------------------------------- */
.booking-slots {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0.6rem;
  grid-template-columns: repeat(auto-fill, minmax(5rem, 1fr));
}
.booking-slots a {
  display: block; text-align: center; padding: 0.9rem 0.5rem; min-height: 3rem;
  font-variant-numeric: tabular-nums; font-size: 1rem; letter-spacing: 0.02em;
  text-decoration: none; color: var(--color-text);
  background: var(--color-surface); border: var(--bk-line); border-radius: var(--radius);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.booking-slots a:hover, .booking-slots a:focus-visible {
  border-color: var(--color-primary); color: var(--color-primary);
  background: var(--bk-tint);
}

/* --- Summary panel (chosen service + time) -------------------------------- */
.booking-summary {
  margin: 0 0 1.75rem;
  background: var(--bk-tint);
  border: 1px solid var(--bk-tint-line);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1.1rem 1.35rem;
  line-height: 1.55;
  font-size: 1.05rem;
}

/* --- Details form --------------------------------------------------------- */
/* .form-field / .hp-field / .field-error / .form-error / .form-hint come from
   site.css; this refines them for the booking context. The honeypot stays
   visually hidden (site.css) and the csrf/start/ts hidden inputs are untouched. */
.booking-form { max-width: 34rem; margin: 0; }
.booking-form .form-field { margin: 0 0 1.2rem; gap: 0.4rem; }
.booking-form label {
  font-family: var(--bk-sans); font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.13em; color: var(--color-muted);
}
.booking-form input, .booking-form textarea {
  font: inherit; color: inherit; width: 100%;
  padding: 0.8rem 0.9rem;
  background: var(--color-surface);
  border: var(--bk-line); border-radius: var(--radius);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.booking-form input:focus, .booking-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent);
}
.booking-form textarea { resize: vertical; min-height: 5.5rem; }
.booking-form .form-hint { margin: 0.25rem 0 1.4rem; color: var(--color-muted); font-size: 0.9rem; }
.booking-form .form-error { margin: 0 0 1.1rem; color: #b91c1c; font-weight: 600; }
.booking-form .field-error { color: #b91c1c; font-size: 0.85rem; }

.section--booking .btn {
  display: inline-block; cursor: pointer;
  font: inherit; font-weight: 600; letter-spacing: 0.02em;
  background: var(--color-primary); color: var(--color-primary-contrast);
  border: 1px solid var(--color-primary); border-radius: var(--radius);
  padding: 0.95rem 2rem; min-height: 3rem;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.section--booking .btn:hover, .section--booking .btn:focus-visible {
  background: color-mix(in srgb, var(--color-primary) 88%, #000);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--color-primary) 22%, transparent);
}
@media (max-width: 30rem) { .section--booking .btn { width: 100%; text-align: center; } }

/* --- Success + empty states ----------------------------------------------- */
.booking-success {
  max-width: 36rem; margin-inline: auto; text-align: center;
  background: var(--color-surface); border: var(--bk-line); border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
}
.booking-success::before {
  content: "\2713";
  display: grid; place-items: center;
  width: 3.1rem; height: 3.1rem; margin: 0 auto 1.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary); font-size: 1.5rem; line-height: 1;
}
.booking-success h2 { font-family: var(--bk-display); margin: 0 0 0.6rem; font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.booking-success p { color: var(--color-muted); margin: 0 0 1rem; }
.booking-success a { color: var(--color-primary); font-weight: 600; }

.booking-empty {
  color: var(--color-muted); text-align: center;
  border: 1px dashed var(--color-border); border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.25rem); margin: 0;
}

/* --- Per-step reveal (enhancement only; gated behind a motion preference) -- */
@media (prefers-reduced-motion: no-preference) {
  #booking-wizard > * { animation: bk-rise 0.45s both; }
  #booking-wizard > .booking-steps { animation-delay: 0s; }
  @keyframes bk-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
