/* comfac-exam — one stylesheet, system fonts, no external requests. */

:root {
  --ink: #14181f;
  --muted: #5b6472;
  --line: #d9dee6;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --accent: #1f4e79;
  --accent-soft: #eaf1f8;
  --ok: #1b6b3a;
  --ok-soft: #e8f5ec;
  --bad: #a12a2a;
  --bad-soft: #fbeaea;
  --warn: #8a5a00;
  --warn-soft: #fdf3e2;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 24px 20px 64px; }
.wrap-narrow { max-width: 560px; }

header.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

header.topbar .brand { font-weight: 650; letter-spacing: -0.01em; }
header.topbar .spacer { flex: 1; }
header.topbar .who { color: var(--muted); font-size: 14px; }

h1 { font-size: 26px; line-height: 1.25; margin: 8px 0 4px; letter-spacing: -0.015em; }
h2 { font-size: 19px; margin: 28px 0 10px; letter-spacing: -0.01em; }
h3 { font-size: 16px; margin: 18px 0 6px; }
p { margin: 8px 0; }
.lede { color: var(--muted); margin-top: 0; }
.small { font-size: 13.5px; }
.muted { color: var(--muted); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin: 16px 0;
}

.card-tight { padding: 14px 16px; }

label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 5px; }
label.check { display: flex; gap: 9px; align-items: flex-start; font-weight: 400; font-size: 14px; }

input[type="text"], input[type="email"], input[type="number"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }

button {
  font: inherit;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button.secondary { background: #fff; color: var(--accent); }
button.ghost { background: transparent; border-color: var(--line); color: var(--muted); font-weight: 500; }
button.danger { background: #fff; color: var(--bad); border-color: #e4bcbc; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.link { background: none; border: none; color: var(--accent); padding: 0; font-weight: 600; text-decoration: underline; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.banner { border-radius: 8px; padding: 12px 14px; margin: 14px 0; font-size: 14.5px; border: 1px solid; }
.banner-info { background: var(--accent-soft); border-color: #c6d9ec; }
.banner-ok { background: var(--ok-soft); border-color: #bfe0cb; color: var(--ok); }
.banner-bad { background: var(--bad-soft); border-color: #eec4c4; color: var(--bad); }
.banner-warn { background: var(--warn-soft); border-color: #eddcb4; color: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tbody tr:hover { background: #fbfcfd; }

.pill { display: inline-block; font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: #eef1f5; color: var(--muted); text-transform: capitalize; }
.pill-approved, .pill-released, .pill-graded { background: var(--ok-soft); color: var(--ok); }
.pill-applied, .pill-submitted, .pill-in_progress { background: var(--warn-soft); color: var(--warn); }
.pill-rejected, .pill-expired, .pill-disabled { background: var(--bad-soft); color: var(--bad); }

.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.timer.low { color: var(--bad); }

.question { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; background: var(--panel); }
.question .qid { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: 0.03em; }
.question .stem { font-size: 16.5px; font-weight: 600; margin: 4px 0 10px; }
.option { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.option:hover { background: #f4f7fa; }
.option input { margin-top: 4px; }
.option .key { font-weight: 700; min-width: 18px; }

.case-head { border-left: 4px solid var(--accent); padding-left: 14px; margin: 26px 0 10px; }
.facts { font-size: 14px; }
.facts td:first-child { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }

.richtext p { margin: 6px 0; font-size: 14.5px; }
.richtext strong { font-weight: 650; }

.verdict { display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline; }
.verdict .big { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; }
.pass { color: var(--ok); }
.fail { color: var(--bad); }

.item-review { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; background: var(--panel); }
.item-review.correct { border-left: 4px solid var(--ok); }
.item-review.incorrect { border-left: 4px solid var(--bad); }
.item-review.pending { border-left: 4px solid var(--warn); }
.answer-line { font-size: 14px; margin: 4px 0; }
.answer-line .tag { font-weight: 700; }
.clause { font-size: 12.5px; color: var(--muted); }

.save-state { font-size: 13px; color: var(--muted); }
.footer-note { margin-top: 40px; font-size: 13px; color: var(--muted); }
.hidden { display: none !important; }
.stack > * + * { margin-top: 12px; }
