/* Shared by every page: colour tokens (light + dark), type, header, footer, buttons, form fields. */
:root {
  --bg: #EDF1F4;
  --surface: #FFFFFF;
  --ink: #17232E;
  --muted: #566573;
  --line: #D4DCE3;
  --dawn: #A9590F;       /* open spots and the main action: early-morning amber */
  --dawn-ink: #FFFFFF;
  --dawn-soft: #FAEAD7;
  --held: #2C6A51;       /* spots someone has taken */
  --held-soft: #DFEEE6;
  --shade: rgba(16, 26, 36, 0.45);
  --err: #B3261E;
  --display: "Zilla Slab", Georgia, "Times New Roman", serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E151C; --surface: #16202A; --ink: #E5ECF2; --muted: #9DABB8; --line: #283440;
    --dawn: #E89C4A; --dawn-ink: #1B1207; --dawn-soft: #3A2916;
    --held: #6FC49C; --held-soft: #173027; --shade: rgba(0, 0, 0, 0.6); --err: #FF8A80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E151C; --surface: #16202A; --ink: #E5ECF2; --muted: #9DABB8; --line: #283440;
  --dawn: #E89C4A; --dawn-ink: #1B1207; --dawn-soft: #3A2916;
  --held: #6FC49C; --held-soft: #173027; --shade: rgba(0, 0, 0, 0.6); --err: #FF8A80;
  color-scheme: dark;
}

/* An author display rule beats the browser's [hidden] rule, so restate it. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.45; }
.wrap { max-width: 600px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 56px; display: flex; flex-direction: column; gap: 28px; }

header { display: flex; flex-direction: column; gap: 8px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0; }
h1 { font-family: var(--display); font-weight: 700; font-size: 2.1rem; line-height: 1.1; margin: 0; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 700; font-size: 1.45rem; margin: 0; }
.lede { margin: 0; color: var(--muted); max-width: 34em; }
.lede b { color: var(--ink); font-weight: 600; }

footer { font-size: 15px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
footer b { color: var(--ink); font-variant-numeric: tabular-nums; }
footer a { color: inherit; }

.primary { flex: 1 1 200px; font: inherit; font-weight: 700; font-size: 17px; border: 0; border-radius: 12px; padding: 13px 16px; background: var(--dawn); color: var(--dawn-ink); cursor: pointer; }
.primary:disabled { opacity: 0.65; cursor: progress; }
a.primary { text-align: center; text-decoration: none; }
.quiet { flex: 0 1 auto; font: inherit; font-weight: 600; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 16px; background: transparent; color: var(--ink); cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; }
.field .hint { font-size: 14px; color: var(--muted); margin: 0; }
.field input { font: inherit; font-size: 20px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums; width: 100%; }
.error { color: var(--err); font-size: 14px; font-weight: 600; margin: 0; }
.field input.code-input { font-size: 28px; letter-spacing: 0.3em; font-family: var(--display); font-weight: 600; text-align: center; }
.linkish { font: inherit; font-size: 15px; font-weight: 600; background: none; border: 0; color: var(--dawn); cursor: pointer; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; }
.linkish:disabled { opacity: 0.6; cursor: progress; }
/* Top line of every page: church name on the left, staff-only "Admin view" switch on the right. */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 4px 0; cursor: pointer; }
.switch-track { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--line); transition: background 150ms ease; flex: none; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 150ms ease; }
.switch[aria-checked="true"] { color: var(--ink); }
.switch[aria-checked="true"] .switch-track { background: var(--dawn); }
.switch[aria-checked="true"] .switch-thumb { transform: translateX(16px); }
.me { margin: 0; font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.me b { color: var(--ink); }

button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, label:focus-within { outline: 3px solid var(--dawn); outline-offset: 2px; }
