/*
 * Hair Plus Keratin Bar — booking flow style guide (Hani's approved spec, 2026-09-29).
 * One stylesheet for the booking page (public/booking/index.html) and the server-rendered pages
 * (/booked, /v, /redeem — src/journey/pages.ts). Tokens copied 1:1 from mockups/booking_flow_interactive.html.
 * Inter 400/500/600 everywhere; Montserrat 800 only in the logo lockup and the voucher ticket. Sans only, no shadows,
 * no gradients except the voucher ticket.
 */
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  --bg: #F6EFE2;      /* page background, warm cream */
  --card: #FFFFFF;    /* cards, fields, header band */
  --text: #1F1F1F;
  --muted: #6B6358;
  --line: #E4D9C2;    /* borders */
  --primary: #C9B27C; /* brand gold: buttons, selected states, progress */
  --on: #1F1F1F;      /* text on gold */
  --ink: #1F1F1F;     /* focus outline */
  --tint: #F3EAD3;    /* light gold: selected/hover fills, icon circles */
  --gd: #7E6A2F;      /* dark gold: icons, prices */
  --err: #B3372E;
  --r: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-logo: 'Montserrat', var(--font);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171614; --card: #221F1B; --text: #F3F1EE; --muted: #A8A196; --line: #3D3830;
    --primary: #C9B27C; --on: #1F1F1F; --ink: #F3F1EE; --tint: #2D281D; --gd: #D9C48F; --err: #E58077;
  }
}
:root[data-theme="dark"] {
  --bg: #171614; --card: #221F1B; --text: #F3F1EE; --muted: #A8A196; --line: #3D3830;
  --primary: #C9B27C; --on: #1F1F1F; --ink: #F3F1EE; --tint: #2D281D; --gd: #D9C48F; --err: #E58077;
}

* { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }

