/* ==========================================================================
   Santa call (guest) pages: /book wizard, private call page, pending, 404.
   Loaded AFTER app.css (layouts/public.php), which provides everything shared
   with the logged-in app and the website: tokens, header, hero, page column,
   cards, type, buttons, inputs, chips, segmented control, alerts, modal and
   footer. This file holds only what the guest pages have and the app doesn't.
   ========================================================================== */

/* The booking column: one centred 760px column (the app's panel width) in the
   website's container, like the auth pages' narrower .stack--auth. */
.stack--guest { max-width: 784px; }

/* Header note (only when a page sets $headerNote); not enough room below 1200. */
@media (max-width: 1199px) { .bar__note { display: none; } }

/* ---------- Small shared-looking bits the app has no class for ---------- */

.guest-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.link--icon { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; min-height: 44px; }
.link--icon:hover { text-decoration: none; }
.link--icon:hover span { text-decoration: underline; text-underline-offset: 3px; }
.btn svg { flex: none; }

.icon-btn {
  flex: none; width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-field); border-radius: var(--radius-field);
  background: #fff; color: var(--muted); cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--paper); border-color: var(--line-strong); color: var(--heading); }

.icon-btn:focus-visible, .check input:focus-visible, .kid-card__summary:focus-visible,
.seg__btn:focus-visible, .guest a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.kid-card__summary:focus-visible { outline-offset: -3px; border-radius: 12px; }
.stack { --focus: var(--green); }

/* Tester mode: the owner's free test bookings. */
.tester-banner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; }
.tester-banner .link { color: var(--amber); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Wizard ---------- */

.wizard { gap: var(--space-3); }

.wiz-progress { display: flex; flex-direction: column; gap: 10px; }
.wiz-progress__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 16px; font-weight: 500; line-height: 1.3; letter-spacing: 3px; color: var(--green); }
.wiz-progress__row [data-step-name] { color: var(--muted); letter-spacing: 0; font-size: 15px; }
.wiz-progress__bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wiz-progress__bar span { height: 4px; border-radius: 2px; background: var(--line); transition: background-color 0.3s ease; }
.wiz-progress__bar span.is-done { background: var(--green); }

