/* ===== Real-time booking page (book.html) ===== */
.book-page { padding: 72px 0 var(--section-padding); background: var(--cream); }
.book-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: flex-start; }
.book-main { background: var(--white); padding: 40px 48px 48px; border-radius: 8px; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(0,0,0,0.05); }

.sandbox-banner { display: flex; gap: 12px; align-items: center; background: #fff7e6; border: 1px solid #f0d9a8; color: #7a5a14; padding: 12px 16px; border-radius: 6px; font-size: 0.85rem; margin-bottom: 28px; }
.sandbox-banner strong { font-weight: 600; }

/* Stepper */
.stepper { display: flex; gap: 6px; margin-bottom: 36px; padding: 0; list-style: none; }
.stepper li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-light); text-align: center; position: relative; }
.stepper li::before { content: ''; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.stepper li:last-child::before { display: none; }
.stepper .dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--cream-dark); color: var(--text-light); font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600; border: 2px solid var(--border); transition: all 0.3s; }
.stepper li.current .dot { background: var(--gold); border-color: var(--gold); color: var(--white); box-shadow: 0 0 0 4px rgba(201,169,110,0.18); }
.stepper li.current { color: var(--navy); font-weight: 600; }
.stepper li.done .dot { background: var(--navy); border-color: var(--navy); color: var(--white); }
.stepper li.done::before { background: var(--navy); }
.stepper li.done { color: var(--text-secondary); }

/* Panels */
.step-panel { animation: panelIn 0.35s ease; }
.step-panel[hidden] { display: none; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel-title { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.panel-sub { font-size: 0.92rem; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.panel-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--border); padding: 14px 24px; }
.btn-ghost:hover { border-color: var(--navy); background: rgba(26,39,68,0.04); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Choice cards (reasons) */
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.choice-card { display: block; padding: 18px 20px; border: 2px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.3s; height: 100%; }
.choice-card:hover { border-color: var(--gold-light); background: rgba(201,169,110,0.04); }
.choice-option input:checked + .choice-card { border-color: var(--gold); background: rgba(201,169,110,0.08); box-shadow: 0 0 0 3px rgba(201,169,110,0.15); }
.choice-option input:focus-visible + .choice-card { outline: 2px solid var(--navy); outline-offset: 2px; }
.choice-title { display: block; font-weight: 600; font-size: 0.95rem; color: var(--navy); margin-bottom: 4px; }
.choice-desc { display: block; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.5; }

/* Day strip + time chips */
.day-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: thin; }
.day-pill { flex: 0 0 auto; min-width: 72px; padding: 12px 10px; border: 2px solid var(--border); border-radius: 8px; background: var(--white); cursor: pointer; text-align: center; font-family: var(--font-sans); transition: all 0.25s; }
.day-pill .dow { display: block; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-light); }
.day-pill .dom { display: block; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 600; color: var(--navy); line-height: 1.2; }
.day-pill .mon { display: block; font-size: 0.72rem; color: var(--text-secondary); }
.day-pill .cnt { display: block; font-size: 0.68rem; color: var(--gold-dark); margin-top: 4px; }
.day-pill:hover { border-color: var(--gold-light); }
.day-pill.selected { border-color: var(--gold); background: rgba(201,169,110,0.08); box-shadow: 0 0 0 3px rgba(201,169,110,0.15); }
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.time-chip { padding: 12px 10px; border: 2px solid var(--border); border-radius: 6px; background: var(--white); cursor: pointer; font-family: var(--font-sans); font-size: 0.9rem; font-weight: 500; color: var(--navy); transition: all 0.25s; }
.time-chip small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--text-light); margin-top: 2px; }
.time-chip:hover { border-color: var(--gold-light); }
.time-chip.selected { border-color: var(--gold); background: var(--gold); color: var(--white); }
.time-chip.selected small { color: rgba(255,255,255,0.8); }
.slot-empty { padding: 28px; text-align: center; color: var(--text-secondary); background: var(--cream); border-radius: 8px; font-size: 0.92rem; line-height: 1.6; }

