/* Site styles. One bold device: six index tabs, one per exam category, as on a hand-tabbed CFR.
   Everything else stays quiet: cool paper, ink, one document blue. */

@font-face { font-family: "Literata"; src: url("fonts/literata-var.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url("fonts/literata-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("fonts/barlow-sc-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("fonts/barlow-sc-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow SC"; src: url("fonts/barlow-sc-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #f5f6f2;
  --sheet: #ffffff;
  --ink: #172231;
  --muted: #566170;
  --rule: #d3d8cf;
  --blue: #1f4e79;
  --blue-dark: #163a5b;
  --good: #1f7a4d;
  --bad: #b3261e;
  /* tab colours, one per category, in the exam's category order */
  --t-bc: #4c6fd1;   /* Broker Compliance */
  --t-pe: #e3a21a;   /* Practical Exercise */
  --t-qu: #8a63c9;   /* Quota */
  --t-cl: #3f9e6e;   /* Classification */
  --t-en: #d6457c;   /* Entry / Entry Summary */
  --t-va: #2a96ab;   /* Valuation */
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --ui: "Barlow SC", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.65 var(--serif);
  font-optical-sizing: auto;
}
img, svg { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--t-pe); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 20; }
.skip:focus { left: 1rem; }

h1, h2, h3 { font-family: var(--serif); font-weight: 650; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-variation-settings: "opsz" 72; font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-variation-settings: "opsz" 48; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
.lede { font-size: 1.2rem; line-height: 1.55; color: var(--muted); }
small, .small { font-size: .875rem; }

/* ---------- page frame with the tab edge ---------- */
.frame { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; position: relative; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.brand { display: inline-flex; align-items: center; gap: .6rem; font: 700 1.25rem/1 var(--ui); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.brand svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; gap: 1.25rem; font: 600 1rem/1 var(--ui); }
.nav a { white-space: nowrap; color: var(--ink); text-decoration: none; padding: .4rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--blue); }

/* The index tabs: fixed to the right edge on wide screens, a strip under the masthead on small ones. */
.tabs { position: fixed; right: 0; top: 7.5rem; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.tabs a {
  display: block; width: 2.4rem; padding: .7rem 0; writing-mode: vertical-rl; transform: rotate(180deg);
  font: 600 .82rem/1 var(--ui); color: var(--ink); text-decoration: none; text-align: center;
  border-radius: 0 6px 6px 0; box-shadow: inset 4px 0 0 rgba(0,0,0,.08);
  transition: width .15s ease;
}
.tabs a:hover, .tabs a:focus-visible { width: 2.9rem; }
.tab-bc { background: var(--t-bc); color: #fff !important; }
.tab-pe { background: var(--t-pe); }
.tab-qu { background: var(--t-qu); color: #fff !important; }
.tab-cl { background: var(--t-cl); color: #fff !important; }
.tab-en { background: var(--t-en); color: #fff !important; }
.tab-va { background: var(--t-va); color: #fff !important; }
@media (min-width: 1101px) { body { padding-right: 3rem; } }
@media (max-width: 1100px) {
  .tabs { position: static; flex-direction: row; gap: 3px; margin: 0 -1.5rem; overflow-x: auto; }
  .tabs a { writing-mode: horizontal-tb; transform: none; width: auto; flex: 1 0 auto; padding: .45rem .6rem; border-radius: 0 0 6px 6px; box-shadow: inset 0 4px 0 rgba(0,0,0,.08); }
  .tabs a:hover, .tabs a:focus-visible { width: auto; }
}

/* ---------- buttons and forms ---------- */
.btn {
  display: inline-block; font: 600 1.1rem/1 var(--ui); letter-spacing: .01em;
  background: var(--blue); color: #fff; text-decoration: none; border: 0; cursor: pointer;
  padding: .95rem 1.4rem; border-radius: 3px;
}
.btn:hover { background: var(--blue-dark); color: #fff; }
.btn[disabled] { background: #8b97a5; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 2px var(--blue); }
.btn-quiet:hover { background: var(--blue); color: #fff; }
.field { display: flex; gap: .5rem; flex-wrap: wrap; max-width: 32rem; }
.field input[type=email] {
  flex: 1 1 15rem; font: 400 1.05rem/1.2 var(--serif); padding: .85rem .9rem; border: 1px solid #9aa4ae; border-radius: 3px; background: #fff; color: var(--ink);
}
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .92rem; margin: .8rem 0 0; max-width: 32rem; color: var(--muted); }
.check input { margin-top: .3rem; }
.form-msg { min-height: 1.5em; margin-top: .6rem; font-size: .95rem; }
.form-msg.ok { color: var(--good); }
.form-msg.err { color: var(--bad); }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3.5rem; align-items: start; padding: 4rem 0 3.5rem; }
.hero .actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-top: 1.75rem; }
.hero .actions .note { font: 500 .98rem/1.3 var(--ui); color: var(--muted); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; gap: 2.5rem; padding-top: 2.5rem; } }

/* The sample question: the one card on the page, styled as a page from a tabbed reference. */
.sample {
  background: var(--sheet); border: 1px solid var(--rule); border-left: 6px solid var(--t-en);
  padding: 1.5rem 1.6rem 1.35rem; position: relative;
}
.sample .cat { font: 600 .92rem/1 var(--ui); color: var(--t-en); margin: 0 0 .9rem; }
.sample .stem { font-size: 1.02rem; margin-bottom: 1rem; }
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.opt {
  display: grid; grid-template-columns: 2rem 1fr; gap: .5rem; align-items: start; width: 100%; text-align: left;
  font: inherit; font-size: .98rem; line-height: 1.45; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 3px; padding: .6rem .7rem; cursor: pointer;
}
.opt .l { font: 700 1rem/1.45 var(--ui); color: var(--muted); }
.opt:hover { border-color: var(--blue); }
.opt[aria-pressed="true"] { border-color: var(--blue); background: #e8eef5; box-shadow: inset 3px 0 0 var(--blue); }
.opt.is-right { border-color: var(--good); background: #e6f3ec; box-shadow: inset 3px 0 0 var(--good); }
.opt.is-wrong { border-color: var(--bad); background: #fbeceb; box-shadow: inset 3px 0 0 var(--bad); }
.opt[disabled] { cursor: default; }
.cite { margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--rule); font-size: .95rem; }
.cite .verdict { font: 700 1rem/1.3 var(--ui); margin: 0 0 .35rem; }
.cite .verdict.ok { color: var(--good); }
.cite .verdict.no { color: var(--bad); }
.cite-links { font: 600 .95rem/1.4 var(--ui); margin: .4rem 0 0; }
.cite-links a { margin-right: .9rem; white-space: nowrap; }

/* facts row */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts > div { padding: 1.5rem 1.5rem 1.4rem 0; }
.facts > div + div { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.facts strong { display: block; font: 700 1.35rem/1.2 var(--ui); margin-bottom: .3rem; }
.facts p { margin: 0; font-size: .97rem; color: var(--muted); }
@media (max-width: 700px) { .facts { grid-template-columns: 1fr; } .facts > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); } }

.section { padding: 4rem 0 1rem; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3.5rem; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; gap: 2rem; } }

/* Topic weights: a stacked bar in the tab colours, sized by question count. */
.weights { margin: 1.5rem 0 .5rem; }
.wbar { display: flex; height: 2.6rem; border-radius: 3px; overflow: hidden; }
.wbar span { display: block; height: 100%; }
.wlist { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem 1.5rem; }
.wlist li { display: grid; grid-template-columns: .9rem 1fr auto; gap: .6rem; align-items: center; font: 500 1rem/1.3 var(--ui); padding: .35rem 0; border-bottom: 1px solid var(--rule); }
.wlist i { width: .9rem; height: .9rem; border-radius: 2px; }
.wlist b { font-weight: 700; }
@media (max-width: 560px) { .wlist { grid-template-columns: 1fr; } }

.signup { background: var(--ink); color: #e9edf1; padding: 3rem 2.5rem; margin: 4rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.signup h2 { color: #fff; }
.signup p { color: #c4ccd5; }
.signup .check { color: #c4ccd5; }
.signup a { color: #a9c7ea; }
.signup .form-msg.ok { color: #8fd6ad; }
.signup .form-msg.err { color: #ffb4ab; }
.signup .btn { background: var(--t-pe); color: var(--ink); }
.signup .btn:hover { background: #f0b638; }
@media (max-width: 900px) { .signup { grid-template-columns: 1fr; padding: 2rem 1.5rem; margin-left: -1.5rem; margin-right: -1.5rem; } }

.pack-teaser { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; padding: 3rem 0; border-bottom: 1px solid var(--rule); }
.price { font: 700 2.4rem/1 var(--ui); }
.price small { font: 500 1rem/1 var(--ui); color: var(--muted); margin-left: .35rem; }

.footer { padding: 2.5rem 0 3rem; font-size: .9rem; color: var(--muted); }
.footer p { max-width: 46rem; }
.footer nav { font: 600 .95rem/1 var(--ui); display: flex; gap: 1.2rem; margin-bottom: 1rem; }

/* ---------- product page ---------- */
.pack { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 3.5rem; padding: 3.5rem 0 2rem; align-items: start; }
@media (max-width: 900px) { .pack { grid-template-columns: 1fr; } }
.buybox { background: var(--sheet); border: 1px solid var(--rule); border-top: 6px solid var(--t-pe); padding: 1.6rem; position: sticky; top: 1.5rem; }
.buybox ul { padding-left: 1.1rem; margin: 1rem 0 1.25rem; }
.buybox li { margin-bottom: .35rem; }
.buybox .soon { font: 500 .95rem/1.4 var(--ui); color: var(--muted); margin-top: .75rem; }
.contents { list-style: none; padding: 0; margin: 1.5rem 0; }
.contents li { padding: 1rem 0 1rem 1.25rem; border-bottom: 1px solid var(--rule); position: relative; max-width: var(--measure); }
.contents li::before { content: ""; position: absolute; left: 0; top: 1.35rem; width: .5rem; height: .5rem; background: var(--blue); }
.contents strong { font-family: var(--ui); font-size: 1.12rem; font-weight: 700; }
.faq dt { font-weight: 650; margin-top: 1.4rem; }
.faq dd { margin: .3rem 0 0; max-width: var(--measure); color: var(--muted); }

/* ---------- mock exam ---------- */
.exam-bar { position: sticky; top: 0; z-index: 6; background: var(--ink); color: #fff; }
.exam-bar .frame { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.exam-bar .brand { color: #fff; font-size: 1.05rem; }
.timer { font: 700 1.35rem/1 var(--ui); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.timer.low { color: #ffcf6b; }
.progress { font: 500 1rem/1 var(--ui); color: #c4ccd5; }
.exam { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 2.5rem; padding: 2.25rem 0 3rem; }
@media (max-width: 900px) { .exam { grid-template-columns: 1fr; } }
.qhead { display: flex; align-items: baseline; gap: .9rem; margin-bottom: 1rem; }
.qnum { font: 700 1.5rem/1 var(--ui); }
.qcat { font: 600 .95rem/1 var(--ui); padding: .3rem .55rem; border-radius: 3px; color: #fff; }
.qstem { font-size: 1.08rem; max-width: 42rem; white-space: pre-line; }
.exam .opts { max-width: 42rem; margin-top: 1.25rem; }
.exam .opt { background: var(--sheet); font-size: 1.02rem; padding: .8rem .9rem; }
.qnav { display: flex; gap: .6rem; margin-top: 1.75rem; flex-wrap: wrap; align-items: center; }
.flag { font: 600 .98rem/1 var(--ui); background: none; border: 0; color: var(--muted); cursor: pointer; padding: .6rem .2rem; }
.flag[aria-pressed="true"] { color: #9a6a00; }
.side h2 { font: 700 1.05rem/1.2 var(--ui); margin-bottom: .75rem; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.grid button {
  font: 600 .98rem/1 var(--ui); padding: .55rem 0; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); border-radius: 3px; cursor: pointer; position: relative;
}
.grid button.done { background: #dfe7f0; border-color: #b9c7d6; }
.grid button.cur { outline: 2px solid var(--blue); outline-offset: 1px; }
.grid button.flagged::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--t-pe); }
.legend { font: 500 .9rem/1.5 var(--ui); color: var(--muted); margin: .75rem 0 1.25rem; }
.intro { max-width: 44rem; padding: 3rem 0; }
.intro ul { padding-left: 1.2rem; }
.intro li { margin-bottom: .4rem; }

/* results */
.score { display: grid; grid-template-columns: auto 1fr; gap: 2.5rem; align-items: center; padding: 3rem 0 2rem; border-bottom: 1px solid var(--rule); }
.score .big { font: 700 clamp(3.5rem, 9vw, 6rem)/1 var(--ui); font-variant-numeric: tabular-nums; }
.score .big span { color: var(--muted); font-size: .45em; }
.passline { font: 600 1.1rem/1.4 var(--ui); }
.passline.ok { color: var(--good); }
.passline.no { color: var(--bad); }
@media (max-width: 600px) { .score { grid-template-columns: 1fr; gap: 1rem; } }
.bycat { list-style: none; padding: 0; margin: 1.5rem 0 0; max-width: 40rem; }
.bycat li { display: grid; grid-template-columns: 13rem 1fr 3.5rem; gap: .9rem; align-items: center; font: 500 1rem/1.3 var(--ui); padding: .45rem 0; }
.bycat .track { height: .75rem; background: #e3e7df; border-radius: 2px; overflow: hidden; }
.bycat .fill { height: 100%; }
@media (max-width: 600px) { .bycat li { grid-template-columns: 1fr 3.5rem; } .bycat .track { grid-column: 1 / -1; grid-row: 2; } }
.review { list-style: none; padding: 0; margin: 2rem 0; counter-reset: none; }
.review > li { padding: 1.75rem 0; border-bottom: 1px solid var(--rule); }
.review .rhead { display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .6rem; }
.review .mark { font: 700 1rem/1 var(--ui); }
.review .mark.ok { color: var(--good); }
.review .mark.no { color: var(--bad); }
.review .opts { max-width: 42rem; margin: .9rem 0; }
.review .why { max-width: 42rem; background: var(--sheet); border-left: 3px solid var(--rule); padding: .8rem 1rem; font-size: .98rem; }
.review .why p { margin: 0 0 .5rem; }

.prose { max-width: 44rem; padding: 3rem 0; }
.prose h2 { margin-top: 2rem; font-size: 1.4rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
