:root {
  color-scheme: light;
  --brand: #e53935;
  --brand-soft: #ffebee;
  --page: #f7f8fa;
  --surface: #ffffff;
  --text: #14171f;
  --muted: #687080;
  --line: #e4e7ec;
  --danger: #b42318;
  --success: #087a55;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--brand-soft) 70%, transparent), transparent 35rem),
    var(--page);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: max(30px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}

.reservation-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--line));
  border-radius: 24px;
  box-shadow: 0 22px 70px rgba(27, 35, 50, 0.11);
}

.brand-header {
  position: relative;
  padding: 36px 38px 30px;
  text-align: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 11%, white), var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 12%, var(--line));
}

.brand-header::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  content: "";
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 45%, var(--brand-soft)));
}

.logo-frame {
  width: 78px;
  height: 78px;
  padding: 8px;
  margin: 0 auto 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(27, 35, 50, 0.09);
}

.logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 13px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(29px, 6vw, 41px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 10px;
  font-size: 23px;
}

.restaurant-name,
.intro,
.state-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.restaurant-name {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 700;
}

#reservation-form,
.state-panel {
  padding: 34px 38px 38px;
}

.intro {
  margin-bottom: 26px;
}

.field-grid {
  display: grid;
  gap: 16px;
}

.field-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid-three {
  grid-template-columns: 1.2fr 1fr 0.8fr;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field > span {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 750;
}

.field strong {
  color: var(--brand);
}

.field small {
  color: var(--muted);
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  color: var(--text);
  background: white;
  border: 1px solid #cdd2da;
  border-radius: 12px;
  outline: none;
  transition: border-color 130ms ease, box-shadow 130ms ease;
}

input {
  height: 50px;
  padding: 0 13px;
}

textarea {
  min-height: 104px;
  padding: 13px;
  line-height: 1.45;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 15%, transparent);
}

input:user-invalid,
textarea:user-invalid {
  border-color: var(--danger);
}

.legal-confirmations {
  padding: 16px;
  margin: 2px 0 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.legal-confirmations legend {
  padding: 0 6px;
  font-size: 14px;
  font-weight: 800;
}

.legal-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.legal-row + .legal-row {
  margin-top: 14px;
}

.legal-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.legal-row input[type="checkbox"]:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent);
  outline-offset: 2px;
}

.legal-link {
  padding: 0;
  color: var(--brand);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-link:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 25%, transparent);
  outline-offset: 3px;
}

.legal-dialog {
  width: min(680px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  color: var(--text);
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(20, 23, 31, 0.25);
}

.legal-dialog::backdrop {
  background: rgba(20, 23, 31, 0.55);
  backdrop-filter: blur(3px);
}

.legal-dialog-header,
.legal-dialog-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
}

.legal-dialog-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.legal-dialog-header h2 {
  margin: 0;
}

.dialog-close {
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.legal-dialog-content {
  max-height: calc(100vh - 220px);
  padding: 24px;
  overflow: auto;
  color: #343945;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.legal-dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.button {
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 120ms ease, filter 120ms ease;
}

.button:hover:not(:disabled) {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent);
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button-primary {
  width: 100%;
  color: white;
  background: var(--brand);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 28%, transparent);
}

.button-secondary {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, white);
}

.privacy-note {
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.form-error {
  padding: 12px 14px;
  margin: 0 0 16px;
  color: var(--danger);
  background: #fff2f0;
  border: 1px solid #f7c6c2;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.45;
}

.state-panel {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.state-panel[hidden],
#reservation-form[hidden],
.button-loading[hidden] {
  display: none;
}

.state-panel p {
  max-width: 480px;
}

.state-icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  font-size: 27px;
  font-weight: 900;
}

.state-error .state-icon {
  color: var(--danger);
  background: #fff2f0;
}

.state-success .state-icon {
  color: var(--success);
  background: #eafaf4;
}

.spinner {
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

footer {
  padding-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 20px, 760px);
    padding-top: 10px;
  }

  .reservation-card {
    border-radius: 18px;
  }

  .brand-header,
  #reservation-form,
  .state-panel {
    padding-right: 20px;
    padding-left: 20px;
  }

  .brand-header {
    padding-top: 30px;
    padding-bottom: 25px;
  }

  #reservation-form,
  .state-panel {
    padding-top: 26px;
    padding-bottom: 28px;
  }

  .field-grid-two,
  .field-grid-three {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .legal-row {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .legal-link {
    grid-column: 2;
    justify-self: start;
  }

  .legal-dialog-header,
  .legal-dialog-content,
  .legal-dialog-footer {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Navigation remains visible above every reservation form state. */
.reservation-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.reservation-navigation a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  max-width: 100%;
  text-decoration: none;
  color: var(--text);
  background: var(--surface, white);
  border: 1px solid var(--brand);
}

@media (max-width: 400px) {
  .reservation-navigation a {
    width: 100%;
  }
}

.reservation-select {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font: inherit;
}

/* Use the restaurant dashboard's webshop policy for the shared reservation form. */
:root[data-appearance="dark"] {
  color-scheme: dark;
  --surface: #1D222B;
  --text: #F3F4F6;
  --muted: #B6BFCC;
  --line: #424C5B;
  --danger: #FDA29B;
  --success: #6CE9A6;
}
:root[data-appearance="dark"] body,
:root[data-appearance="dark"] .brand-header,
:root[data-appearance="dark"] .legal-dialog {
  background: #111318;
}
:root[data-appearance="dark"] .reservation-card {
  background: #111318;
  border-color: var(--line);
}
:root[data-appearance="dark"] input,
:root[data-appearance="dark"] textarea,
:root[data-appearance="dark"] select,
:root[data-appearance="dark"] .logo-frame,
:root[data-appearance="dark"] .button-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line);
}
:root[data-appearance="dark"] input::placeholder,
:root[data-appearance="dark"] textarea::placeholder {
  color: var(--muted);
}
:root[data-appearance="dark"] .legal-dialog-content {color: var(--text);}
:root[data-appearance="dark"] .button-primary {color: var(--button-text);}
:root[data-appearance="dark"] .form-error,
:root[data-appearance="dark"] .state-error .state-icon,
:root[data-appearance="dark"] .state-success .state-icon {background: var(--surface);}