/* Loading / status */
.loading { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-size: 0.9rem; padding: 18px 0; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--cream-dark); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.9s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.alert { padding: 14px 16px; border-radius: 6px; font-size: 0.9rem; line-height: 1.5; margin-bottom: 20px; }
.alert-error { background: #fdecec; border: 1px solid #f3bcbc; color: #8a1f1f; }
.alert-info { background: rgba(201,169,110,0.1); border: 1px solid rgba(201,169,110,0.35); color: var(--navy); }
.alert ul { margin: 8px 0 0 18px; }
.field-hint { font-size: 0.78rem; color: var(--text-light); margin-top: 6px; }
.form-group.invalid input { border-color: #c0392b; }

/* Review */
.review-card { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.review-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.review-row:last-child { border-bottom: none; }
.review-row dt { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.review-row dd { color: var(--navy); }
.review-row dd strong { font-weight: 600; }

/* Waiting + confirmation */
.waiting { text-align: center; padding: 48px 20px; }
.waiting .spinner { width: 48px; height: 48px; border-width: 4px; margin: 0 auto 24px; }
.waiting h3 { font-family: var(--font-serif); font-size: 1.6rem; color: var(--navy); margin-bottom: 10px; }
.waiting p { color: var(--text-secondary); max-width: 420px; margin: 0 auto 8px; line-height: 1.6; }
.waiting .elapsed { font-size: 0.8rem; color: var(--text-light); margin-top: 16px; }
.confirm-details { margin: 28px auto 0; max-width: 460px; text-align: left; }
.confirm-ref { margin-top: 24px; padding: 16px 20px; background: var(--cream); border-radius: 8px; font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }
.confirm-ref code { font-family: var(--font-sans); font-weight: 600; color: var(--navy); font-size: 1rem; letter-spacing: 0.04em; }

/* Sidebar */
.book-sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 100px; }
.side-card { background: var(--white); padding: 32px; border-radius: 8px; border: 1px solid var(--border); }
.side-card h4 { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.side-card > p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.side-card .form-group { margin-bottom: 14px; }
.side-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.5; }
.side-list li { display: flex; gap: 10px; }
.side-list li::before { content: '✓'; color: var(--gold); font-weight: 700; flex-shrink: 0; }

@media (max-width: 960px) {
    .book-grid { grid-template-columns: 1fr; }
    .book-sidebar { position: static; }
    .book-main { padding: 28px 20px 32px; }
    .stepper li { font-size: 0; }
    .stepper li .dot { font-size: 0.8rem; }
    .choice-grid { grid-template-columns: 1fr; }
    .review-row { grid-template-columns: 1fr; gap: 4px; }
    .form-row { grid-template-columns: 1fr; }
    .panel-title { font-size: 1.35rem; }
}

/* ===== Review fixes 2026-11-03 ===== */
[hidden] { display: none !important; }                     /* author display rules must not defeat the hidden attribute */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
fieldset.choice-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.book-page .btn-primary { background: var(--navy); color: var(--white); }            /* AA contrast: white on navy */
.book-page .btn-primary:hover { background: var(--navy-light); box-shadow: 0 8px 25px rgba(26,39,68,0.25); }
.patient-type-option input:focus-visible + .patient-type-card,
.physician-option input:focus-visible + .physician-card { outline: 2px solid var(--navy); outline-offset: 2px; }
.day-pill:focus-visible, .time-chip:focus-visible, .btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.day-pill .cnt { color: var(--text-secondary); }
.time-chip.selected, .time-chip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: var(--white); }
.time-chip.selected small, .time-chip[aria-pressed="true"] small { color: rgba(255,255,255,0.8); }
.stepper li.current .dot { background: var(--navy); border-color: var(--navy); color: var(--white); box-shadow: 0 0 0 4px rgba(201,169,110,0.35); }
.stepper li.done .dot { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.stepper li.done::before { background: var(--gold); }
.panel-title:focus { outline: none; }
.panel-title:focus-visible { outline: 2px solid var(--navy); outline-offset: 4px; }
.alert-warn { background: #fff7e6; border: 1px solid #f0d9a8; color: #7a5a14; }
.alert-success { background: #eaf4ee; border: 1px solid #bfe0cc; color: #1f5a3a; }
.ref-box { margin: 28px auto 0; max-width: 460px; padding: 22px 24px; background: var(--navy); color: var(--white); border-radius: 8px; text-align: center; }
.ref-box .ref-label { display: block; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-light); margin-bottom: 8px; }
.ref-box code { display: block; font-family: var(--font-sans); font-size: clamp(1.05rem, 5.2vw, 1.5rem); font-weight: 600; letter-spacing: 0.06em; color: var(--white); white-space: nowrap; overflow-x: auto; }
.ref-box p { color: rgba(255,255,255,0.8); font-size: 0.85rem; margin: 12px auto 0; max-width: 380px; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.confirm-actions .btn { padding: 12px 18px; font-size: 0.85rem; }
.wait-note { margin-top: 20px; font-size: 0.85rem; color: var(--text-light); }
.unconfirmed { text-align: center; padding: 40px 20px; }
.unconfirmed h3 { font-family: var(--font-serif); font-size: 1.6rem; color: var(--navy); margin-bottom: 12px; }
.unconfirmed p { color: var(--text-secondary); max-width: 460px; margin: 0 auto 10px; line-height: 1.6; }
.truncated-note { font-size: 0.82rem; color: var(--text-secondary); margin-top: 12px; }
@media print {
  .top-bar, .navbar, .page-hero, .breadcrumbs, .book-sidebar, .footer, .stepper, .sandbox-banner, .confirm-actions { display: none !important; }
  .book-main { box-shadow: none; border: none; padding: 0; }
  .ref-box { background: none; color: #000; border: 2px solid #000; }
  .ref-box code, .ref-box .ref-label, .ref-box p { color: #000; }
}

/* ===== Review fixes round 4 ===== */
.link-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: var(--gold-dark); text-decoration: underline; cursor: pointer; }
.link-btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.book-main .booking-confirmation { padding: 40px 0; }
@media (max-width: 480px) { .ref-box { padding: 18px 14px; } .confirm-actions .btn { padding: 10px 12px; font-size: 0.8rem; } }

/* Confirmation: next step (medical history form) */
.next-step { margin: 22px 0 6px; padding: 22px 24px; border: 1px solid var(--gold); border-radius: 12px; background: var(--cream); text-align: left; }
.next-step[hidden] { display: none; }
.next-step h4 { font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; color: var(--navy); margin: 0 0 6px; }
.next-step p { color: var(--text-secondary); margin: 0 0 16px; line-height: 1.6; }

/* ===== Insurance (booking details + card.html) ===== */
.ins-box { border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px 8px; margin: 6px 0 22px; background: var(--cream); }
.ins-box legend { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 600; color: var(--navy); padding: 0 8px; }
.ins-box .field-hint { margin: 0 0 14px; }
.pill-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill span { display: inline-block; padding: 11px 20px; border: 1px solid var(--border); border-radius: 999px; background: var(--white); color: var(--navy); font-size: .93rem; transition: all .15s ease; }
.pill input:checked + span { background: var(--navy); border-color: var(--navy); color: var(--white); }
.pill input:focus-visible + span { outline: 2px solid var(--gold-dark); outline-offset: 2px; }
.pill:hover span { border-color: var(--gold); }
.ins-part[hidden] { display: none; }
.ins-box select, .ins-box input[type="text"] { background: var(--white); }
.card-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.card-tile { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1.586; border: 2px dashed var(--gold); border-radius: 12px; background: var(--white) center / cover no-repeat; cursor: pointer; overflow: hidden; text-align: center; }
.card-tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.card-tile-body { padding: 10px; color: var(--navy); font-size: .95rem; line-height: 1.4; pointer-events: none; }
.card-tile-body strong { display: block; font-family: var(--font-serif); font-size: 1.15rem; }
.card-tile-body small { color: var(--text-light); }
.card-tile.has-photo { border-style: solid; border-color: var(--navy); }
.card-tile.has-photo .card-tile-body { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15,26,46,.78); color: var(--white); padding: 6px 8px; font-size: .8rem; }
.card-tile.has-photo .card-tile-body strong { font-family: var(--font-sans); font-size: .82rem; font-weight: 600; display: inline; }
.card-tile.has-photo .card-tile-body small { color: var(--gold-light); }
.card-tile.has-error { border-color: #a23b3b; }
.card-tile:focus-within { outline: 2px solid var(--gold-dark); outline-offset: 2px; }
.card-status { margin: 16px 0 0; padding: 14px 18px; border-radius: 10px; font-size: .95rem; line-height: 1.55; text-align: left; }
.card-status[hidden] { display: none; }
.card-status.is-busy { background: var(--cream); color: var(--navy); border: 1px solid var(--border); }
.card-status.is-ok { background: #edf6ef; color: #1f5132; border: 1px solid #cfe5d5; }
.card-status.is-bad { background: #fbeeee; color: #7a2323; border: 1px solid #efd0d0; }
@media (max-width: 520px) { .card-tiles { grid-template-columns: 1fr; } .card-tile { aspect-ratio: 1.9; } }
