/* Bespoke by Bo-Vine: the public guest form. It speaks as Bo-Vine, so it does not use the
   internal app's style.css (DESIGN.md, "Don't apply this system to the public Bespoke guest
   form"). Tokens only below :root, as npm run check-ui requires. */

@font-face {
  font-family: 'Montserrat';
  src: url('guest/montserrat-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ink: #111111;
  --ink-hover: #2b2b2b;
  --muted: #5c5c5a;
  --line: #d4d4cf;     /* rules between summary sections */
  --edge: #8c8c8c;     /* control outlines: 3.3:1 on white (WCAG 1.4.11) */
  --soft: #f3f3f0;
  --ground: #ecebe7;
  --page: #ffffff;
  --sea: #2b5672;
  --sea-ring: rgba(43, 86, 114, 0.28);
  --bad: #b3261e;
  --scrim: rgba(12, 12, 12, 0.82);
  --shadow: rgba(17, 17, 17, 0.1);
  --shadow-strong: rgba(0, 0, 0, 0.25);
  --spin-track: rgba(255, 255, 255, 0.35);

  --font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 0.8125rem;  /* 13px: hints, errors, counters */
  --fs-sm: 0.9375rem;  /* 15px: labels, secondary text */
  --fs-base: 1rem;     /* 16px: inputs (never smaller, or iOS zooms) and body */
  --fs-md: 1.0625rem;  /* 17px: buttons, lead text */
  --fs-lg: 1.25rem;    /* 20px: band caption */
  --fs-xl: 1.75rem;    /* 28px: step headings */
  --fs-2xl: 2rem;      /* 32px: the welcome heading */

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 24px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--sea); color: var(--page); }
input, textarea { caret-color: var(--sea); }
a { color: var(--sea); text-underline-offset: 3px; }

/* The page: a phone-width column; on a laptop it becomes a card on a warm grey ground. */
.bsp { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--page); position: relative; overflow: hidden; }
@media (min-width: 700px) {
  body { background: var(--ground); padding: 40px 16px; }
  .bsp { min-height: 0; border-radius: 28px; box-shadow: 0 18px 48px var(--shadow); }
}

.bsp-body { padding: 24px var(--gutter) 36px; }
.bsp-center { text-align: center; }
.bsp p { margin: 0 0 16px; }
.bsp-muted { color: var(--muted); font-size: var(--fs-sm); }
.bsp-venue { white-space: nowrap; }
.bsp .bsp-call { display: grid; gap: 6px; margin: 24px 0 0; }
.bsp-call a { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bsp-privacy { margin-top: 16px; }

/* Welcome: Bo-Vine's own Bespoke photo, full-bleed, with the promise over its lower edge. */
.bsp-hero { position: relative; height: min(58svh, 500px); min-height: 380px; color: var(--page); background: var(--ink); }
.bsp-hero img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 28%; }
.bsp-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, var(--scrim) 92%); }
.bsp-roundel { position: absolute; z-index: 1; top: 20px; left: 50%; transform: translateX(-50%); width: 64px; height: 64px; border-radius: 50%; background: var(--page); box-shadow: 0 4px 16px var(--shadow-strong); display: grid; place-items: center; }
.bsp-roundel img { width: 58px; height: 58px; }
.bsp-hero-text { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 0 var(--gutter) 28px; text-align: center; }
.bsp-hero h1 { margin: 0 0 10px; font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; text-wrap: balance; }
.bsp-hero p { margin: 0; font-size: var(--fs-md); line-height: 1.45; text-wrap: balance; }

/* The chosen restaurant heads every later step. */
.bsp-band { position: relative; height: 184px; background: var(--ink); color: var(--page); }
.bsp-band img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; view-transition-name: venue-photo; }
.bsp-band::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 35%, var(--scrim)); }
.bsp-band span { position: absolute; z-index: 1; left: var(--gutter); right: var(--gutter); bottom: 16px; font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.01em; }

