/* =============================================================
   Devonshire Grove — booking form (modal + inline page variants)
   Uses theme palette tokens from devonshire-grove.css.
   ============================================================= */

/* ── Modal shell ────────────────────────────────────────────── */
.dg-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
  background: color-mix(in oklab, var(--forest-deep) 70%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
  animation: dg-modal-in .24s ease-out;
}
.dg-modal[aria-hidden="false"] { display: flex; }
.dg-modal__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 60px -20px rgba(20, 32, 26, .35);
  animation: dg-panel-in .28s cubic-bezier(.2,.8,.2,1);
}
.dg-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background .2s, color .2s, border-color .2s;
}
.dg-modal__close:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

@keyframes dg-modal-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dg-panel-in { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Lock body scroll when modal open */
body.dg-modal-open { overflow: hidden; }

/* ── Form ───────────────────────────────────────────────────── */
.dg-booking {
  font-family: var(--sans);
  color: var(--ink);
  padding: 40px 36px 32px;
}
.dg-booking--page {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 32px 80px;
}

.dg-booking__header { text-align: center; margin-bottom: 28px; }
.dg-booking__kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass-2);
  margin: 0 0 14px;
}
.dg-booking__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 4.2vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--forest);
}
.dg-booking__title em { font-style: italic; color: var(--brass-2); }
.dg-booking__lede {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

/* ── Fields ─────────────────────────────────────────────────── */
/* min-width: 0 cancels fieldset's user-agent `min-width: min-content`,
   which would otherwise force the fieldset (and the form above it) to
   grow as wide as their widest child — defeating the date-pill rail's
   horizontal scroll. */
.dg-booking,
.dg-booking__step { min-width: 0; }
.dg-booking__step { border: 0; margin: 0; padding: 0; }
.dg-booking__step + .dg-booking__step { margin-top: 18px; }
.dg-booking__step[hidden] { display: none; }

.dg-booking__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
@media (max-width: 480px) {
  .dg-booking__row { grid-template-columns: 1fr; }
}
.dg-booking__field { display: block; margin-bottom: 14px; min-width: 0; }
.dg-booking__field--full { width: 100%; min-width: 0; }
.dg-booking__label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.dg-booking__label small {
  display: inline;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  margin-left: 4px;
}

.dg-booking input[type="date"],
.dg-booking input[type="text"],
.dg-booking input[type="email"],
.dg-booking input[type="tel"],
.dg-booking input[type="number"],
.dg-booking input[type="time"],
.dg-booking select,
.dg-booking textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
}
/* Suppress native spinner arrows on number inputs — they break the
   brand look. Users type the figure or use mobile numeric keyboards. */
.dg-booking input[type="number"] {
  -moz-appearance: textfield;
}
.dg-booking input[type="number"]::-webkit-outer-spin-button,
.dg-booking input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.dg-booking textarea { resize: vertical; min-height: 60px; }
.dg-booking input:focus,
.dg-booking select:focus,
.dg-booking textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--forest) 18%, transparent);
}
.dg-booking input:invalid:not(:placeholder-shown):not(:focus) {
  border-color: var(--tomato);
}

.dg-booking select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23223127' stroke-width='1.5'><polyline points='1 1.5 6 6.5 11 1.5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  padding-right: 36px;
}

