/*
 * The candidate's paper.
 *
 * This is the one screen in the course that is read for ninety minutes at
 * arm's length, so it is a document and not a board: light, high contrast, a
 * measured line length, and type at a size that can be read for an hour and a
 * half without strain. The projection style in app.css is for the two screens
 * that are looked at from across a room, which this is not.
 */

:root {
  --ink: #15161a;
  --ink-2: #41444e;
  --faint: #767a85;
  --paper: #fbfaf8;
  --card: #ffffff;
  --line: #e3e0da;
  --line-2: #c9c5bd;
  --blue: #003e97;
  --orange: #fb8122;
  --orange-soft: #fff3e8;
  --green: #1d6b45;
  --red: #a52020;
  --red-soft: #fdf0ef;
  --r: 10px;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --bar: 62px;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar) + 14px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink-2); }
.faint { color: var(--faint); font-size: 15px; }
.wrap { max-width: 820px; margin: 0 auto; padding: 0 22px 140px; }
.stack { display: grid; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---- the bar that stays on screen ---- */
.bar {
  position: sticky; top: 0; z-index: 50; height: var(--bar);
  display: flex; align-items: center; gap: 16px; padding: 0 22px;
  background: rgba(251, 250, 248, 0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.bar .grow { flex: 1; min-width: 0; }
.bar .where { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.bar .who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock {
  font-family: var(--mono); font-size: 27px; font-weight: 500;
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.clock.warn { color: var(--orange); }
.clock.out { color: var(--red); }
.clock .note { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 400; }

/* ---- the jump bar ---- */
.jump { position: sticky; top: var(--bar); z-index: 40; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 22px; display: flex; gap: 8px; align-items: center; overflow-x: auto; }
.jump a { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; white-space: nowrap; }
.jump a:hover { border-color: var(--blue); color: var(--blue); }
.jump .done { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-left: auto; white-space: nowrap; }

/* ---- buttons ---- */
.btn { font: inherit; font-size: 15px; font-weight: 500; padding: 9px 16px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover:not(:disabled) { border-color: var(--ink-2); }
.btn.go { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn.warn { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ---- sections and items ---- */
.section { margin: 44px 0 0; }
.section > header { border-top: 3px solid var(--blue); padding-top: 14px; margin-bottom: 18px; }
.section h2 { font-size: 27px; color: var(--blue); }
.section .meta { font-family: var(--mono); font-size: 13px; color: var(--faint); margin-top: 4px; }
.rules { margin: 14px 0 0; padding-left: 22px; }
.rules li { margin: 6px 0; color: var(--ink-2); }

.preamble { background: #f2f5fb; border: 1px solid #d5ddee; border-left: 4px solid var(--blue); border-radius: var(--r); padding: 18px 20px; margin: 18px 0 0; }
.preamble p + p { margin-top: 12px; }

.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin: 18px 0 0; scroll-margin-top: calc(var(--bar) + 54px); }
.item > header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.item .no { font-family: var(--mono); font-weight: 600; font-size: 16px; color: var(--blue); }
.item .marks { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-left: auto; white-space: nowrap; }
.item .lead { color: var(--ink-2); margin-bottom: 12px; }
.item .stem { font-weight: 500; }
.item .answer { margin-top: 16px; }

/* ---- the choices ---- */
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; text-align: left; font: inherit; width: 100%; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); color: var(--ink); cursor: pointer; }
.opt:hover:not(:disabled) { background: #f7f6f3; }
.opt.picked { border-color: var(--orange); background: var(--orange-soft); border-width: 2px; padding: 11px 13px; }
.opt:disabled { cursor: default; opacity: 0.7; }
.opt .letter { font-family: var(--mono); font-weight: 600; color: var(--blue); flex: 0 0 auto; }
.opt.picked .letter { color: var(--orange); }

/* ---- the matching item ---- */
.pairs { display: grid; gap: 10px; }
.pair { display: grid; grid-template-columns: 1fr 150px; gap: 14px; align-items: center; }
.pair span { font-weight: 500; }
.defs { margin: 0 0 16px; padding: 14px 16px; background: #f7f6f3; border: 1px solid var(--line); border-radius: var(--r); display: grid; gap: 8px; }
.defs div { display: flex; gap: 10px; }
.defs b { font-family: var(--mono); color: var(--blue); flex: 0 0 auto; }

/* ---- numbers and grids ---- */
input, textarea, select { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; outline: none; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 62, 151, 0.12); }
input:disabled, textarea:disabled, select:disabled { background: #f4f3f1; color: var(--ink-2); }
textarea { resize: vertical; line-height: 1.6; min-height: 112px; }
.one-number { display: flex; gap: 10px; align-items: center; }
.one-number input { width: 150px; text-align: center; font-family: var(--mono); font-size: 19px; }
.one-number .unit { font-family: var(--mono); color: var(--ink-2); }

.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: middle; }
.grid th { background: #f7f6f3; font-size: 14px; font-weight: 600; color: var(--blue); }
.grid th.num, .grid td.num { width: 128px; text-align: center; }
.grid td input { width: 100%; text-align: center; font-family: var(--mono); padding: 8px 6px; }

/* ---- the saved word ---- *
 * Grey, and it says only that the answer was written down. A green tick here
 * would read as a mark, and this paper awards none on screen. */
.kept { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); opacity: 0; transition: opacity 0.4s ease; }
.kept.on { opacity: 1; }
.foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; min-height: 18px; }
.count { font-family: var(--mono); font-size: 12px; color: var(--faint); margin-left: auto; }
.count.over { color: var(--orange); }

/* ---- notices ---- */
.notice { border-radius: var(--r); padding: 16px 18px; margin: 18px 0; border: 1px solid var(--line-2); background: var(--card); }
.notice.hot { border-color: #e8bda0; background: var(--orange-soft); }
.notice.stop { border-color: #e6b8b4; background: var(--red-soft); }
.notice h3 { margin-bottom: 6px; }

/* ---- the sign-in and the hand-in ---- */
.gate { max-width: 560px; margin: 8vh auto; padding: 0 22px; }
.gate h1 { font-size: 34px; margin-bottom: 8px; }
.gate .kicker { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--orange); margin-bottom: 14px; }
.gate label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.gate .field { margin-bottom: 16px; }
.gate ul { padding-left: 22px; color: var(--ink-2); }
.gate li { margin: 7px 0; }
.err { color: var(--red); font-size: 15px; min-height: 22px; }

.sheet-link { display: flex; gap: 14px; align-items: center; background: #f2f5fb; border: 1px solid #d5ddee; border-radius: var(--r); padding: 14px 18px; }

@media (max-width: 620px) {
  body { font-size: 16px; }
  .pair { grid-template-columns: 1fr; gap: 6px; }
  .clock { font-size: 22px; }
  .bar .who { display: none; }
}

/* A panel set to hidden must actually go. Several of the classes above set a
   display, which beats the user agent's rule for the hidden attribute, so a
   closed panel stayed on screen. */
[hidden] { display: none !important; }