/* Step header: count and a thin bar. */
.bsp-step { padding: 22px var(--gutter) 0; }
.bsp-count { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 8px; }
.bsp-bar { height: 4px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.bsp-bar i { display: block; height: 100%; width: 100%; background: var(--ink); border-radius: 4px; transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform 0.6s var(--ease); }
.bsp h2 { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 22px 0 20px; text-wrap: balance; }

/* Fields */
.field { display: grid; gap: 8px; margin: 0 0 20px; font-size: var(--fs-sm); font-weight: 500; }
.field > .opt { font-weight: 400; color: var(--muted); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 52px; padding: 0 20px; border: 1.5px solid var(--edge); border-radius: 999px;
  background: var(--page); font-size: var(--fs-base); font-weight: 400; transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 128px; padding: 14px 20px; border-radius: 22px; resize: none; line-height: 1.5; field-sizing: content; max-height: 60vh; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 48px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 20px center; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
/* iOS Safari draws its own date control: it overflows width: 100%, ignores min-height, centres
   the value, and shows today's date when the field is empty. Size it like every other field,
   left-align it, and show "Choose a date" while it is empty. */
.bsp-date { position: relative; display: block; min-width: 0; }
.field .bsp-date input[type=date] { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-width: 0; max-width: 100%; height: 52px; line-height: 49px; padding-top: 0; padding-bottom: 0; text-align: left; }
.field .bsp-date input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 49px; line-height: 49px; }
.bsp-date.empty input[type=date] { color: transparent; }
.bsp-date.empty input[type=date]:focus { color: var(--ink); }
.bsp-date.empty::before { content: attr(data-placeholder); position: absolute; left: 21.5px; top: 0; line-height: 52px; color: var(--muted); pointer-events: none; }
.bsp-date.empty:focus-within::before { content: none; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--sea-ring); }
.field .hint { font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.field .note { font-size: var(--fs-xs); font-weight: 500; color: var(--sea); text-wrap: pretty; }
.field .err { font-size: var(--fs-xs); font-weight: 500; color: var(--bad); }
.field .err:empty, .field .note:empty { display: none; }
/* As specific as the outline rule above, or the red border never shows. */
.field.bad input:not([type=checkbox]):not([type=radio]), .field.bad select, .field.bad textarea { border-color: var(--bad); }
.field.bad .bsp-row { border-color: var(--bad); }
.field .count { justify-self: end; font-size: var(--fs-xs); font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: -2px; }

/* Choice rows: the restaurants, each with its photo. */
.field .group-label { font-size: var(--fs-sm); font-weight: 500; }
.bsp-rows { display: grid; gap: 10px; border-radius: 20px; }
.bsp-row { position: relative; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 16px; border: 1.5px solid var(--edge); border-radius: 18px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s; }
.bsp-row:hover { border-color: var(--ink); }
.bsp-row input { position: absolute; opacity: 0; pointer-events: none; }
.bsp-row img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; }
.bsp-row.has-photo { padding: 8px 16px 8px 8px; }
.bsp-row .name { flex: 1; font-weight: 500; }
.bsp-row .tick { width: 22px; height: 22px; flex: none; opacity: 0; transition: opacity 0.15s; }
.bsp-row:has(input:checked) { border: 2px solid var(--ink); padding: 7px 15px; }
.bsp-row.has-photo:has(input:checked) { padding: 7px 15px 7px 7px; }
.bsp-row:has(input:checked) .tick { opacity: 1; }
.bsp-row:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--sea-ring); }

/* Multiple choice answers as pills. */
.bsp-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.bsp-pill { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1.5px solid var(--edge); border-radius: 999px; cursor: pointer; font-weight: 500; }
.bsp-pill input { position: absolute; opacity: 0; pointer-events: none; }
.bsp-pill:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--page); }
.bsp-pill:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--sea-ring); }

/* The opt-in */
.bsp-check { display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 24px; font-size: var(--fs-sm); line-height: 1.45; cursor: pointer; }
.bsp-check input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--edge); border-radius: 6px; background: var(--page) no-repeat center / 14px; cursor: pointer; }
.bsp-check input:checked { background-color: var(--ink); border-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.bsp-check input:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--sea-ring); }

/* Buttons */
.bsp-actions { display: grid; gap: 12px; margin-top: 8px; }
.bsp-actions.spaced { margin-top: 28px; }
.bsp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 24px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--page); font-size: var(--fs-md); font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color 0.15s, transform 0.1s; }
.bsp-btn:hover { background: var(--ink-hover); }
.bsp-btn:active { transform: scale(0.99); }
.bsp-btn:focus-visible, .bsp-link:focus-visible { outline: 3px solid var(--sea); outline-offset: 3px; }
.bsp-btn.ghost { background: var(--page); color: var(--ink); }
.bsp-btn.ghost:hover { background: var(--soft); }
.bsp-btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.bsp-btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--spin-track); border-top-color: var(--page); animation: bsp-spin 0.8s linear infinite; }
@keyframes bsp-spin { to { transform: rotate(360deg); } }
.bsp-link { justify-self: center; background: none; border: 0; padding: 10px 12px; color: var(--ink); font-size: var(--fs-sm); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; border-radius: 8px; }
.bsp-msg { font-size: var(--fs-sm); color: var(--bad); text-align: center; margin: 0; }
.bsp-msg:empty { display: none; }

/* Check and Send */
.bsp-sum { margin: 0 0 8px; }
.bsp-sum section { padding: 16px 0; border-top: 1px solid var(--line); }
.bsp-sum section:last-child { border-bottom: 1px solid var(--line); }
.bsp-sum header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.bsp-sum h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.bsp-sum dl { margin: 0; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 6px 16px; font-size: var(--fs-sm); }
.bsp-sum dt { color: var(--muted); }
.bsp-sum dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
@media (max-width: 439px) {
  .bsp-sum dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .bsp-sum dd { margin-bottom: 10px; }
  .bsp-sum dd:last-child { margin-bottom: 0; }
}
.bsp-sum .bsp-link { padding: 4px 6px; margin-right: -6px; font-size: var(--fs-sm); color: var(--sea); }
.bsp-turnstile { min-height: 65px; margin: 20px 0; }
.bsp-turnstile:empty { display: none; }
.bsp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Thank you */
.bsp-thanks-photo { display: block; width: calc(100% - 2 * var(--gutter)); margin: var(--gutter) auto 0; aspect-ratio: 720 / 560; object-fit: cover; border-radius: 24px; }
.bsp-thanks h2 { text-align: center; }
.bsp-sea { color: var(--sea); font-size: var(--fs-sm); }

/* Links out to book a table */
.bsp-row .go { width: 20px; height: 20px; flex: none; color: var(--muted); }
a.bsp-row { color: var(--ink); text-decoration: none; }
a.bsp-row:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--sea-ring); }

/* One authored moment: the chosen restaurant's photo travels from its row to the band. */
@supports (view-transition-name: none) {
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; animation-timing-function: var(--ease); }
  ::view-transition-group(venue-photo) { animation-duration: 0.55s; animation-timing-function: var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  *, ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; transition: none !important; }
}

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