/* The logo's black and gold for the header, then warm paper and a white card for the form: the
   brand up top, and the part people have to read and type into kept light and plain. */
:root {
  --paper: #f6f1e7;
  --card: #ffffff;
  --ink: #1c1710;
  --ink-soft: #6b5f4c;
  --line: #e6dccb;
  --gold: #c39a45;
  --gold-light: #f6e7b0;
  --gold-dark: #8a6a2a;
  /* The foil: light at the top-left, deepening across, as on the logo's letters. */
  --foil: linear-gradient(135deg, #f6e7b0 0%, #e2c273 30%, #c39a45 58%, #f0d994 82%, #b88c3a 100%);
  --on-gold: #14100a;
  /* A chosen option: the logo's own pairing, gold on black. */
  --selected-bg: #0a0a0a;
  --selected-ink: #f6e7b0;
  --error: #b3261e;
  --serif: "Playfair Display", "Bodoni 72", Didot, Georgia, serif;
  --sans: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }

/* The same shopfront photo, and the same 50% black wash over it, as the reservation section on
   jafra.com.au. On a fixed layer of its own rather than background-attachment: fixed, which iOS
   Safari ignores — this way the photo holds still while the form scrolls over it on every device. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    #0a0a0a url("booking-bg.jpg?v=6") center / cover no-repeat;
}

.hero {
  background: #000;
  text-align: center;
  padding: 36px 20px 92px;
}

.hero h1 { margin: 0; }

/* The logo file is 470px wide, so it is never drawn larger than that — scaling a small bitmap up
   is what makes foil lettering look smeared. */
.hero h1 img {
  display: block;
  width: min(470px, 100%);
  height: auto;
  margin: 0 auto;
}

.tagline {
  margin: 14px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: #f3ecdc;
}

main {
  max-width: 640px;
  margin: -56px auto 0;
  padding: 0 16px;
}

.card {
  background: var(--card);
  border-radius: 20px;
  padding: 8px 22px 26px;
  box-shadow: 0 14px 44px rgba(20, 16, 10, 0.28);
  /* The box is the logo's colours again — black with gold — sitting on the light page. Done by
     re-pointing the palette inside the card, so everything in it follows without its own rule. */
  --card: #141414;
  --ink: #f3ecdc;
  --ink-soft: #a89d86;
  --line: #2f2a20;
  --gold: #d4af61;
  --error: #f2a39b;
  color: var(--ink);
  color-scheme: dark;
  border: 1px solid var(--line);
}

.card .step-number,
.card .choice[aria-checked="true"],
.card .tick {
  background: var(--foil);
  border-color: var(--gold);
  color: var(--on-gold);
}
.card.success h2 { color: var(--gold-light); }

.step { padding: 22px 0 6px; }
.step + .step { border-top: 1px solid var(--line); }

h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--selected-bg);
  color: var(--selected-ink);
  font-size: 13px;
  font-weight: 600;
  flex: none;
}

.hint { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); }
.hint:empty { display: none; }
.other-date span { white-space: nowrap; }

/* Shown while days and times are on their way from the server. */
.loading { display: flex; align-items: center; gap: 10px; }
.date-strip .loading { margin: 0; min-height: 74px; }
.spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
.when { margin-top: 2px; color: var(--gold); font-weight: 600; }

/* Choice buttons — guests, days and times all share one look. */
.choice {
  appearance: none;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  border-radius: 12px;
  min-height: 46px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, transform 0.06s;
}
.choice:hover:not(:disabled) { border-color: var(--gold); }
.choice:active:not(:disabled) { transform: scale(0.97); }
.choice[aria-checked="true"] {
  background: var(--selected-bg);
  border-color: var(--selected-bg);
  color: var(--selected-ink);
  font-weight: 600;
}
.choice:disabled { opacity: 0.38; cursor: not-allowed; text-decoration: line-through; }
.choice:focus-visible, input:focus-visible, textarea:focus-visible, .primary:focus-visible, .secondary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* Adults and children: a pair of steppers, because a button per number stops fitting at 25. The
   number can be typed too, so a party of twenty is not twenty taps. */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.counter {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
}
.counter-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
}
.counter-label em { font-style: normal; font-weight: 400; letter-spacing: 0; text-transform: none; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.stepper button {
  appearance: none;
  flex: none;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--foil);
  color: var(--on-gold);
  font: inherit;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.06s, opacity 0.12s;
}
.stepper button:active:not(:disabled) { transform: scale(0.92); }
.stepper button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.stepper button:disabled {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--line);
  color: var(--ink-soft);
  opacity: 0.6;
  cursor: not-allowed;
}
.stepper input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  border: none;
  font-family: var(--serif);
  font-size: 30px;
  /* Playfair's default old-style figures draw a 0 like a small letter o. */
  font-variant-numeric: lining-nums;
  line-height: 1.2;
  text-align: center;
}
.party-total {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  font-variant-numeric: lining-nums;
  text-align: center;
  color: var(--gold-light);
}

