/* Brand tokens — swap these for the official AI MOVE / ISCA values. */
:root {
  --brand: #1b2a5c;          /* primary (header, headings) */
  --brand-contrast: #ffffff;
  --accent: #e85d27;         /* buttons, highlights */
  --accent-hover: #c94b18;
  --accent-soft: #fdeee6;
  --bg: #f5f6f9;
  --surface: #ffffff;
  --text: #1d2433;
  --muted: #5d6578;
  --border: #dde1ea;
  --ok: #2e7d5b;
  --warn-bg: #fff6d6;
  --warn-border: #e7c34a;
  --warn-text: #5c4600;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; font-size: 16px; }
h1, h2, h3 { color: var(--brand); line-height: 1.25; }
h1 { font-size: 1.9rem; margin: 0 0 .5rem; }
h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 0 0 .35rem; }
a { color: var(--accent-hover); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.loading { padding: 4rem 0; text-align: center; color: var(--muted); }

/* header / footer */
.site-header { background: var(--brand); color: var(--brand-contrast); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; color: inherit; font-weight: 800; letter-spacing: .04em; font-size: 1.25rem; }
.brand-mark { background: var(--accent); color: #fff; padding: .1rem .45rem; border-radius: 6px; }
.brand img { height: 40px; display: block; }
.header-title { font-size: .95rem; opacity: .85; }
.site-footer { margin-top: 4rem; border-top: 1px solid var(--border); background: var(--surface); font-size: .85rem; }
.footer-inner { padding-top: 1.25rem; padding-bottom: 1.5rem; }
.footer-inner p { margin: .25rem 0; }

main.wrap { padding-top: 2rem; padding-bottom: 2rem; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.25rem; margin-bottom: 1rem; }
.hero { padding: 2rem 1.5rem; }
.lead { font-size: 1.1rem; }
ul.clean { padding-left: 1.2rem; }
ul.clean li { margin: .3rem 0; }

/* buttons */
.btn { appearance: none; border: 2px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; padding: .65rem 1.3rem; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--brand); border-color: var(--border); }
.btn.secondary:hover { border-color: var(--brand); }
.btn:focus-visible, .opt input:focus-visible + span, .seg input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.error { color: #b3261e; font-weight: 600; margin: .5rem 0 0; }

/* progress */
.progress { margin-bottom: 1.5rem; }
.progress-meta { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: .35rem; gap: 1rem; }
.progress-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.progress-bar > div { height: 100%; background: var(--accent); transition: width .25s; }

/* part A options */
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; margin-bottom: .6rem; padding: 0; }
.hint { font-size: .9rem; color: var(--muted); margin: -.35rem 0 .6rem; }
.opts { display: grid; gap: .45rem; }
.opt { display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: block; padding: .6rem .85rem; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); }
.opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.opt input:disabled + span { opacity: .45; }

/* statements */
.scale-legend { display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.statement .sid { font-weight: 700; color: var(--brand); margin-right: .35rem; }
.statement p { margin: 0 0 .75rem; }
.seg { display: grid; grid-template-columns: repeat(5, 1fr) 1.6fr; gap: .4rem; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 52px; padding: .3rem; border: 1.5px solid var(--border); border-radius: 10px; font-weight: 700; background: var(--surface); }
.seg span small { font-weight: 400; font-size: .7rem; color: var(--muted); line-height: 1.15; }
.seg input:checked + span { border-color: var(--accent); background: var(--accent); color: #fff; }
.seg input:checked + span small { color: #fff; }
.statement.missing { border-color: #b3261e; }
@media (max-width: 560px) {
  .seg { grid-template-columns: repeat(5, 1fr); }
  .seg label:last-child { grid-column: 1 / -1; }
  .seg span small { display: none; }
  .seg label:last-child span small { display: inline; }
  h1 { font-size: 1.55rem; }
}

/* results */
.alerts { background: var(--warn-bg); border: 1.5px solid var(--warn-border); color: var(--warn-text); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.alerts h2 { margin-top: 0; color: var(--warn-text); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; vertical-align: top; padding: .6rem .5rem; border-top: 1px solid rgba(0,0,0,.08); }
th { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 560px) {
  .alerts table, .alerts tbody, .alerts tr, .alerts td { display: block; width: 100%; }
  .alerts thead { display: none; }
  .alerts td:first-child { border-top: 1px solid rgba(0,0,0,.15); font-weight: 600; padding-bottom: 0; }
  .alerts td:last-child { border-top: 0; }
}
.score-card { display: grid; grid-template-columns: auto 1fr; gap: 1.5rem; align-items: center; }
.score-num { font-size: 3rem; font-weight: 800; color: var(--brand); line-height: 1; }
.score-num small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.level-name { font-size: 1.4rem; font-weight: 700; color: var(--accent-hover); }
@media (max-width: 560px) { .score-card { grid-template-columns: 1fr; gap: .5rem; } }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 1.25rem; }
.levels div { padding: .5rem .4rem; background: var(--bg); border-radius: 8px; font-size: .78rem; text-align: center; color: var(--muted); }
.levels div.on { background: var(--brand); color: #fff; font-weight: 700; }
.levels b { display: block; font-size: .72rem; font-weight: 500; opacity: .85; }
@media (max-width: 560px) { .levels { grid-template-columns: repeat(2, 1fr); } }
.note { font-size: .9rem; color: var(--muted); margin-top: 1rem; }

.topic-row { padding: .8rem 0; border-top: 1px solid var(--border); }
.topic-row:first-child { border-top: 0; }
.topic-head { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; }
.bar { height: 10px; background: var(--bg); border-radius: 999px; margin: .4rem 0; overflow: hidden; }
.bar > div { height: 100%; background: var(--brand); border-radius: 999px; }
.topic-row.weak .bar > div { background: var(--accent); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-hover); margin-left: .4rem; vertical-align: middle; }
.learn { font-size: .88rem; color: var(--muted); }

.recs { list-style: none; padding: 0; margin: 0; }
.recs li { padding: .7rem 0; border-top: 1px solid var(--border); }
.recs li:first-child { border-top: 0; }
dl.profile { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: .4rem 1rem; margin: 0; font-size: .93rem; }
dl.profile dt { color: var(--muted); }
dl.profile dd { margin: 0; }
@media (max-width: 560px) { dl.profile { grid-template-columns: 1fr; } dl.profile dd { margin-bottom: .5rem; } }
.share { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.share input { flex: 1 1 260px; min-width: 0; font: inherit; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 8px; }

@media print {
  .site-header, .nav, .no-print, .share { display: none !important; }
  body { background: #fff; }
  .card, .alerts { break-inside: avoid; border-color: #bbb; }
  .bar > div, .levels div.on, .seg input:checked + span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* keep legends inside bordered fieldset cards */
fieldset.card > legend { float: left; width: 100%; }
fieldset.card > legend + * { clear: both; }
legend.stmt { font-weight: 500; margin-bottom: .75rem; }
