/* Shared tokens and primitives for the booking page and admin.
   Palette and type follow redesign.html so bookings feel like the site. */
:root {
  --page: #ffffff;
  --surface: #ffffff;
  --sunken: #f4f7f5;
  --card: #eef5f2;
  --ink: #0f1f1b;
  --ink-soft: #3d4d48;
  --ink-faint: #5f6f6a;
  --accent-ink: #0f3d35;
  --green: #0f3d35;
  --green-deep: #0a2c26;
  --green-tint: #e2efe9;
  --gold: #f4b63f;
  --gold-hover: #f8c869;
  --gold-tint: #fdf1d8;
  --on-gold: #0f1f1b;
  --on-green: #ffffff;
  --danger: #a4271f;
  --danger-tint: #fbeae8;
  --ok: #1d6b45;
  --rule: rgba(15, 31, 27, 0.12);
  --rule-strong: rgba(15, 31, 27, 0.24);
  --field-border: rgba(15, 31, 27, 0.55); /* edges of text boxes and menus: 3:1 or more on every background (WCAG 1.4.11) */
  --focus: #0f3d35;
  --shadow: 0 24px 60px -28px rgba(10, 44, 38, 0.35);
  --radius: 16px;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Instrument Sans", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b1a17;
    --surface: #132823;
    --sunken: #0f211d;
    --card: #17302a;
    --ink: #eef3f0;
    --ink-soft: #b7c6c0;
    --ink-faint: #93a59f;
    --accent-ink: #f4b63f;
    --green-tint: #1c3a33;
    --gold-tint: #3a3018;
    --danger: #ff9a8f;
    --danger-tint: #3b1d1a;
    --ok: #7fd3a6;
    --rule: rgba(238, 243, 240, 0.14);
    --rule-strong: rgba(238, 243, 240, 0.28);
    --field-border: rgba(238, 243, 240, 0.45);
    --focus: #f4b63f;
    --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--gold); color: var(--on-gold); }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: 2.75rem; padding: 0.6rem 1.15rem;
  border: 1px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; line-height: 1.2;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover:not(:disabled) { background: var(--gold-hover); }
.btn-green { background: var(--green); color: var(--on-green); }
.btn-green:hover:not(:disabled) { background: var(--green-deep); }
.btn-line { background: transparent; border-color: var(--rule-strong); color: var(--ink); }
.btn-line:hover:not(:disabled) { border-color: var(--ink); }
.btn-quiet { background: transparent; color: var(--ink-soft); padding-inline: 0.6rem; }
.btn-quiet:hover:not(:disabled) { color: var(--ink); background: var(--sunken); }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-tint); }
.btn-sm { min-height: 2.25rem; padding: 0.35rem 0.85rem; font-size: 0.875rem; }

.icon-btn {
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--ink);
}
.icon-btn:hover:not(:disabled) { background: var(--sunken); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 0.35rem; }
.field > label, .field > .label, fieldset > legend {
  font-weight: 600; font-size: 0.925rem; color: var(--ink);
}
.field .hint { font-size: 0.85rem; color: var(--ink-faint); }
.req { color: var(--ink-faint); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 2.75rem; padding: 0.6rem 0.8rem;
  background: var(--surface); border: 1px solid var(--field-border); border-radius: 10px;
}
.textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-faint); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline-offset: 0; border-color: var(--focus); }
.field.invalid .input, .field.invalid .select, .field.invalid .textarea { border-color: var(--danger); }
.error-text { color: var(--danger); font-size: 0.875rem; font-weight: 500; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.choice { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.55rem 0.75rem; border: 1px solid var(--rule); border-radius: 10px; cursor: pointer; }
.choice:hover { border-color: var(--rule-strong); }
.choice:has(input:checked) { border-color: var(--green); background: var(--green-tint); }
@media (prefers-color-scheme: dark) { .choice:has(input:checked) { border-color: var(--gold); } }
.choice input { margin: 0.2rem 0 0; accent-color: var(--green); width: 1.05rem; height: 1.05rem; flex: none; }

.alert {
  padding: 0.8rem 1rem; border-radius: 12px; font-size: 0.95rem;
  background: var(--danger-tint); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}
.alert-info { background: var(--gold-tint); color: var(--ink); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }

.fan { width: 34px; height: 20px; flex: none; }
.fan .fan-fill { fill: var(--green); }
.fan .fan-cut { stroke: var(--page); }
@media (prefers-color-scheme: dark) { .fan .fan-fill { fill: #cfe0d8; } }

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