/* Vantage Testing base styles. Mobile-first, system fonts, no external assets. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --border: #d5dae1;
  --accent: #0b5cad;
  --accent-text: #ffffff;
  --danger: #b42318;
  --danger-text: #ffffff;
  --ok: #067647;
  --warn: #b54708;
  --radius: 10px;
  --space: 1rem;
  font-size: 100%;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --surface: #1c1f25;
    --text: #e8eaed;
    --muted: #a3abb6;
    --border: #343a44;
    --accent: #6aa9f0;
    --accent-text: #0b0d10;
    --danger: #ff8a80;
    --danger-text: #0b0d10;
    --ok: #6ce9a6;
    --warn: #fdb022;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

.container { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 var(--space); }

main { flex: 1; padding-top: calc(var(--space) * 1.5); padding-bottom: calc(var(--space) * 2); }
main:focus { outline: none; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; min-height: 3.25rem; }
.brand { font-weight: 700; letter-spacing: 0.01em; }

.site-footer { color: var(--muted); font-size: 0.875rem; padding: var(--space) 0; border-top: 1px solid var(--border); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: calc(var(--space) * 1.25);
}

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 0.75rem; }

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

.muted { color: var(--muted); font-size: 0.9rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--accent); color: var(--accent-text); padding: 0.5rem 0.75rem;
}
.skip-link:focus { left: var(--space); top: var(--space); z-index: 10; }

@media (min-width: 40rem) {
  h1 { font-size: 1.875rem; }
  .card { padding: calc(var(--space) * 2); }
}

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

/* --- Epic 1: forms, buttons, alerts, admin layout, tables ------------------ */
.container-wide { max-width: 72rem; }
.narrow { max-width: 28rem; margin: 0 auto; }
.site-header .container { flex-wrap: wrap; gap: 0.5rem 1rem; }
.header-signout { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 14rem; }
.admin-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding: 0; }
.admin-nav a { text-decoration: none; padding: 0.25rem 0; }
.admin-nav a[aria-current="page"] { font-weight: 700; border-bottom: 2px solid var(--accent); }

.stack { display: flex; flex-direction: column; gap: 0.5rem; }
.stack label { font-weight: 600; margin-top: 0.5rem; }
input[type="email"], input[type="password"], input[type="text"], input[type="file"], select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 0.7rem 0.75rem; width: 100%;
  min-height: 2.75rem;
}
.button, button.button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-align: center;
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px;
  padding: 0.7rem 1.1rem; min-height: 2.75rem; text-decoration: none; margin-top: 0.75rem;
}
.button-secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.button-block { width: 100%; }
.button-link { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0.25rem 0.5rem; min-height: 2.75rem; min-width: 2.75rem; text-decoration: underline; }
.inline-form { display: inline; }

.alert { border-radius: 8px; padding: 0.75rem 1rem; margin: 0.75rem 0; border: 1px solid var(--border); }
.alert-error { border-color: var(--danger); color: var(--danger); font-weight: 600; }
.alert-warn { border-color: var(--warn); }
.alert-ok { border-color: var(--ok); }
.lead { font-size: 1.125rem; }
.link-list { padding-left: 1.25rem; }

.table-wrap { overflow-x: auto; margin: 0.5rem 0 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.925rem; }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: 0.8rem; padding: 0.05rem 0.5rem; border-radius: 999px; border: 1px solid var(--border); }
.badge-active { border-color: var(--ok); color: var(--ok); }
.badge-danger { border-color: var(--danger); color: var(--danger); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.75rem; margin: 0.75rem 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; }
.stat strong { display: block; font-size: 1.5rem; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.25rem; padding: 0.25rem 0.5rem; border: 1px dashed var(--border); border-radius: 6px; }
details summary { cursor: pointer; font-weight: 600; margin: 0.5rem 0; }

/* Text for screen readers only (column headers of action columns, live announcements). */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Student results: on a phone each criterion becomes a block (name and points on one
   line, feedback below) instead of three squeezed columns. */
@media (max-width: 40rem) {
  .result-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .result-table, .result-table tbody { display: block; }
  .result-table tr {
    display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.75rem;
    padding: 0.75rem 0; border-bottom: 1px solid var(--border);
  }
  .result-table td { display: block; padding: 0; border: 0; }
  .result-table .result-criterion { font-weight: 600; }
  .result-table .result-points { white-space: nowrap; font-weight: 600; }
  .result-table .result-feedback { grid-column: 1 / -1; }
}
