/* Exercise-SCAD — minimal, clean, hand-written theme. No frameworks. */
:root {
  --ink: #1a2332;
  --muted: #5a6472;
  --brand: #1f4e79;
  --brand-dark: #163a5a;
  --accent: #137333;
  --line: #e3e7ec;
  --bg: #f7f9fb;
  --maxw: 52rem;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  flex-wrap: wrap;
}
.site-title { font-size: 1.15rem; font-weight: 700; color: var(--brand); text-decoration: none; }
.site-title span { color: var(--muted); font-weight: 400; }

/* Logo strip */
.logos {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.logos img { height: 56px; width: auto; display: block; }

/* Main */
main { padding: 2.5rem 0 3rem; }
.hero h1 { font-size: 1.9rem; line-height: 1.25; margin: 0 0 .75rem; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 0 0 1.5rem; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
  margin: 1.25rem 0;
}
h2 { font-size: 1.25rem; margin: 1.5rem 0 .5rem; }
a { color: var(--brand); }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border: 0;
  border-radius: 8px;
  padding: .8rem 1.4rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.btn[disabled] { background: #9aa7b4; cursor: not-allowed; }

.notice {
  background: #fff8e6;
  border: 1px solid #f0d98a;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin: 1.25rem 0;
  font-size: .95rem;
}
.ok { color: var(--accent); font-weight: 600; }

.consent-row { display: flex; gap: .6rem; align-items: flex-start; margin: 1.25rem 0; }
.consent-row input { margin-top: .35rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: .9rem;
}
.site-footer .wrap {
  padding: 1.5rem 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-footer a { color: var(--muted); margin-left: 1rem; }

/* ---- Forms, staff console and enrolment (added with the staff-driven flow) ---- */

.stack { display: flex; flex-direction: column; gap: .35rem; }
.stack label { font-weight: 600; margin-top: .75rem; }
.stack input[type="text"],
.stack input[type="password"],
.stack input[type="date"],
.stack textarea {
  padding: .55rem .7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  max-width: 26rem;
}
.stack input:focus, .stack textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.stack textarea { max-width: 34rem; resize: vertical; }
.stack .btn { margin-top: 1.1rem; align-self: flex-start; }

.hint { color: var(--muted); font-size: .875rem; margin: .1rem 0 .35rem; }
.req  { color: var(--brand); font-weight: 500; font-size: .8rem; }
.opt  { color: var(--muted); font-weight: 400; font-size: .8rem; }

.error {
  background: #fdeaea;
  border-left: 4px solid #c5221f;
  color: #8c1d1a;
  padding: .7rem .9rem;
  border-radius: 4px;
}

.actions { display: flex; gap: .75rem; align-items: center; margin-top: 1.1rem; flex-wrap: wrap; }

.btn-secondary {
  display: inline-block;
  padding: .55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary:hover { border-color: var(--brand); }

.staff-only { border-left: 4px solid var(--line); background: #fbfcfd; }

/* Funder acknowledgement. The logo sits at its natural width up to a cap, so a
   wordmark is legible rather than shrunk to the header logos' fixed height. */
.funder img {
  max-width: 200px;
  max-height: 80px;
  width: auto;
  height: auto;
  display: block;
  margin: .25rem 0 1rem;
}
.funder p { margin: 0; }

/* ---- Status table (staff console) ---- */

.console-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.console-head h1 { margin-bottom: 0; }

.table-wrap { overflow-x: auto; }

.status-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .9375rem;
}
.status-table th, .status-table td {
  text-align: left;
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.status-table thead th {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  background: #fbfcfd;
}
.status-table tbody tr:last-child td { border-bottom: none; }
.status-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.status-table .ref { font-weight: 600; }
.status-table .window { color: var(--muted); font-variant-numeric: tabular-nums; }
.status-table .row-attention { background: #fffaf0; }

.state {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 999px;
  font-size: .8125rem;
  border: 1px solid transparent;
}
.state-collected     { background: #e6f4ea; color: #137333; }
.state-due           { background: #e8f0fe; color: var(--brand); }
.state-waiting       { background: #f1f3f4; color: var(--muted); }
.state-not-connected { background: #fce8e6; color: #c5221f; }
.state-no-data       { background: #fef7e0; color: #9a6400; }
.state-withdrawn,
.state-stopped       { background: #f1f3f4; color: var(--muted); text-decoration: line-through; }
.state-grant-broken  { background: #fce8e6; color: #c5221f; }
