:root {
  color-scheme: light dark;
  --bg: #f4f3f8;
  --card: #ffffff;
  --fg: #17162a;
  --muted: #5d5b70;
  --line: #e4e2ee;
  --accent: #4c3fd8;
  --accent-fg: #ffffff;
  --secondary: #ebe9f5;
  --warn: #8a4b00;
  --switch-off: #d9d7e4;
  --shadow: 0 1px 2px rgb(23 22 42 / 0.06), 0 6px 20px rgb(23 22 42 / 0.06);
  /* identity colours: text-safe tone and a tint */
  --text-size: 17px;
  --tap: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121118;
    --card: #1d1c26;
    --fg: #eeedf5;
    --muted: #a9a7bb;
    --line: #33313f;
    --accent: #a8a2ff;
    --accent-fg: #16123a;
    --secondary: #2a2836;
    --warn: #f0b36a;
    --switch-off: #3d3b4b;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: var(--text-size)/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}

.page { max-width: 560px; margin: 0 auto; padding: 24px 0 48px; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
small, .status { color: var(--muted); }
.warn { color: var(--warn); }

a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}
.centre { text-align: center; margin-top: 12vh; }
.notice { border-color: var(--accent); }

/* Tap targets: 48px everywhere, 56px for the main buttons (requirements 9.3 item 2). */
button, input, summary, .back { min-height: 48px; font: inherit; }

.big {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--tap);
  margin: 12px 0 0;
  padding: 12px 20px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: var(--accent-fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.big.secondary, .small.secondary { background: var(--secondary); color: var(--fg); }
.big:disabled { opacity: 0.5; }

.small { min-width: 48px; padding: 8px 14px; border: 0; border-radius: 12px; }

.back { display: inline-flex; align-items: center; color: var(--accent); text-decoration: none; }

summary { display: flex; align-items: center; cursor: pointer; font-weight: 600; }

label { display: block; margin: 12px 0 6px; }
input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--fg);
}

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}


/* ---- Sign-in additions ---- */
[hidden] { display: none !important; }
ol.codes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.1rem; }
.who { color: var(--muted); margin: 0 0 4px; }
@media print { .big, details { display: none; } }

/* ---- Admin page ---- */
fieldset.apps { border: 0; margin: 12px 0 0; padding: 0; }
fieldset.apps legend { padding: 0; margin: 0 0 4px; }
label.check { display: flex; align-items: center; gap: 12px; margin: 0; min-height: 48px; }
label.check input { width: 24px; height: 24px; min-height: 0; margin: 0; accent-color: var(--accent); }
.person details { margin-top: 12px; }
.tag { font-size: 0.8rem; font-weight: 600; color: var(--accent); vertical-align: middle; }
.big.danger { background: var(--warn); color: var(--card); }
p.card { margin-top: 0; }
