/* Ample booking page (SF-6). Colours, gradient and type scale follow src/theme/tokens.ts.
 * Coral is the app's "now" colour: here it appears only in the mark's sun and the Today dot.
 * System fonts only (SF Pro on Apple, Roboto on Android): nothing is loaded from anywhere. */

:root {
  color-scheme: light;
  --g0: #c3cce4; --g1: #cdd0dd; --g2: #dcd6d0; --g3: #e7ddd0; --g4: #d9e2e2;
  --ink: #1a1c22;
  --ink-soft: #565962;
  --ink-faint: #6c6f77;          /* tokens' inkFaint, darkened to pass AA on the sheet */
  --sheet: #faf9f7;
  --sheet-clear: rgba(250, 249, 247, 0);
  --line: rgba(26, 28, 34, 0.10);
  --fill: rgba(26, 28, 34, 0.05);
  --fill-hover: rgba(26, 28, 34, 0.09);
  --chip-line: rgba(26, 28, 34, 0.09);
  --chip: #ffffff;
  --chip-shadow: 0 1px 2px rgba(26, 28, 34, 0.05);
  --on-ink: #ffffff;
  --coral: #d85a30;
  --sheet-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 -18px 40px -28px rgba(74, 90, 120, 0.45);
  --ring: rgba(26, 28, 34, 0.55);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 30px 70px -30px rgba(74, 90, 120, 0.38), 0 2px 6px -2px rgba(74, 90, 120, 0.10);
  --button-shadow: 0 6px 16px -6px rgba(26, 28, 34, 0.35);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, Roboto, "Segoe UI", "Helvetica Neue", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, Roboto, "Segoe UI", "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --fast: 160ms;
  --calm: 220ms;
  --gutter: 16px;
  --sheet-pad: 16px;
  --radius-sheet: 28px;
  --radius-field: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --g0: #1c2133; --g1: #222538; --g2: #2a2834; --g3: #2e2a2d; --g4: #212a2c;
    --ink: #eeece8;
    --ink-soft: #b4b6bd;
    --ink-faint: #9497a0;
    --sheet: #1e2027;
    --sheet-clear: rgba(30, 32, 39, 0);
    --line: rgba(238, 236, 232, 0.10);
    --fill: rgba(238, 236, 232, 0.06);
    --fill-hover: rgba(238, 236, 232, 0.11);
    --chip-line: rgba(238, 236, 232, 0.08);
    --chip: rgba(238, 236, 232, 0.06);
    --chip-shadow: 0 0 0 transparent;
    --on-ink: #1a1c22;
    --coral: #ef956b;
    --sheet-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 -18px 40px -28px rgba(0, 0, 0, 0.6);
    --ring: rgba(238, 236, 232, 0.6);
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 30px 70px -30px rgba(0, 0, 0, 0.6);
    --button-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
  background: var(--g2);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: linear-gradient(180deg, var(--g0) 0%, var(--g1) 20%, var(--g2) 46%, var(--g3) 66%, var(--g4) 100%) fixed;
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
p { margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- Page frame: header on the gradient, a sheet that rises from below (like the app's sheets) ---- */
.page {
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100dvh;
  max-width: 560px; margin: 0 auto;
  padding-top: max(32px, env(safe-area-inset-top));
}
.masthead {
  padding: 0 calc(var(--gutter) + 4px) 24px;
  padding-left: max(calc(var(--gutter) + 4px), env(safe-area-inset-left));
  padding-right: max(calc(var(--gutter) + 4px), env(safe-area-inset-right));
}
.mark { display: block; width: 30px; height: 43px; margin-bottom: 22px; filter: drop-shadow(0 6px 10px rgba(74, 90, 120, 0.18)); }

h1 {
  font: 300 30px/36px var(--font-display);
  letter-spacing: -0.6px;
  margin: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
h1:focus { outline: none; }
.with { margin-top: 4px; font-size: 17px; color: var(--ink-soft); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--ink-soft); font-size: 13.5px; }
.meta li { display: inline-flex; align-items: center; gap: 6px; }
.meta svg { width: 15px; height: 15px; flex: none; opacity: 0.85; }

.sheet {
  position: relative;
  flex: 1;
  background: var(--sheet);
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  box-shadow: var(--sheet-shadow);
  padding: 0 var(--sheet-pad) 24px;
  padding-left: max(var(--sheet-pad), env(safe-area-inset-left));
  padding-right: max(var(--sheet-pad), env(safe-area-inset-right));
}
.foot {
  background: var(--sheet);
  padding: 4px calc(var(--sheet-pad) + 4px) max(28px, env(safe-area-inset-bottom));
  color: var(--ink-faint);
  font-size: 12.5px;
  line-height: 1.5;
}
.foot p { max-width: 42ch; }

@media (min-width: 640px) {
  :root { --sheet-pad: 28px; }
  .page { padding: 72px 24px 48px; min-height: 0; }
  .masthead { padding: 0 32px 28px; }
  .mark { width: 34px; height: 49px; }
  h1 { font-size: 34px; line-height: 40px; letter-spacing: -0.8px; }
  .sheet { flex: none; border-radius: var(--radius-sheet); box-shadow: var(--shadow); padding-bottom: 28px; }
  .foot { background: none; padding: 20px 32px 0; }
}

/* ---- View changes: a short fade and drift, only in answer to the guest's action ---- */
.view { animation: enter var(--calm) var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- Times, grouped by day ---- */
.day + .day { margin-top: 10px; }
.day-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: baseline; gap: 8px;
  margin: 0 calc(-1 * var(--sheet-pad));
  padding: 14px var(--sheet-pad) 10px;
  background: linear-gradient(var(--sheet) 78%, var(--sheet-clear));
  border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
  font-size: 15px; font-weight: 600; letter-spacing: -0.1px;
}
.day:first-of-type .day-head { padding-top: 22px; }
.day:not(:first-of-type) .day-head { border-radius: 0; }
.day-head .date { font-weight: 400; color: var(--ink-soft); }
.today { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.today::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }

.times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  margin: 0; padding: 0 0 6px; list-style: none;
}

button, .button {
  font: inherit; color: inherit; margin: 0; border: 0; background: none; cursor: pointer;
  text-decoration: none; text-align: center;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
button:focus-visible, .button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px;
}

.times li { display: flex; }
.time {
  width: 100%;
  display: inline-flex; align-items: baseline; justify-content: center; gap: 3px;
  min-height: 44px; padding: 11px 12px;
  border-radius: 999px;
  background: var(--chip);
  box-shadow: inset 0 0 0 1px var(--chip-line), var(--chip-shadow);
  font-size: 15px; font-weight: 500; letter-spacing: -0.1px;
  font-variant-numeric: tabular-nums;
  transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.time .ap { font-size: 12px; font-weight: 500; color: var(--ink-soft); transition: color var(--fast) var(--ease); }
.time:active { transform: scale(0.97); }
.time[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); box-shadow: var(--button-shadow); }
.time[aria-pressed="true"] .ap { color: inherit; opacity: 0.75; }
@media (hover: hover) {
  .time:hover { background: var(--fill-hover); }
  .time[aria-pressed="true"]:hover { background: var(--ink); }
}

/* The chosen time and Continue stay in reach at the bottom of the screen. */
.dock {
  position: sticky; bottom: 0; z-index: 3;
  margin: 8px calc(-1 * var(--sheet-pad)) -24px;
  padding: 30px var(--sheet-pad) max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(var(--sheet-clear), var(--sheet) 24px);
  animation: rise var(--calm) var(--ease) both;
}
.dock-when { margin-bottom: 10px; text-align: center; font-size: 13.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (min-width: 640px) { .dock { margin-bottom: -28px; border-radius: 0 0 var(--radius-sheet) var(--radius-sheet); padding-bottom: 24px; } }

/* ---- Buttons ---- */
.primary, .secondary, .quiet {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 14px 18px;
  border-radius: 16px;
  font-size: 16px; font-weight: 600; letter-spacing: -0.2px;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease), opacity var(--fast) var(--ease);
}
.primary { background: var(--ink); color: var(--on-ink); box-shadow: var(--button-shadow); }
.secondary { background: var(--fill); }
.quiet { min-height: 44px; font-weight: 500; color: var(--ink-soft); }
.primary:active, .secondary:active, .quiet:active { transform: scale(0.98); }
@media (hover: hover) {
  .primary:hover { opacity: 0.9; }
  .secondary:hover, .quiet:hover { background: var(--fill-hover); }
}
.actions { display: grid; gap: 10px; margin-top: 22px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button svg, button svg { width: 18px; height: 18px; flex: none; }

/* ---- The chosen time, set like the app's display numeral ---- */
.summary { padding: 26px 0 22px; border-bottom: 1px solid var(--line); }
.summary .day-line { font-size: 15px; font-weight: 600; }
.big {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px;
  margin-top: 6px;
  font: 300 52px/1 var(--font-display); letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
}
.big .ap { font-size: 22px; letter-spacing: -0.3px; color: var(--ink-soft); }
.big .until { font-size: 17px; font-weight: 400; letter-spacing: -0.2px; color: var(--ink-soft); }
.summary .zone { margin-top: 10px; font-size: 13.5px; color: var(--ink-faint); }
.summary.compact { padding: 18px 0; }
.summary.compact .big { font-size: 40px; letter-spacing: -1.4px; }

/* ---- Name ---- */
.field { margin-top: 22px; }
.field label { display: block; font-size: 15px; font-weight: 600; }
.hint { margin-top: 2px; font-size: 13.5px; color: var(--ink-soft); }
input[type="text"] {
  display: block; width: 100%; margin-top: 10px; min-height: 52px;
  font: 400 16px/1.3 var(--font); color: var(--ink);   /* 16px keeps iOS from zooming in */
  background: var(--fill); border: 1px solid transparent; border-radius: var(--radius-field);
  padding: 14px 16px;
  transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
  -webkit-appearance: none; appearance: none;
}
input[type="text"]::placeholder { color: var(--ink-faint); }
input[type="text"]:focus { background: var(--sheet); border-color: var(--line); }
input[type="text"]:focus-visible { outline-offset: 1px; }
input[aria-invalid="true"] { border-color: var(--ink-soft); }
.error { margin-top: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.error:empty { display: none; }

/* ---- Text blocks ---- */
.lede { margin-top: 18px; color: var(--ink-soft); max-width: 46ch; }
.note { margin-top: 18px; font-size: 13.5px; color: var(--ink-faint); max-width: 52ch; }
.done-note { margin-top: 12px; text-align: center; font-size: 13.5px; color: var(--ink-soft); }
.done-note:empty { margin: 0; }

details.message { margin-top: 18px; border-radius: var(--radius-field); background: var(--fill); }
details.message summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px; padding: 12px 16px; border-radius: var(--radius-field);
  cursor: pointer; list-style: none; font-size: 14px; font-weight: 500; color: var(--ink-soft);
}
details.message summary::-webkit-details-marker { display: none; }
details.message summary svg { width: 16px; height: 16px; transition: transform var(--fast) var(--ease); }
details.message[open] summary svg { transform: rotate(180deg); }
details.message pre {
  margin: 0; padding: 0 16px 16px;
  white-space: pre-wrap; overflow-wrap: anywhere;
  font: 400 13.5px/1.5 var(--font); color: var(--ink-soft);
  user-select: text; -webkit-user-select: text;
}

/* ---- Quiet states: expired, passed, incomplete ---- */
.state { padding: 28px 0 8px; }
.state .title { font-size: 19px; font-weight: 600; letter-spacing: -0.3px; }
.state .lede { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
