/* =========================================================================
   ON3 — Booking skin
   Loaded after css/styles.css on the booking pages. It only redefines
   design tokens (colour and type) so the booking flow carries the same
   espresso / parchment / oxblood palette and type as the homepage. No
   layout, logic or component styles change here.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Michroma&family=Instrument+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --ink: #1b1310;
  --accent: #6e2a26;          /* oxblood; white text on it is ~10:1 */
  --on-dark: #f3ead9;
  --on-dark-dim: rgba(243, 234, 217, 0.72);

  --page-bg: #efe6d5;
  --page-bg-alt: #e8dcc6;
  --card-bg: #fbf7ef;
  --surface-inverse: #1b1310;
  --text-primary: #1b1310;
  --text-secondary: #2e221d;
  --text-muted: rgba(27, 19, 16, 0.66);
  --text-faint: rgba(27, 19, 16, 0.45);
  --accent-text: #6e2a26;
  --border: rgba(27, 19, 16, 0.18);
  --border-soft: rgba(27, 19, 16, 0.1);

  --font-display: 'Michroma', 'Eurostile', 'Arial Narrow', sans-serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #a8433a;        /* lifted oxblood; white text ~5.4:1 */
    --page-bg: #1b1310;
    --page-bg-alt: #241915;
    --card-bg: #2a1e19;
    --surface-inverse: #3a2119;
    --text-primary: #f3ead9;
    --text-secondary: #ddd2bf;
    --text-muted: rgba(243, 234, 217, 0.68);
    --text-faint: rgba(243, 234, 217, 0.45);
    --accent-text: #f0c48a;
    --border: rgba(243, 234, 217, 0.16);
    --border-soft: rgba(243, 234, 217, 0.09);
  }
}
:root[data-theme="dark"] {
  --accent: #a8433a;
  --page-bg: #1b1310;
  --page-bg-alt: #241915;
  --card-bg: #2a1e19;
  --surface-inverse: #3a2119;
  --text-primary: #f3ead9;
  --text-secondary: #ddd2bf;
  --text-muted: rgba(243, 234, 217, 0.68);
  --text-faint: rgba(243, 234, 217, 0.45);
  --accent-text: #f0c48a;
  --border: rgba(243, 234, 217, 0.16);
  --border-soft: rgba(243, 234, 217, 0.09);
}
:root[data-theme="light"] {
  --accent: #6e2a26;
  --page-bg: #efe6d5;
  --page-bg-alt: #e8dcc6;
  --card-bg: #fbf7ef;
  --surface-inverse: #1b1310;
  --text-primary: #1b1310;
  --text-secondary: #2e221d;
  --text-muted: rgba(27, 19, 16, 0.66);
  --text-faint: rgba(27, 19, 16, 0.45);
  --accent-text: #6e2a26;
  --border: rgba(27, 19, 16, 0.18);
  --border-soft: rgba(27, 19, 16, 0.1);
}

/* Michroma is wide and has one weight: keep display text a size down and
   never faux-bold it. */
h1, h2, h3, h4 { font-weight: 400; letter-spacing: 0.005em; }
.flow-title { font-size: clamp(1.15rem, 0.9rem + 1.2vw, 1.6rem); line-height: 1.3; }
.price-block__amount { font-size: clamp(1.7rem, 4.5vw, 2.3rem); }

/* The hour-scale labels under the duration slider are real information,
   not decoration: lift them from --text-faint so they meet 4.5:1. */
.hours-scale span { color: var(--text-muted); }
/* The GST / weekend-loading note is pricing information; give it full
   legibility on the dark price block. */
.price-block__gst { color: var(--on-dark-dim); }

/* =========================================================================
   Checkout and payment states
   The final step (summary, details, payment hand-off) and the screens a
   customer lands on after Stripe. Token-only colours so both themes work.
   ========================================================================= */