.date-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin: 0 -2px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.date-strip .choice {
  flex: 0 0 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  min-height: 74px;
  scroll-snap-align: start;
  line-height: 1.2;
}
.date-strip .choice:disabled { text-decoration: none; }
.date-strip .dow { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.75; }
.date-strip .dom { font-size: 22px; font-weight: 600; }
.date-strip .mon { font-size: 12px; opacity: 0.75; }

.other-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Wraps as a whole onto a second line on the narrowest phones, rather than breaking mid-phrase. */
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-soft);
}

.time-group + .time-group { margin-top: 16px; }
.time-group h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* 84px so a typical phone fits three times across, not two — a third less scrolling to reach dinner. */
.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.time-grid .choice { padding: 0 4px; white-space: nowrap; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field:first-child, .field-wide { grid-column: 1 / -1; }
.field em { font-style: normal; font-weight: 400; color: var(--ink-soft); }

.options { min-width: 0; margin: 16px 0 0; padding: 0; border: none; display: grid; gap: 8px; }
.options legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.options em { font-style: normal; font-weight: 400; color: var(--ink-soft); }
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.check:hover, .check:has(input:checked) { border-color: var(--gold); }
.check input {
  appearance: none;
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1.5px solid var(--ink-soft);
  border-radius: 7px;
  cursor: pointer;
}
.check input:checked { border-color: var(--gold); background: var(--foil); }
.check input:checked::after { content: "✓"; color: var(--on-gold); font-size: 16px; font-weight: 600; line-height: 1; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"], textarea {
  width: 100%;
  font: inherit;
  /* 16px minimum, or iOS zooms the page on focus. */
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
input[type="date"] { width: auto; padding: 9px 12px; }
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; }
input[aria-invalid="true"] { border-color: var(--error); }

.field-error { min-height: 0; font-size: 13px; font-weight: 400; color: var(--error); }
.field-error:empty { display: none; }

/* "Did you mean …@gmail.com?" under the email box: a nudge, not an error. */
.email-suggestion { font-size: 13px; font-weight: 400; color: var(--ink-soft); }
.email-suggestion[hidden] { display: none; }
.email-suggestion .nowrap { white-space: nowrap; }
.email-keep { display: block; margin-top: 2px; }
.email-keep[hidden] { display: none; }
.email-keep strong { font-weight: 600; color: var(--ink); }
.email-suggestion button {
  font: inherit; font-weight: 600; color: var(--gold); background: none; border: 0; padding: 0;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; word-break: break-all;
}

/* Off-screen rather than display:none — the bots this is for skip fields that are plainly hidden. */
.field-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-error {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--error) 12%, transparent);
  color: var(--error);
  font-size: 14.5px;
}

.primary, .secondary {
  width: 100%;
  font: inherit;
  font-weight: 600;
  border-radius: 14px;
  min-height: 54px;
  cursor: pointer;
}
.primary {
  margin-top: 22px;
  border: none;
  background: var(--foil);
  color: var(--on-gold);
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.primary:disabled { opacity: 0.6; cursor: progress; }
.secondary {
  margin-top: 20px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.success { text-align: center; padding-top: 34px; }
.success h2 { justify-content: center; font-family: var(--serif); font-weight: 400; font-size: 28px; margin-bottom: 8px; }
.tick {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--foil);
  color: var(--on-gold);
  font-size: 30px;
}
.summary {
  margin: 22px 0 6px;
  text-align: left;
  border-top: 1px solid var(--line);
}
.summary div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary dt { color: var(--ink-soft); font-size: 14px; }
.summary dd { margin: 0; font-weight: 600; text-align: right; }

footer {
  max-width: 640px;
  margin: 0 auto;
  padding: 30px 20px 44px;
  text-align: center;
  font-size: 13.5px;
  color: #e9e1d0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
footer p { margin: 2px 0; }
#footer-name { color: var(--gold-light); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }

[hidden] { display: none !important; }

@media (max-width: 480px) {
  .card { padding: 4px 16px 22px; }
  .fields { grid-template-columns: 1fr; }
  .field { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