/* ── Time slot pills ────────────────────────────────────────── */
.dg-booking__slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  align-items: center;
}
.dg-booking__hint {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  font-style: italic;
}
.dg-booking__slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 9px 14px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--forest);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s ease;
}
.dg-booking__slot:hover {
  border-color: var(--forest);
  color: var(--forest-deep);
}
.dg-booking__slot[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}
.dg-booking__slot[disabled] {
  opacity: .35;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Reservation type radios — visual cards, not native radio dots. */
.dg-booking__types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.dg-booking__type {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .18s ease;
}
.dg-booking__type:hover {
  border-color: var(--forest);
}
.dg-booking__type input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.dg-booking__type:has(input:checked) {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}
.dg-booking__type-title {
  font-family: var(--display, var(--mono));
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.dg-booking__type-meta {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.03em;
  opacity: 0.8;
}

/* Date pill rail — horizontally scrollable list of upcoming dates.
   Replaces the native date input so users can tap forward without
   opening a calendar picker. */
.dg-booking__date-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  min-width: 0;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding: 6px 2px 8px;
  margin: 4px 0 0;
  scroll-snap-type: x proximity;
}
.dg-booking__date-pills::-webkit-scrollbar { height: 6px; }
.dg-booking__date-pills::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}
.dg-booking__date-pill {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--sans);
  cursor: pointer;
  transition: all .18s ease;
  scroll-snap-align: start;
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
.dg-booking__date-pill:hover {
  border-color: var(--forest);
}
.dg-booking__date-pill[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}
.dg-booking__date-pill-dow {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
}
.dg-booking__date-pill-day {
  font-family: var(--display, var(--sans));
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  margin-top: 2px;
}
.dg-booking__date-pill-mon {
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 1px;
  opacity: 0.85;
}

/* Time pill rail — wraps onto multiple lines so a long evening of
   slots stays visible at a glance. One pill is auto-selected on
   render so the user doesn't have to click before continuing. */
.dg-booking__time-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  margin: 4px 0 0;
}
.dg-booking__time-pills:empty { display: none; }
.dg-booking__time-pill {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
  transition: all .18s ease;
  -webkit-appearance: none;
  appearance: none;
}
.dg-booking__time-pill:hover {
  border-color: var(--forest);
}
.dg-booking__time-pill[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--cream);
}
.dg-booking__time-pill[disabled] {
  opacity: .35;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* Min-spend message under the type picker. */
.dg-booking__min-spend {
  margin: 8px 0 14px;
  padding: 10px 12px;
  background: rgba(74, 155, 151, 0.08);
  border-left: 3px solid var(--forest);
  border-radius: 0 3px 3px 0;
  font-size: 13px;
  color: var(--forest-deep);
}

/* Pre-payment disclosure (above card field) — non-alarming but
   noticeable so the £20 hold isn't a surprise at confirm time. */
.dg-booking__disclosure {
  margin: 16px 0 12px;
  padding: 12px 14px;
  background: rgba(184, 92, 56, 0.06);
  border: 1px solid rgba(184, 92, 56, 0.18);
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--forest-deep);
}

/* Consent checkboxes — policy (required) + marketing (optional). */
.dg-booking__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--forest-deep);
  cursor: pointer;
}
.dg-booking__check input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.dg-booking__check a {
  color: var(--forest);
  text-decoration: underline;
}
.dg-booking__check--required.is-missing {
  color: #B23A48;
}
.dg-booking__check--required.is-missing input[type="checkbox"] {
  outline: 2px solid #B23A48;
  outline-offset: 2px;
}

/* ── Status / footer ────────────────────────────────────────── */
.dg-booking__status {
  margin: 14px 0 0;
  min-height: 0;
  font-size: 13px;
  line-height: 1.5;
}
.dg-booking__status--error {
  color: var(--tomato);
  background: color-mix(in oklab, var(--tomato) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--tomato) 30%, transparent);
  padding: 10px 12px;
  border-radius: var(--radius);
}
.dg-booking__status--success {
  color: var(--forest-deep);
  background: color-mix(in oklab, var(--brass) 18%, transparent);
  border: 1px solid var(--brass);
  padding: 14px 16px;
  border-radius: var(--radius);
  text-align: center;
}
.dg-booking__status--success strong {
  display: block;
  font-family: var(--serif);
  font-size: 18px;
  margin-bottom: 4px;
  color: var(--forest);
}

.dg-booking__footer { margin-top: 22px; text-align: center; }
.dg-booking__submit {
  width: 100%;
  padding: 16px 26px;
  font-size: 13px;
}
.dg-booking__submit[disabled] { opacity: .55; cursor: not-allowed; }
.dg-booking__submit[data-state="loading"] {
  position: relative;
  color: transparent;
}
.dg-booking__submit[data-state="loading"]::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--cream);
  border-right-color: transparent;
  border-radius: 50%;
  animation: dg-spin .7s linear infinite;
}
@keyframes dg-spin { to { transform: rotate(360deg); } }