:root {
  --ok: #2f6b45;
  --ok-bg: rgba(47, 107, 69, 0.12);
  --warn: #9a3a1f;
  --warn-bg: rgba(154, 58, 31, 0.1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ok: #8fd0a4; --ok-bg: rgba(143, 208, 164, 0.14); --warn: #f2a47e; --warn-bg: rgba(242, 164, 126, 0.13); }
}
:root[data-theme="dark"] { --ok: #8fd0a4; --ok-bg: rgba(143, 208, 164, 0.14); --warn: #f2a47e; --warn-bg: rgba(242, 164, 126, 0.13); }
:root[data-theme="light"] { --ok: #2f6b45; --ok-bg: rgba(47, 107, 69, 0.12); --warn: #9a3a1f; --warn-bg: rgba(154, 58, 31, 0.1); }

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

/* ---- Order summary ---- */
.order-summary {
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  text-align: left;
}
.order-summary__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-3); }
.order-summary__title { font-weight: 600; color: var(--text-primary); }
.order-summary__when { margin-top: 0.2rem; font-size: 0.92rem; color: var(--text-muted); }
.order-summary__edit { margin-top: 0; flex-shrink: 0; min-height: 44px; padding: 0 0.25rem; }
.order-summary__lines {
  list-style: none; margin: var(--space-3) 0 0; padding: var(--space-3) 0 0;
  border-top: 1px dashed var(--border);
  display: flex; flex-direction: column; gap: 0.45rem;
}
.order-summary__lines li { display: flex; justify-content: space-between; gap: var(--space-3); font-size: 0.9rem; color: var(--text-secondary); }
.order-summary__lines li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-summary__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3);
  margin-top: var(--space-3); padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-weight: 600;
}
.order-summary__amount { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: var(--text-primary); }
.order-summary__foot { margin-top: 0.3rem; font-size: 0.8rem; color: var(--text-muted); text-align: right; }
.order-summary__ref { margin-top: var(--space-3); font-size: 0.85rem; color: var(--text-muted); }
.order-summary__ref strong { font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.06em; color: var(--text-primary); }

/* ---- Sections and fields ---- */
.checkout-section { margin-top: var(--space-5); }
.checkout-section__title {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: var(--space-3);
}
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-label { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.field-hint { font-size: 0.8rem; color: var(--text-muted); }
.field-error { font-size: 0.82rem; font-weight: 600; color: var(--warn); }
.flow-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.flow-input[aria-invalid="true"] { border-color: var(--warn); }
.flow-input:disabled { opacity: 0.6; }
.contact-form { gap: var(--space-3); }

/* ---- Payment / next-steps panel ---- */
.pay-panel {
  padding: var(--space-4);
  border-radius: var(--radius-l);
  background: var(--page-bg-alt);
  border: 1px solid var(--border-soft);
}
.pay-panel .checkout-section__title { color: var(--text-primary); }
.pay-panel__icon { display: inline-flex; color: var(--accent-text); }
.next-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 0.6rem; }
.next-steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 1.6rem 1fr; gap: 0.6rem;
  font-size: 0.92rem; color: var(--text-secondary); line-height: 1.45;
}
.next-steps li::before {
  content: counter(step);
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-primary);
}
.pay-panel__methods { margin-top: var(--space-3); font-size: 0.8rem; color: var(--text-muted); }

/* ---- Submit ---- */
.checkout-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.btn--block, .checkout-cta { width: 100%; }
.checkout-cta { position: relative; }
.checkout-cta__icon { display: inline-flex; }
.checkout-cta.is-loading { cursor: progress; }
.checkout-cta.is-loading:disabled { background: var(--text-primary); color: var(--page-bg); opacity: 0.85; }
.checkout-cta.is-loading .checkout-cta__icon { display: none; }
.checkout-cta.is-loading::before {
  content: ''; width: 1rem; height: 1rem; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: on3-spin 0.8s linear infinite;
}
.checkout-fine { font-size: 0.8rem; color: var(--text-muted); text-align: center; }

.form-alert {
  padding: var(--space-3);
  border-radius: var(--radius-m);
  background: var(--warn-bg);
  border: 1px solid var(--warn);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.form-alert:focus { outline: none; }
.form-alert__title { font-weight: 600; color: var(--warn); margin-bottom: 0.2rem; }
.form-alert .link-edit { margin-top: var(--space-2); }

/* ---- Result screens ---- */
.result { padding-top: var(--space-6); }
.result .flow-title:focus { outline: none; }
.result .order-summary { margin: 0 auto var(--space-4); max-width: 480px; }
.result__actions { display: flex; flex-direction: column; gap: var(--space-2); align-items: stretch; max-width: 480px; margin: 0 auto; }
.result__actions .btn { margin-top: 0; width: 100%; }
.result__help { margin-top: var(--space-4); font-size: 0.85rem; color: var(--text-muted); }

.status-mark {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-4);
}
.status-mark--success { background: var(--ok-bg); color: var(--ok); }
.status-mark--warn { background: var(--warn-bg); color: var(--warn); }
.status-mark--neutral, .status-mark--slow { background: var(--page-bg-alt); color: var(--text-primary); border: 1px solid var(--border); }
.status-mark--pending { background: var(--page-bg-alt); border: 1px solid var(--border); }
.status-mark__spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2.5px solid var(--border); border-top-color: var(--accent-text);
  animation: on3-spin 0.9s linear infinite;
}
@keyframes on3-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .status-mark__spinner, .checkout-cta.is-loading::before { animation-duration: 2.4s; }
}