.wiz-step { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.js .wiz-step { display: none; }
.js .wiz-step.is-active { display: flex; animation: step-in 0.28s var(--ease); }
@keyframes step-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.step-head { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: 8px; }
.card .step-title { outline: none; }
.step-lead { margin: 0; font-size: 18px; font-weight: 300; line-height: 26px; color: var(--muted); }

.kid-list { display: flex; flex-direction: column; gap: 14px; }
.kid-row { display: flex; flex-direction: column; gap: 8px; }
.kid-row__line { display: flex; gap: 8px; align-items: center; }
.kid-row__line .input { flex: 1; min-width: 0; }

.kid-details { display: flex; flex-direction: column; gap: 12px; }
.kid-card { border: 1px solid var(--line-field); border-radius: 12px; background: var(--white); transition: border-color 0.15s ease; }
.kid-card:hover { border-color: var(--line-strong); }
.kid-card__summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 14px 16px; cursor: pointer; list-style: none; }
.kid-card__summary::-webkit-details-marker, .kid-card__summary::marker { display: none; content: ""; }
.kid-card__name { font-size: 18px; font-weight: 600; color: var(--heading); }
.kid-card__hint { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--green); }
.kid-card__hint::after { content: ''; width: 8px; height: 8px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.2s ease; }
.kid-card[open] .kid-card__hint::after { transform: translateY(2px) rotate(-135deg); }
.kid-card__body { padding: 2px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.kid-card__row { display: flex; gap: 12px; }
.field--age { width: 96px; flex: none; }
.field--grow { flex: 1; min-width: 0; }

.summary { background: var(--green-soft); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.summary__names { font-weight: 600; font-size: 20px; line-height: 1.3; color: var(--heading); }
.summary__when { font-size: 15px; color: var(--muted-2); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 10px; border-top: 1px solid #cfe3d5; font-size: 15px; color: var(--muted-2); }
.summary__total strong { font-size: 20px; font-weight: 600; color: var(--heading); }

.wiz-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-top: var(--space-2); border-top: 1px solid var(--line); }
.wiz-nav .step-error { flex-basis: 100%; }
/* Until the wizard is running, don't offer Pay on step 1. */
.js [data-wizard]:not(.is-ready) [data-pay] { visibility: hidden; }
.wiz-nav__right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.trust { margin-top: -8px; text-align: center; text-wrap: balance; }
.trust svg { display: inline-block; vertical-align: -2px; margin-right: 6px; }
.help { text-align: center; }

/* ---------- Day and time picker (chips and a segmented control, as in the app) ---------- */

.picker { display: flex; flex-direction: column; gap: 20px; }
.picker__block { display: flex; flex-direction: column; gap: 10px; }
.picker__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.day-grid, .time-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
/* The app's chip, selected by aria-pressed (guest.js) as well as .on. */
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip[aria-pressed="true"]:hover { background: #1b8f55; border-color: #1b8f55; }
.chip:disabled { opacity: 0.35; cursor: not-allowed; }
.chip:disabled:hover { border-color: #d1d5db; }
.chip--day { min-height: 56px; padding: 0 2px; flex-direction: column; gap: 2px; }
.chip__dow { font-size: 12px; font-weight: 500; letter-spacing: 1px; }
.chip__dm { font-size: 16px; font-weight: 600; }
.chip--time { min-height: 44px; }

.seg__btn[aria-pressed="true"] { background: var(--green); color: #fff; }
.seg__btn[aria-pressed="true"]:hover { background: #1b8f55; }

/* "As Soon as Possible": one card above the day and time chips (the app's .toggle-row look). */
.asap { position: relative; display: block; cursor: pointer; }
.asap__input { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.asap__box { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line-field); border-radius: 12px; background: var(--white); transition: background-color 0.15s ease, border-color 0.15s ease; }
.asap:hover .asap__box { border-color: var(--line-strong); }
.asap__icon { flex: none; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green); }
.asap__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.asap__title { font-size: 16px; font-weight: 600; color: var(--heading); }
.asap__sub { font-size: 14px; line-height: 1.45; color: var(--muted); }
.asap__tick { flex: none; width: 22px; height: 22px; border: 2px solid var(--line-field); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: transparent; }
.asap__input:checked + .asap__box { background: var(--green); border-color: var(--green); }
.asap__input:checked + .asap__box .asap__title { color: #fff; }
.asap__input:checked + .asap__box .asap__sub { color: #e6f7ec; }
.asap__input:checked + .asap__box .asap__icon { background: rgba(255, 255, 255, 0.2); color: #fff; }
.asap__input:checked + .asap__box .asap__tick { background: #fff; border-color: #fff; color: var(--green); }
.asap__input:focus-visible + .asap__box { outline: 3px solid var(--focus); outline-offset: 2px; }

.picker__or { display: flex; align-items: center; gap: 12px; margin: -4px 0 -6px; font-size: 14px; font-weight: 500; letter-spacing: 1px; color: var(--faint); }
.picker__or::before, .picker__or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------- Private call page ---------- */

audio.player { display: block; width: 100%; height: 52px; padding: 0; background: none; border-radius: 999px; }
.script { margin: 0; padding: 18px 20px; background: var(--paper); border-radius: 12px; font-size: 16px; line-height: 1.6; color: var(--ink); }
.edit-form { display: flex; flex-direction: column; gap: 12px; }
.edit-form > .btn { align-self: flex-start; }
.reschedule { display: flex; flex-direction: column; gap: 20px; }

.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 16px; color: var(--muted); }
.ticks li { position: relative; padding-left: 28px; }
.ticks li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 6px; height: 11px; border-right: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(45deg); }

.writing { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0 4px; text-align: center; }
.writing__star { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--green-soft); color: var(--green); margin-bottom: 8px; animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* ---------- Small screens ---------- */

@media (max-width: 700px) {
  .step-lead { font-size: 16px; line-height: 24px; }
  .edit-form > .btn, .reschedule > .btn { align-self: stretch; }
}

@media (max-width: 575px) {
  html { scroll-padding-bottom: 150px; } /* keep focused fields clear of the sticky button bar */
  .step-lead { font-size: 15px; line-height: 22px; }
  .step-head { margin-bottom: 0; gap: 6px; }
  .wiz-progress__row { font-size: 13px; letter-spacing: 2px; }
  .wiz-progress__row [data-step-name] { font-size: 14px; }
  .kid-card__name { font-size: 17px; }
  .kid-card__row { flex-direction: column; }
  .day-grid, .time-grid { gap: 6px; }
  .chip--day { min-height: 52px; }
  .chip__dow { font-size: 11px; }
  .chip__dm { font-size: 15px; }
  .chip--time { min-height: 40px; }
  .picker__head .seg { display: flex; width: 100%; }
  .picker__head .seg__btn { flex: 1 1 0; padding: 0 6px; }
  .asap__box { padding: 12px 14px; gap: 12px; }
  .summary { padding: 12px 14px; }
  .summary__names { font-size: 18px; }
  .script { padding: 14px 16px; font-size: 15px; }
  /* Keep Back / Continue within thumb reach while scrolling. */
  .wiz-nav {
    position: sticky; bottom: 0; z-index: 2;
    margin: 0 calc(-1 * var(--card-pad)) calc(-1 * var(--card-pad));
    padding: 10px var(--card-pad) calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-radius: 0 0 var(--radius-card) var(--radius-card);
  }
  .wiz-nav .btn { min-height: 48px; font-size: 17px; padding: 8px 20px; }
  .wiz-nav .btn.quiet { padding-inline: 14px; }
}

@media (max-width: 360px) {
  .chip__dow { font-size: 10px; letter-spacing: 0.5px; }
  .chip__dm { font-size: 14px; }
  .picker__head .seg__btn { font-size: 13px; padding: 0 4px; }
}

/* Windows High Contrast and other forced-colour modes: keep selections visible. */
@media (forced-colors: active) {
  .chip[aria-pressed="true"], .seg__btn[aria-pressed="true"],
  .asap__input:checked + .asap__box { outline: 3px solid Highlight; outline-offset: -3px; }
  .wiz-progress__bar span { background: GrayText; }
  .wiz-progress__bar span.is-done { background: Highlight; }
}
