/* ExamReady SA, "Compass" design system. Tokens match design/tokens.json. */
:root {
  --ink: #10233A; --green: #0F7B5F; --green-dark: #0A5A45; --green-light: #5BA88E;
  --amber: #E8A33D; --coral: #C8452F; --blue: #2F5D8A; --slate: #4A5866;
  --mist: #E6EAE5; --line: #E1E5E0; --paper: #F7F6F1; --white: #FFFFFF;
  --accent: var(--green);
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --r-control: 6px; --r-card: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--body); }
a { color: var(--blue); } a:hover { color: #1F4268; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--display); line-height: 1.12; margin: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.8px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 600; font-family: var(--body); }
p { margin: 0; }
.skip { position: absolute; left: -9999px; } .skip:focus { left: 16px; top: 16px; background: var(--white); padding: 8px 12px; z-index: 10; }
.sr { position: absolute; left: -9999px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Shell */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px clamp(16px, 4vw, 40px); background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 19px var(--display); }
.brand .sa { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--r-control); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav a[aria-current="page"] { background: var(--mist); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--slate); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 64px; display: flex; flex-direction: column; gap: 24px; }
.banner { padding: 10px clamp(16px, 4vw, 40px); font-size: 14px; }
.banner.demo { background: #FBEBCF; color: #4A3205; }
.banner.as { background: var(--ink); color: var(--paper); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.as button { min-height: 36px; }
.foot { padding: 24px clamp(16px, 4vw, 40px); color: var(--slate); font-size: 13px; border-top: 1px solid var(--line); }

/* Building blocks */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card.dark .muted { color: #C9D2DB; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--slate); }
.small { font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--slate); }
.big { font: 700 44px/1 var(--display); letter-spacing: -1.2px; }
.mono { font-family: var(--mono); font-size: 13px; }
.kpi .big { font-size: 38px; }
.kpi.warn { border-top: 4px solid var(--amber); }
.kpi.risk { border-top: 4px solid var(--coral); }

.btn { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 20px; border-radius: var(--r-control); border: 1.5px solid transparent; font: 600 15px var(--body); text-decoration: none; cursor: pointer; background: var(--accent); color: var(--white); }
.btn:hover { color: var(--white); filter: brightness(0.95); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { color: var(--ink); background: var(--mist); }
.btn.link { background: transparent; color: var(--blue); padding: 0 8px; text-decoration: underline; }
.btn.danger { background: var(--coral); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.light { background: var(--paper); color: var(--ink); }

.pill { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.met, .pill.good, .pill.approved, .pill.clear { background: #DDF0E8; color: #0A5A45; }
.pill.open, .pill.warn, .pill.in_review, .pill.pending, .pill.supervision { background: #FBEBCF; color: #6B4508; }
.pill.overdue, .pill.risk, .pill.rejected, .pill.flagged, .pill.retired { background: #F8DDD7; color: #8A2715; }
.pill.verified, .pill.info { background: #DCE6F1; color: #1F4268; }
.pill.none, .pill.draft, .pill.unverified { background: var(--mist); color: #34414D; }
.cite { display: inline-block; padding: 4px 9px; border-radius: var(--r-control); background: #EEF3F8; font: 500 12px var(--mono); color: var(--blue); text-decoration: none; }
.cite.proposed { background: #FBEBCF; color: #6B4508; }

.bar { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.bar > span.warn { background: var(--amber); } .bar > span.risk { background: var(--coral); }

label { font-weight: 600; font-size: 15px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=search], select, textarea {
  min-height: 48px; padding: 0 12px; border: 1.5px solid #9AA5AF; border-radius: var(--r-control); font: 400 16px var(--body); color: var(--ink); background: var(--white); width: 100%;
}
textarea { padding: 12px; min-height: 96px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.form { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: end; }

.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; color: var(--slate); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid #EEF0EC; vertical-align: top; }
.scroll { overflow-x: auto; }
.messages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.messages li { padding: 12px 16px; border-radius: 10px; background: #DCE6F1; color: #1F4268; }
.messages li.error { background: #F8DDD7; color: #8A2715; }
.messages li.success { background: #DDF0E8; color: #0A5A45; }

/* Heat map */
.heat { display: grid; gap: 6px; font-size: 13px; min-width: 460px; }
.heat .cell { padding: 10px 6px; border-radius: var(--r-control); text-align: center; font-weight: 600; }
.cell.good { background: var(--green); color: var(--white); }
.cell.ok { background: var(--green-light); color: var(--ink); }
.cell.warn { background: var(--amber); color: var(--ink); }
.cell.risk { background: var(--coral); color: var(--white); }
.cell.none { background: var(--mist); color: var(--slate); font-weight: 400; }

/* Exam */
.exam-top { background: var(--ink); color: var(--paper); padding: 14px clamp(16px, 4vw, 40px); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer { font: 500 18px var(--mono); padding: 8px 16px; border-radius: 999px; background: #24384F; }
.timer.low { background: var(--coral); color: var(--white); }
.exam { display: flex; flex-wrap: wrap; gap: 24px; }
.exam main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.exam aside { flex: 1 1 260px; }
.option { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid #D8DCD6; border-radius: 10px; background: var(--white); cursor: pointer; font-weight: 400; font-size: 17px; }
.option:has(input:checked) { border: 2px solid var(--accent); background: #F1F8F5; }
.option input { margin-top: 5px; width: 18px; height: 18px; }
.qmap { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.qmap button { min-height: 44px; border-radius: var(--r-control); border: 1.5px solid #9AA5AF; background: var(--white); font: 600 14px var(--body); color: var(--ink); cursor: pointer; }
.qmap button.answered { background: var(--ink); color: var(--white); border-color: var(--ink); }
.qmap button.flagged { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.qmap button.current { outline: 3px solid var(--accent); outline-offset: 2px; }
.stem { font-size: 20px; line-height: 1.55; font-weight: 500; }

/* Coach */
.thread { display: flex; flex-direction: column; gap: 12px; }
.bubble { max-width: min(680px, 92%); padding: 12px 16px; border-radius: 14px; line-height: 1.55; white-space: pre-line; }
.bubble.learner { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 4px; }
.bubble.coach { background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.refusal { background: #FBEBCF; border-color: #F3D9A7; }
.seg { display: inline-flex; background: var(--mist); border-radius: 999px; padding: 3px; }
.seg label { min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px; cursor: pointer; font-size: 14px; }
.seg input { position: absolute; opacity: 0; }
.seg label:has(input:checked) { background: var(--ink); color: var(--white); }

/* Public site */
.hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding: clamp(40px, 7vw, 96px) clamp(16px, 5vw, 80px); }
.hero h1 { font-size: clamp(40px, 6vw, 74px); line-height: 1; letter-spacing: -2px; }
.hero .lead { font-size: 20px; color: #34414D; max-width: 640px; }
.section { padding: 64px clamp(16px, 5vw, 80px); display: flex; flex-direction: column; gap: 28px; }
.section.white { background: var(--white); }
.section.dark { background: var(--ink); color: var(--paper); }
.section.dark .muted { color: #C9D2DB; }
.section h2 { font-size: clamp(30px, 4vw, 40px); letter-spacing: -1px; }
.step-no { font: 500 15px var(--mono); color: var(--green); }
.illus { border-radius: 18px; background: var(--mist); width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.gauge text { font-family: var(--display); font-weight: 700; }

@media (max-width: 640px) {
  .big { font-size: 36px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .top { padding: 8px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