.dg-booking__small {
  margin: 14px 0 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* ── Inline page variant ────────────────────────────────────── */
.dg-reservations-page {
  background: var(--bg-2);
  min-height: 100vh;
}
.dg-reservations-page__hero {
  text-align: center;
  padding: 72px 24px 16px;
}
.dg-reservations-page__hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  letter-spacing: -0.015em;
  color: var(--forest);
  margin: 0 0 12px;
}
.dg-reservations-page__hero h1 em {
  font-style: italic;
  color: var(--brass-2);
}
.dg-reservations-page__hero p {
  font-size: 15px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
}
.dg-reservations-page .dg-booking {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  margin: 24px auto 80px;
  max-width: 600px;
}

/* ── Dark / midnight palette tweaks ─────────────────────────── */
body[data-palette="midnight"] .dg-booking input,
body[data-palette="midnight"] .dg-booking select,
body[data-palette="midnight"] .dg-booking textarea {
  background: var(--bg-2);
  color: var(--ink);
  border-color: var(--line);
}
body[data-palette="midnight"] .dg-booking__slot {
  background: var(--bg-2);
  color: var(--ink);
}
body[data-palette="midnight"] .dg-booking__slot[aria-pressed="true"] {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--bg);
}

/* ── Social-login prefill (Google / Apple) ───────────────── */
.dg-booking__social {
  margin: 0 0 18px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line, #ECE4D2);
}
.dg-booking__social-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted, #8B8576);
  letter-spacing: 0.04em;
}
.dg-booking__social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.dg-booking__social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.dg-booking__social-btn--google {
  background: #fff;
  border: 1px solid var(--line, #D9CDB8);
  color: var(--ink, #2C3E3D);
}
.dg-booking__social-btn--google:hover { border-color: #4A9B97; }
.dg-booking__social-btn--apple,
.dg-booking__social-btn--apple:link,
.dg-booking__social-btn--apple:visited {
  background: #000;
  border: 1px solid #000;
  color: #fff !important;
}
.dg-booking__social-btn--apple svg { fill: #fff !important; }
.dg-booking__social-btn--apple span { color: #fff !important; }
.dg-booking__social-btn--apple:hover {
  background: #1a1a1a;
  color: #fff !important;
}
.dg-booking__social-or {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted, #8B8576);
  letter-spacing: 0.04em;
  position: relative;
}
.dg-booking__social-or::before,
.dg-booking__social-or::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--line, #ECE4D2);
}
.dg-booking__social-or::before { left: 0; }
.dg-booking__social-or::after  { right: 0; }
@media (max-width: 480px) {
  .dg-booking__social-row { grid-template-columns: 1fr; }
}

.dg-booking__signed-in {
  margin: 0 0 14px;
  padding: 8px 12px;
  background: #DEF1E6;
  color: #1F6B47;
  font-size: 13px;
  font-weight: 600;
  border-radius: 3px;
}

/* ── Stripe Elements panel (deposit / card-on-file) ─────── */
.dg-booking__stripe-panel {
  margin-top: 18px;
  padding: 18px 20px;
  background: #FAF4E9;
  border: 1px solid #D9CDB8;
  border-radius: 4px;
}
.dg-booking__stripe-title {
  margin: 0 0 6px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  font-weight: 400;
  color: #4A9B97;
}
.dg-booking__stripe-help {
  margin: 0 0 14px;
  font-size: 13px;
  color: #5C6766;
  line-height: 1.5;
}
.dg-booking__stripe-card {
  background: #fff;
  padding: 12px 14px;
  border: 1px solid #D9CDB8;
  border-radius: 3px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.dg-booking__stripe-card.StripeElement--focus {
  border-color: #4A9B97;
  box-shadow: 0 0 0 3px rgba(74, 155, 151, 0.15);
}
.dg-booking__stripe-card.StripeElement--invalid {
  border-color: #B23A48;
}
.dg-booking__stripe-error {
  min-height: 18px;
  margin-top: 8px;
  font-size: 13px;
  color: #B23A48;
}
.dg-booking__stripe-submit {
  margin-top: 14px;
  width: 100%;
}
