/* ==========================================================================
   Examling — marketing + legal site shared stylesheet
   Static site served at examling.com (root); the Flutter app is at
   examling.com/app/ — one Cloudflare Pages project, because two cannot share
   one apex and an SPA at the root would leave the marketing site unindexed.
   Theme-aware (light default + prefers-color-scheme dark + data-theme override).
   ========================================================================== */

:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F0F2F9;
  --border: #E3E7F0;
  --text: #12172A;
  --muted: #5B6478;
  --primary: #4F46E5;      /* platform / exam indigo */
  --primary-ink: #FFFFFF;
  --primary-weak: #EEEFFE;
  --accent: #FF6584;       /* the warm second accent, sparingly */
  --accent-weak: #FFEDF1;
  --success: #0E9F6E;
  --ring: rgba(79, 70, 229, .35);
  --shadow: 0 1px 2px rgba(16,22,42,.04), 0 8px 24px rgba(16,22,42,.06);
  --shadow-lg: 0 2px 4px rgba(16,22,42,.05), 0 20px 50px rgba(16,22,42,.10);
  --radius: 16px;
  --radius-sm: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --maxw: 1080px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090D18; --surface: #121829; --surface-2: #0E1422; --border: #222A3E;
    --text: #E8EBF4; --muted: #97A1B6; --primary: #9A93FF; --primary-ink: #0B0E1A;
    --primary-weak: #191D38; --accent: #FF8DA5; --accent-weak: #2A1720;
    --success: #34D399; --ring: rgba(154,147,255,.4);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px rgba(0,0,0,.35);
    --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #090D18; --surface: #121829; --surface-2: #0E1422; --border: #222A3E;
  --text: #E8EBF4; --muted: #97A1B6; --primary: #9A93FF; --primary-ink: #0B0E1A;
  --primary-weak: #191D38; --accent: #FF8DA5; --accent-weak: #2A1720;
  --success: #34D399; --ring: rgba(154,147,255,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 12px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px rgba(0,0,0,.5);
}
:root[data-theme="light"] {
  --bg: #F6F7FB; --surface: #FFFFFF; --surface-2: #F0F2F9; --border: #E3E7F0;
  --text: #12172A; --muted: #5B6478; --primary: #4F46E5; --primary-ink: #FFFFFF;
  --primary-weak: #EEEFFE; --accent: #FF6584; --accent-weak: #FFEDF1;
  --success: #0E9F6E; --ring: rgba(79,70,229,.35);
  --shadow: 0 1px 2px rgba(16,22,42,.04), 0 8px 24px rgba(16,22,42,.06);
  --shadow-lg: 0 2px 4px rgba(16,22,42,.05), 0 20px 50px rgba(16,22,42,.10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .spark {
  display: inline-block; width: .9em; height: .9em; vertical-align: -.05em;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23F5A623' d='M12 1.5c.9 6.4 3.7 9.2 10.5 10.5C15.7 13.3 12.9 16.1 12 22.5 11.1 16.1 8.3 13.3 1.5 12 8.3 10.7 11.1 7.9 12 1.5Z'/%3E%3C/svg%3E");
}
.nav .links { display: flex; gap: 22px; margin-left: 8px; }
.nav .links a { color: var(--muted); font-size: 14.5px; font-weight: 600; }
.nav .links a:hover { color: var(--text); text-decoration: none; }
.nav .spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14.5px var(--sans); padding: 10px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  cursor: pointer; transition: transform .05s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.lg { padding: 13px 24px; font-size: 15.5px; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav .links { display: none; }
}

/* ---- Generic sections ---- */
section { padding: clamp(48px, 8vw, 88px) 0; }
.eyebrow { font: 700 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--primary); margin: 0 0 14px; }
h1 { font-size: clamp(32px, 6vw, 56px); line-height: 1.03; letter-spacing: -.03em; margin: 0 0 16px; font-weight: 850; text-wrap: balance; }
h2 { font-size: clamp(24px, 4vw, 34px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 12px; font-weight: 800; text-wrap: balance; }
h3 { font-size: 18px; margin: 0 0 8px; font-weight: 700; }
.lede { color: var(--muted); font-size: clamp(16px, 2.4vw, 20px); max-width: 62ch; margin: 0; }
.center { text-align: center; }
.center .lede { margin-inline: auto; }

/* ---- Hero ---- */
.hero { position: relative; overflow: hidden; padding-top: clamp(40px, 7vw, 72px); }
.hero .badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); padding: 7px 12px; border-radius: 999px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-note { color: var(--muted); font-size: 13.5px; margin-top: 14px; }

/* ---- Two-product split ---- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 820px) { .split { grid-template-columns: 1fr; } }
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.pcard.accent { border-top: 3px solid var(--accent); }
.pcard.exam { border-top: 3px solid var(--primary); }
.pcard .k { font: 700 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; display: inline-block; }
.pcard.accent .k { color: var(--accent); }
.pcard.exam .k { color: var(--primary); }
.pcard ul { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; }
.pcard li { position: relative; padding-left: 26px; font-size: 15px; }
.pcard li::before { content: "✓"; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--success); }

/* ---- Steps ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 32px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.step .n { font: 800 13px var(--mono); color: var(--primary-ink); background: var(--primary); width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; margin-bottom: 14px; }

/* ---- Trust / safety strip ---- */
.trust { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 820px) { .trust-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .trust-grid { grid-template-columns: 1fr; } }
.trust .item h3 { font-size: 15px; }
.trust .item p { color: var(--muted); font-size: 13.5px; margin: 0; }

/* ---- CTA band ---- */
.cta-band { background: var(--primary); color: var(--primary-ink); border-radius: var(--radius); padding: clamp(32px, 5vw, 56px); text-align: center; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: var(--primary-ink); }
.cta-band p { color: color-mix(in srgb, var(--primary-ink) 82%, transparent); max-width: 52ch; margin: 0 auto 24px; font-size: 17px; }
.cta-band .btn { background: #fff; color: #1a1440; border-color: #fff; }

/* ---- FAQ ---- */
.faq { max-width: 760px; margin: 0 auto; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 4px 18px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 22px; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 44px 0 40px; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
@media (max-width: 820px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
.foot-grid h4 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.foot-grid a { display: block; color: var(--text); font-size: 14px; margin-bottom: 9px; }
.foot-grid a:hover { color: var(--primary); text-decoration: none; }
.foot-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }

/* ---- Legal / document pages ---- */
.doc { max-width: 780px; margin: 0 auto; padding: clamp(32px, 6vw, 64px) 20px; }
.doc .updated { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.doc h1 { font-size: clamp(28px, 4.5vw, 40px); }
.doc h2 { font-size: 21px; margin: 36px 0 10px; }
.doc h3 { font-size: 17px; margin: 24px 0 8px; }
.doc p, .doc li { color: var(--text); font-size: 15.5px; }
.doc ul { padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc .toc { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 22px; margin: 24px 0 8px; }
.doc .toc ol { margin: 8px 0 0; padding-left: 20px; }
.doc .toc a { font-weight: 600; }
.doc .note { background: var(--accent-weak); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border)); border-radius: var(--radius-sm); padding: 16px 18px; margin: 20px 0; font-size: 14.5px; }
.placeholder { background: #FFF3CD; color: #7A5B00; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
@media (prefers-color-scheme: dark) { .placeholder { background: #4A3A00; color: #FFE08A; } }
:root[data-theme="dark"] .placeholder { background: #4A3A00; color: #FFE08A; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
@media (max-width: 640px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.contact-card .addr { font: 600 15px var(--mono); color: var(--primary); word-break: break-all; }

/* ---------------------------------------------------------------------------
   Free calculator pages.

   Every colour comes from the tokens above, so these inherit light, dark and
   the system default without a second definition — the same rule the rest of
   the site follows.
   --------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.calc-row {
  display: grid; grid-template-columns: 1fr 96px 92px; gap: 14px;
  align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.calc-row:last-of-type { border-bottom: 0; }
.calc-row label { font-weight: 600; font-size: 15px; }
.calc-row input {
  width: 100%; padding: 10px 12px; font: inherit; font-variant-numeric: tabular-nums;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.calc-row input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.band {
  font: 600 14px/1.2 var(--mono); color: var(--primary); text-align: right;
  font-variant-numeric: tabular-nums;
}
.overall {
  margin-top: 20px; padding: 20px; border-radius: var(--radius);
  background: var(--primary-weak); border: 1px solid var(--primary);
}
.overall-label {
  margin: 0; font: 700 12px/1 var(--mono); letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
.overall-value {
  margin: 6px 0 10px; font-size: 44px; font-weight: 800; line-height: 1;
  color: var(--primary); font-variant-numeric: tabular-nums;
}
.working { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0; }
.score-table {
  width: 100%; border-collapse: collapse; margin: 12px 0 28px;
  font-variant-numeric: tabular-nums;
}
.score-table th, .score-table td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.score-table th { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
/* Wide content scrolls inside its own box so the page body never does. */
.table-scroll { overflow-x: auto; }
@media (max-width: 560px) {
  .calc-row { grid-template-columns: 1fr 84px; }
  .calc-row .band { grid-column: 2; text-align: left; }
}