/* =========================================================================
   Compact flow (28 Oct)
   Cuts scrolling on the booking and checkout steps: a two-week date strip,
   start times by part of day, folded add-ons, the price breakdown inside
   the sticky bar, and a pinned pay button on checkout.
   ========================================================================= */

.config-section { margin-top: var(--space-4); }
#booking-app .flow-title { margin-bottom: var(--space-3); }

/* ---- Date strip ---- */
.date-strip {
  display: flex; gap: 0.45rem;
  overflow-x: auto; scroll-snap-type: x proximity;
  padding: 2px 2px 6px; margin: 0 -2px;
  scrollbar-width: thin;
}
.date-chip {
  flex: 0 0 auto; scroll-snap-align: start;
  width: 58px; min-height: 70px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.1rem;
  border: 1px solid var(--border); border-radius: var(--radius-m);
  background: var(--card-bg); color: var(--text-primary);
  font-family: var(--font-body); cursor: pointer;
  transition: border-color 0.32s var(--ease), background 0.32s var(--ease), color 0.32s var(--ease);
}
.date-chip:hover:not(:disabled) { border-color: var(--text-primary); }
.date-chip__dow, .date-chip__mon { font-size: 0.7rem; letter-spacing: 0.04em; color: var(--text-muted); }
.date-chip__day { font-size: 1.15rem; font-weight: 600; line-height: 1.1; }
.date-chip.is-selected { background: var(--accent); border-color: var(--accent); color: var(--white); }
.date-chip.is-selected .date-chip__dow, .date-chip.is-selected .date-chip__mon { color: rgba(255, 255, 255, 0.85); }
.date-chip:disabled { cursor: not-allowed; opacity: 0.45; text-decoration: line-through; }
.date-more { margin-top: var(--space-2); }
.date-more + .calendar { margin-top: var(--space-3); }