/* ── Accessibility helpers ── */
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--card); padding: 8px 12px; z-index: 40; border-radius: 0 0 8px 0; }
.skip:focus { left: 8px; top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ── Layout ── */
.wrap { max-width: 440px; margin: 0 auto; padding: 24px 20px 40px; }

/* ── Header band + logo (§2.3, §2.4) ── */
/* The header sits on the page background (one surface, Yossef 29.9): no white band behind the logo in light or dark mode. */
.top { background: var(--bg); border-bottom: 1px solid var(--line); padding: 18px 20px 14px; text-align: center; }
.brand { min-height: 72px; } /* reserved for the logo so the header never jumps while the page loads (Hani QA R2 #9) */
.logo { display: block; margin: 0 auto; height: 72px; width: auto; max-width: 100%; border-radius: 8px; }
/* Inlined SVG logo (app.js inlineSvgLogo): text = page text colour, plus + box = brand gold, "Plus" stays dark on gold. */
.logo-svg { overflow: visible; }
.logo-svg .t { fill: var(--text); }
.logo-svg .g { fill: var(--primary); }
.logo-svg .o { fill: #1F1F1F; }
.lg { font-family: var(--font-logo); font-weight: 800; font-size: 32px; line-height: 1; display: inline-flex; align-items: center; gap: 2px; color: var(--text); }
.lg em { font-style: normal; color: var(--primary); margin: 0 1px; }
.lg u { text-decoration: none; background: var(--primary); color: #1F1F1F; padding: 3px 7px 5px; border-radius: 5px; }
.lg2 { font-family: var(--font-logo); font-weight: 800; font-size: 12px; margin-top: 6px; color: var(--text); }
.lg3 { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Progress (§2.3) ── */
.prog { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 24px; padding: 0; list-style: none; }
.prog li { font-size: 12px; color: var(--muted); border-top: 4px solid var(--line); border-radius: 2px; padding-top: 6px; }
.prog li.on { color: var(--text); border-color: var(--primary); font-weight: 600; }

/* ── Type ── */
h1 { font-size: 24px; line-height: 1.25; font-weight: 600; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.lbl { font-size: 14px; font-weight: 500; margin: 8px 0 8px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.err { color: var(--err); font-size: 13px; margin: 6px 0 0; }
.note { font-size: 13px; color: var(--muted); margin: 14px 0 0; text-align: center; }
.banner { font-size: 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; margin: 0 0 16px; }

/* ── Step 1: treatment cards (§3) ── */
.services { display: block; }
.svc {
  display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 60px;
  padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.svc:hover, .svc:focus-visible, .svc[aria-selected="true"] { border-color: var(--primary); background: var(--tint); outline: none; }
.svc b { font-weight: 500; flex: 1; }
.ic { width: 40px; height: 40px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; flex: none; margin-right: 12px; }
.ic svg { width: 22px; height: 22px; stroke: var(--gd); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.svc:hover .ic, .svc:focus-visible .ic, .svc[aria-selected="true"] .ic { background: var(--card); }
.svc span { color: var(--gd); font-weight: 600; font-size: 15px; white-space: nowrap; margin-left: 12px; }
.empty { color: var(--muted); font-size: 14px; }

/* ── Chosen treatment strip ── */
.picked { border: 1px solid var(--primary); background: var(--tint); border-radius: var(--r); padding: 10px 14px; margin-bottom: 20px; font-size: 14px; color: var(--muted); }
.picked b { color: var(--text); font-weight: 500; }

/* ── Step 2: calendar (restyled, same DOM ids/logic) ── */
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 16px; }
.cm { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cm b, .cal-title { font-weight: 600; font-size: 16px; margin: 0; }
.nav { width: 44px; height: 44px; border: 0; background: none; font: inherit; font-size: 22px; color: var(--muted); cursor: pointer; border-radius: 10px; }
.nav:disabled { opacity: .3; cursor: default; }
.cw, .cg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cw span { font-size: 11px; color: var(--muted); padding-bottom: 4px; }
.cg .cal-cell { height: 40px; border: 0; border-radius: 10px; background: var(--tint); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; padding: 0; }
.cg .cal-cell:disabled, .cg .cal-cell.muted { background: none; color: var(--muted); opacity: .4; cursor: default; }
.cg .cal-cell[aria-selected="true"] { background: var(--primary); color: var(--on); font-weight: 600; }

/* ── Time chips ── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { height: 44px; padding: 0 16px; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: var(--r); font: inherit; font-size: 14px; cursor: pointer; }
.chip[aria-selected="true"] { border-color: var(--primary); background: var(--tint); box-shadow: inset 0 0 0 1px var(--primary); font-weight: 500; }
.chip:disabled { color: var(--muted); cursor: default; }
#avail-msg { margin: -8px 0 16px; }
#avail-msg:empty { display: none; }

/* ── Fields (§2.3) ── */
label { display: block; font-size: 14px; font-weight: 500; margin: 0 0 6px; }
.opt { color: var(--muted); font-weight: 400; }
.f { margin-bottom: 18px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=text], input[type=tel], input[type=email] {
  width: 100%; height: 52px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  color: var(--text); font: inherit; padding: 0 16px;
}
input::placeholder { color: var(--muted); opacity: .7; }
input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--err); }
.consent { display: flex; gap: 12px; align-items: flex-start; margin: 6px 0 20px; font-size: 14px; color: var(--muted); font-weight: 400; }
.consent input { width: 22px; height: 22px; flex: none; margin: 1px 0 0; accent-color: var(--primary); }

/* ── Buttons (§2.3) ── */
.btn { width: 100%; height: 52px; border: 0; border-radius: var(--r); background: var(--primary); color: var(--on); font: inherit; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.back { display: block; margin: 12px auto 0; background: none; border: 0; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; padding: 8px; min-height: 44px; }
.step-err { margin-top: 12px; text-align: center; }
.result { font-size: 13px; margin: 12px 0 0; text-align: center; color: var(--muted); }
.result.bad, .result.warn { color: var(--err); }

/* ── Step 4: voucher ticket (§3 Step 4 — the only gradient in the UI) ── */
.tk { position: relative; border-radius: 16px; background: linear-gradient(135deg, #EAD9A8, #C9B27C); color: #1F1F1F; margin-bottom: 22px; box-shadow: 0 4px 14px rgba(126, 106, 47, .25); overflow: hidden; }
.tkt { padding: 20px 18px 16px; display: flex; justify-content: space-between; align-items: center; }
.tb { font-family: var(--font-logo); font-weight: 800; font-size: 14px; line-height: 1.25; }
.tv { text-align: right; }
.tv b { display: block; font-family: var(--font-logo); font-weight: 800; font-size: 48px; line-height: 1; }
.tg { font-size: 11px; letter-spacing: .14em; font-weight: 600; }
.tkb { position: relative; border-top: 2px dashed rgba(31, 31, 31, .35); padding: 14px 18px 16px; background: rgba(255, 255, 255, .3); }
.tkb b { display: block; font-weight: 600; }
.tkb span { font-size: 14px; }
.tkb::before, .tkb::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.tkb::before { left: -10px; }
.tkb::after { right: -10px; }

/* ── Channel buttons ── */
.ch {
  display: flex; align-items: center; gap: 14px; width: 100%; height: 56px; padding: 0 16px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--text);
  font: inherit; font-weight: 500; cursor: pointer; text-align: left; text-decoration: none;
}
.ch:hover, .ch:focus-visible { border-color: var(--primary); background: var(--tint); }
.ch i { margin-left: auto; color: var(--muted); font-style: normal; }
.bi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.bi svg { width: 34px; height: 34px; display: block; }

/* ── Toast (copied message) ── */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--r); font-size: 14px; z-index: 10; text-align: center; }

/* ── Voucher / redeem pages (kept content, new shell) ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 18px; margin-top: 16px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 20px; letter-spacing: .12em; background: var(--tint); color: var(--text); padding: 8px 14px; border-radius: 10px; display: inline-block; }
.qr { display: block; margin: 12px auto; width: 240px; height: 240px; background: #fff; padding: 10px; border-radius: 12px; }
.ok { color: var(--gd); }
.bad { color: var(--err); }
.big { font-size: 24px; font-weight: 600; margin: 8px 0; }

/* ── Loading ── */
.center { text-align: center; color: var(--muted); font-size: 14px; }

/* ── Footer (§2.3) ── */
.foot { margin-top: 28px; font-size: 13px; color: var(--muted); text-align: center; }
.foot a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ── Step 3: details from the Instant Form — confirm, don't retype (5.10) ── */
.me-card { border: 1px solid var(--primary); background: var(--card); border-radius: var(--r); padding: 14px 16px; margin: 0 0 16px; }
.me-title { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.me-line { margin: 0 0 4px; font-size: 15px; overflow-wrap: anywhere; }
.me-line:empty { display: none; }
.me-edit { background: none; border: 0; padding: 8px 0 0; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; min-height: 44px; }
.me-wait { font-size: 14px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); padding: 14px 16px; margin: 0 0 16px; }

/* ── Manage mode (move / cancel her own booking) ── */
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.btn-danger { background: var(--err); color: #FFFFFF; }
.mg-confirm { border: 1px solid var(--line); background: var(--card); border-radius: var(--r); padding: 14px 16px; margin: 0 0 8px; }
.mg-confirm .hint { margin: 0 0 14px; }
#mg-contact a { color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger { color: #1F1F1F; } }
:root[data-theme="dark"] .btn-danger { color: #1F1F1F; }