/* ---- Start time by part of day ---- */
.segment--parts { margin-bottom: var(--space-3); }
.segment--parts .segment__opt { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* ---- Folded add-on groups ---- */
.addon-group { border-top: 1px solid var(--border-soft); padding-top: var(--space-3); }
.addon-group__summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  min-height: 44px;
}
.addon-group__summary::-webkit-details-marker { display: none; }
.addon-group__summary .config-label { margin: 0; }
.addon-group__count { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.addon-group__count.is-on { color: var(--accent-text); font-weight: 600; }
.addon-group__count::after { content: ' +'; }
.addon-group[open] .addon-group__count::after { content: ' –'; }
.addon-group[open] .toggle-list { margin-top: var(--space-2); }

/* ---- Sticky bar with the breakdown inside it ---- */
.config-bar { flex-direction: column; align-items: stretch; gap: 0; }
.config-bar__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.config-bar__toggle {
  background: none; border: 0; padding: 0; text-align: left; cursor: pointer;
  color: inherit; font: inherit; min-height: 44px; justify-content: center;
}
.config-bar__details { font-size: 0.78rem; color: var(--text-muted); }
.config-bar__details .config-bar__note { font-size: inherit; }
.config-bar__chev { color: var(--accent-text); font-weight: 600; }
.config-bar__panel {
  margin: 0 0 var(--space-3); padding: var(--space-4);
  max-height: min(55vh, 420px); overflow-y: auto;
}
.config-bar__panel .price-block__amount { font-size: 1.5rem; }

/* ---- Checkout ---- */
.order-summary--compact { margin-bottom: var(--space-4); padding: var(--space-3) var(--space-4); }
.order-summary__more > summary { list-style: none; cursor: pointer; }
.order-summary__more > summary::-webkit-details-marker { display: none; }
.order-summary__peek { font-weight: 600; font-size: 0.8rem; color: var(--accent-text); }
.order-summary__more[open] .order-summary__peek { display: none; }
.order-summary--compact .order-summary__total { margin-top: var(--space-2); padding-top: var(--space-2); }

.checkout-section { margin-top: var(--space-4); }
.contact-form--grid { display: grid; grid-template-columns: 1fr; gap: var(--space-3); }
.contact-form--grid .note-toggle { justify-self: start; }
@media (min-width: 560px) {
  .contact-form--grid { grid-template-columns: 1fr 1fr; }
  .contact-form--grid > :nth-child(n+3) { grid-column: 1 / -1; }
}

.pay-panel--compact { padding: var(--space-3) var(--space-4); }
.pay-panel__summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 0.5rem; min-height: 28px;
  font-size: 0.86rem; color: var(--text-secondary);
}
.pay-panel__summary::-webkit-details-marker { display: none; }
.pay-panel__line { flex: 1; min-width: 0; }
.pay-panel__more { font-size: 0.8rem; font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.pay-panel--compact[open] .pay-panel__more { display: none; }
.pay-panel--compact[open] .next-steps { margin-top: var(--space-3); }

.checkout-actions--sticky {
  position: sticky; bottom: var(--space-3); z-index: 5;
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: 0 12px 34px rgba(11, 11, 12, 0.16);
}
.checkout-actions--sticky .checkout-fine { font-size: 0.74rem; }
/* The bar right below already shows the total. */
.config-bar__panel .price-block__eyebrow,
.config-bar__panel .price-block__amount { display: none; }
.config-bar__panel .price-block__note { margin-top: 0; }
.checkout-actions--sticky { padding: var(--space-2) var(--space-3); gap: 0.35rem; }
/* Keep a focused field clear of the pinned bar when it scrolls into view. */
html { scroll-padding-bottom: 140px; }

/* ------------------------------------------------------------------ *
 * Top bar (book.html): stays at the top while scrolling. Back/Home on the
 * left, the ON3 wordmark centred (links home), light/dark on the right. The
 * wordmark SVG is a mask so it takes the theme's text colour.
 * ------------------------------------------------------------------ */
.book-top {
  position: sticky; top: 0; z-index: 40;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-3);
  height: 64px; padding: 0 clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--page-bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.38s var(--ease);
}
.book-top__side { display: flex; align-items: center; min-width: 0; }
.book-top__side--end { justify-content: flex-end; }
.book-top .flow-back { white-space: nowrap; }
.book-top__home {
  display: grid; place-items: center; padding: 12px 18px; border-radius: 999px; outline-offset: 2px;
  --glow: color-mix(in srgb, var(--accent-text) 0%, transparent);
  filter: drop-shadow(0 0 0 var(--glow)) drop-shadow(0 0 0 var(--glow));
  transition: filter 0.8s var(--ease);
}
.book-top__logo {
  display: block; width: 176px; aspect-ratio: 3924 / 254; background: var(--text-primary);
  -webkit-mask: url("../assets/brand/logo.svg") center / contain no-repeat; mask: url("../assets/brand/logo.svg") center / contain no-repeat;
}
/* Hover (or a tap on phones): a soft warm glow rises around the wordmark.
   The glow sits on the link because the logo's own mask would cut it off. */
.book-top__home:hover, .book-top__home:focus-visible, .book-top__home:active {
  --glow: color-mix(in srgb, var(--accent-text) 55%, transparent);
  filter: drop-shadow(0 0 6px var(--glow)) drop-shadow(0 0 18px var(--glow));
}
:root[data-theme="light"] .book-top__home:hover, :root[data-theme="light"] .book-top__home:focus-visible, :root[data-theme="light"] .book-top__home:active {
  --glow: rgba(224, 164, 88, 0.55);
}
@media (prefers-reduced-motion: reduce) { .book-top__home { transition: none; } }
@media (max-width: 480px) { .book-top__logo { width: 128px; } .book-top .theme-toggle { width: 38px; height: 38px; } }
/* The step counter keeps its own row, on the right, now Back has moved up. */
.has-book-top .flow-nav { justify-content: flex-end; padding-right: 0; }
/* Steps scroll the flow to the top of the screen; stop it under the bar. */
.has-book-top #booking-app { scroll-margin-top: 64px; }

/* × in the step row: back to the space picker (js/app.js toPicker). */
.flow-nav:has(.flow-close) { justify-content: space-between; }
.flow-close {
  display: grid; place-items: center; width: 40px; height: 40px; margin: -8px -10px -8px 0; padding: 0;
  border: 1px solid transparent; border-radius: 50%; background: none; color: var(--text-secondary);
  font: inherit; font-size: 1.75rem; font-weight: 300; line-height: 1; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease, transform 160ms ease;
}
.flow-close span { margin-top: -0.08em; }
.flow-close:hover { color: var(--text-primary); border-color: rgba(243, 234, 217, 0.18); background: rgba(243, 234, 217, 0.05); }
.flow-close:active { transform: scale(0.92); }
.flow-close:focus-visible { outline: 2px solid var(--amber, #e0a458); outline-offset: 2px; }
