:root {
  --bg: #f6f5f1; --surface: #ffffff; --ink: #1d1d1f; --muted: #6b6b70; --line: #e2e0da;
  --control: #85858b; /* borders of inputs and answer buttons: >= 3:1 against surface and bg (WCAG 1.4.11) */
  --accent: #5b3fd1; --accent-ink: #ffffff; --accent-soft: #efebff;
  --ok: #1f7a4d; --ok-soft: #e4f4ea; --bad: #b3261e; --bad-soft: #fbe9e7; --warn: #9a6200; --warn-soft: #fff3dc;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416; --surface: #1f1f23; --ink: #ececf0; --muted: #a0a0a8; --line: #34343a;
    --control: #7c7c85;
    --accent: #9d8cff; --accent-ink: #141416; --accent-soft: #2a2545;
    --ok: #6fd39d; --ok-soft: #1b3326; --bad: #ff8a80; --bad-soft: #3a1f1d; --warn: #f0b860; --warn-soft: #3a2d14;
  }
}
* { box-sizing: border-box; }
/* the `hidden` attribute must win over component display rules such as .btn { display: inline-block } */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Rubik", system-ui, sans-serif; line-height: 1.6; }
.topbar { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { color: var(--accent); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-size: 1.15rem; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.wrap { max-width: 860px; margin: 0 auto; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
h1 { font-size: 1.6rem; margin: 0 0 8px; } h2 { font-size: 1.2rem; margin: 20px 0 8px; } h3 { font-size: 1.05rem; }
.card > h2:first-child { margin-top: 0; }
.lead { font-size: 1.08rem; } .muted { color: var(--muted); } .nowrap { white-space: nowrap; }
.btn { font: inherit; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 500; }

/* ---- test ---- */
.test-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chapter-name { font-weight: 700; font-size: 1.1rem; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 700; direction: ltr; padding: 4px 12px; border-radius: 10px; background: var(--accent-soft); }
.timer.low { background: var(--bad-soft); color: var(--bad); }
.dots { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.dot { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--control); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
/* answered = solid fill, a strong lightness change, not just a hue */
.dot.done { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.dot.cur { outline: 2px solid var(--accent); outline-offset: 2px; }
.q-area { min-height: 280px; }
.prompt { font-size: 1.12rem; font-weight: 500; }
.prompt:focus { outline: none; }
.prompt:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.stem-text { font-size: 1.15rem; background: var(--bg); padding: 10px 14px; border-radius: 10px; }
.stem-pair, .stem-seq { font-weight: 700; text-align: center; letter-spacing: .03em; }
.options { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.options-fig { grid-template-columns: repeat(4, 1fr); }
.option { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--control); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; text-align: start; }
.options-fig .option { flex-direction: column; padding: 8px; }
.option.selectable { cursor: pointer; }
.option.selectable:hover { border-color: var(--accent); }
.option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent); }
.option.selected .opt-num { background: var(--accent); color: var(--accent-ink); border-radius: 50%; }
.option.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.option.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt-mark { font-size: .85rem; font-weight: 500; white-space: nowrap; }
.is-correct .opt-mark { color: var(--ok); } .is-wrong .opt-mark { color: var(--bad); }
.options-fig .opt-mark { font-size: .78rem; }
.opt-num { font-weight: 700; min-width: 1.4em; text-align: center; }
.opt-body { flex: 1; width: 100%; }
.num-input { font: inherit; font-size: 1.3rem; width: 180px; padding: 8px 12px; border: 1.5px solid var(--control); border-radius: 10px; background: var(--surface); color: var(--ink); margin-top: 10px; }
.order-list { padding: 0; list-style: none; counter-reset: o; }
.order-list li { counter-increment: o; display: flex; align-items: center; gap: 10px; padding: 10px; margin-bottom: 6px; border: 1.5px solid var(--line); border-radius: 10px; }
.order-list li::before { content: counter(o); font-weight: 700; color: var(--accent); }
.order-text { flex: 1; }
.order-btns button { font: inherit; width: 44px; height: 40px; border-radius: 8px; border: 1px solid var(--control); background: var(--surface); color: var(--ink); cursor: pointer; }
.order-btns button:disabled { opacity: .3; }
.nav { display: flex; gap: 8px; justify-content: space-between; margin-top: 18px; flex-wrap: wrap; }
.overlay { position: fixed; inset: 0; background: rgb(0 0 0 / .45); display: grid; place-items: center; padding: 16px; }
.overlay[hidden] { display: none; }
.overlay-card { max-width: 420px; text-align: center; font-size: 1.1rem; }

/* ---- figures: always drawn on white, like a printed card ---- */
.fig { width: 100%; height: auto; display: block; background: #fff; border-radius: 6px; }
.fig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 330px; margin: 0 auto; }
.fig-row { display: flex; gap: 6px; justify-content: center; align-items: center; }
.fig-row .cell { width: 100px; max-width: 18vw; }
.cell { border: 1.5px solid #888; border-radius: 6px; background: #fff; }
.fig-sep { font-size: 1.6rem; font-weight: 700; padding: 0 2px; }
.fig-eq { padding: 0 10px; }

/* ---- report ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs a { padding: 8px 16px; border-radius: 10px; text-decoration: none; color: var(--ink); border: 1px solid var(--line); background: var(--surface); }
.tabs a.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.notice { background: var(--warn-soft); border-inline-start: 4px solid var(--warn); padding: 10px 14px; border-radius: 8px; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0; }
.kpi { background: var(--bg); border-radius: 12px; padding: 12px; text-align: center; }
.kpi-val { font-size: 1.6rem; font-weight: 700; direction: ltr; }
.kpi-lbl { font-size: .85rem; color: var(--muted); }
.scale { position: relative; height: 18px; border-radius: 9px; background: var(--line); margin: 28px 0 4px; }
.scale-band { position: absolute; top: 0; bottom: 0; background: var(--accent-soft); border: 1.5px solid var(--accent); border-radius: 9px; }
.scale-mark { position: absolute; top: -4px; width: 4px; height: 26px; background: var(--accent); transform: translateX(50%); border-radius: 2px; }
.scale-target { position: absolute; top: -10px; bottom: -4px; border-inline-start: 2px dashed var(--bad); }
.scale-target span { position: absolute; top: -18px; right: -12px; font-size: .75rem; color: var(--bad); }
.scale-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.readiness { font-weight: 500; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: start; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
.pill { padding: 2px 10px; border-radius: 999px; font-size: .85rem; white-space: nowrap; }
.pill.strong, .pill.good { background: var(--ok-soft); color: var(--ok); }
.pill.mid { background: var(--warn-soft); color: var(--warn); }
.pill.weak { background: var(--bad-soft); color: var(--bad); }
.plan-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.plan-form label { display: flex; flex-direction: column; font-size: .9rem; }
.plan-form input { font: inherit; width: 110px; padding: 6px 10px; border: 1px solid var(--control); border-radius: 8px; background: var(--surface); color: var(--ink); }
.weeks > li { margin-bottom: 10px; }
details { border-top: 1px solid var(--line); padding: 8px 0; }
summary { cursor: pointer; font-weight: 500; }
.review { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; }
.review.ok { border-inline-start: 4px solid var(--ok); } .review.bad { border-inline-start: 4px solid var(--bad); }
.review-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.explain { margin-top: 10px; background: var(--bg); padding: 10px 12px; border-radius: 8px; }
.child-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.child-box { border-radius: 12px; padding: 14px; }
.child-box h2 { margin-top: 0; }
.child-box.good { background: var(--ok-soft); } .child-box.grow { background: var(--accent-soft); }

/* ---- header, forms, dashboard ---- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.topnav { display: flex; align-items: center; gap: 14px; font-size: .95rem; }
.topnav a { color: var(--ink); }
.topnav .btn { color: var(--accent-ink); }
.inline { display: inline; margin: 0; }
.linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; cursor: pointer; }
.btn-sm { padding: 6px 12px; }
.btn-block { width: 100%; margin-top: 12px; }
.center { text-align: center; }
.flash { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.form-card { max-width: 520px; margin-inline: auto; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; border: 0; padding: 0; }
.field > span, .field legend { font-weight: 500; }
.field input, .field select { font: inherit; padding: 9px 12px; border: 1.5px solid var(--control); border-radius: 10px; background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--bad); border-width: 2px; }
.error-summary { background: var(--bad-soft); color: var(--bad); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.error-summary:focus { outline: 3px solid var(--bad); outline-offset: 2px; }
.error-summary ul { margin: 4px 0 0; padding-inline-start: 20px; }
.error-summary a { color: inherit; }
.radios { display: flex; gap: 18px; flex-wrap: wrap; }
.radio { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; }
.radio input { margin-top: 6px; }
.consent { margin: 8px 0 4px; font-size: .95rem; }
.field-error { color: var(--bad); font-size: .9rem; }
.field-error.block { display: block; background: var(--bad-soft); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between h1, .row-between h2 { margin: 0; }
.row-between p { margin: 2px 0 0; }
.attempts { list-style: none; padding: 0; margin: 12px 0 0; }
.attempts li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: var(--bg); border-radius: 10px; }

.email-status { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; font-size: .9rem; }

/* ---- child mode ---- */
.child-badge { background: var(--accent-soft); color: var(--accent); padding: 3px 12px; border-radius: 999px; font-weight: 500; }
.topnav .parent-link { color: var(--muted); font-size: .85rem; text-decoration: none; }
.pin-input { font-size: 1.5rem !important; letter-spacing: .5em; text-align: center; max-width: 200px; }

/* ---- accessibility basics ---- */
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 10; background: var(--accent); color: var(--accent-ink);
  padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }
/* visible only to screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
/* Windows high-contrast / forced colours: keep selected answers and answered dots distinguishable */
@media (forced-colors: active) {
  .option.selected, .dot.cur { outline: 3px solid Highlight; }
  .dot.done { border: 3px double ButtonText; }
}

/* ---- landing page ---- */
.landing { padding: 0; }
.landing .flash { max-width: 1040px; margin: 16px auto; }
.band-inner, .hero-inner { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.band-inner.narrow { max-width: 760px; }
.hero { background: linear-gradient(160deg, var(--accent-soft), var(--bg) 70%); padding: 48px 0 56px; }
.hero-inner { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.eyebrow { color: var(--accent); font-weight: 500; margin: 0 0 8px; }
.hero h1 { font-size: clamp(1.8rem, 4.2vw, 2.6rem); line-height: 1.25; margin: 0 0 16px; }
.hero .lead { font-size: 1.12rem; margin: 0 0 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; border-radius: 12px; }
.btn-ghost { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn-light { background: #fff; color: #3a2799; border-color: #fff; font-weight: 700; }
.hero-note { margin-top: 12px; font-size: .92rem; }

.report-preview { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px;
  box-shadow: 0 18px 40px -18px rgb(60 40 160 / .35); }
.rp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.rp-title { font-weight: 700; }
.rp-tag { font-size: .78rem; background: var(--warn-soft); color: var(--warn); padding: 2px 10px; border-radius: 999px; }
.rp-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.rp-kpis div { background: var(--bg); border-radius: 12px; padding: 10px; text-align: center; }
.rp-kpis b { display: block; font-size: 1.4rem; }
.rp-kpis span { font-size: .8rem; color: var(--muted); }
.rp-bars { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.rp-bars li { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; font-size: .9rem; }
.rp-track { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.rp-fill { display: block; height: 100%; border-radius: 999px; }
.rp-fill.good { background: var(--ok); } .rp-fill.mid { background: var(--warn); } .rp-fill.weak { background: var(--bad); }
.rp-plan { margin: 0; font-size: .92rem; background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }

.band { padding: 56px 0; background: var(--surface); }
.band-alt { background: var(--bg); }
.band h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 12px; text-align: center; }
.section-lead { text-align: center; max-width: 640px; margin: 0 auto 28px; color: var(--muted); }
.band h3 { font-size: 1.08rem; margin: 0 0 6px; }

.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { background: var(--bg); border-radius: 16px; padding: 22px; }
.step-num { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; margin-bottom: 10px; }
.steps p, .chapters p, .why p { margin: 0; color: var(--muted); }

.chapters, .why { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.chapters li, .why li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.why { margin-top: 24px; }

.get-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; margin-top: 24px; }
.get-card { background: var(--bg); border-radius: 16px; padding: 24px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checks li { position: relative; padding-inline-start: 28px; }
.checks li::before { content: "✓"; position: absolute; inset-inline-start: 0; color: var(--ok); font-weight: 700; }
.child-sample { background: var(--surface); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 16px; margin-top: 12px; }
.child-sample p { margin: 4px 0; }
.cs-title { font-weight: 700; font-size: 1.1rem; }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-weight: 500; font-size: 1.05rem; cursor: pointer; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

.final-cta { background: #3a2799; color: #fff; text-align: center; padding: 56px 0; }
.final-cta h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.final-cta p { margin: 0 0 22px; opacity: .9; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 28px 16px; font-size: .92rem; }
.footer-inner { max-width: 1040px; margin: 0 auto; display: grid; gap: 10px; }
.footer-brand { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--ink); }
.footer-note { margin: 0; font-size: .85rem; }

@media (max-width: 1000px) {
  .chapters, .why { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero-inner, .get-grid { grid-template-columns: 1fr; }
  .steps, .chapters, .why { grid-template-columns: 1fr; }
  .hero { padding: 32px 0 40px; }
}

@media (max-width: 560px) {
  .options-fig { grid-template-columns: repeat(2, 1fr); }
  .kpis, .child-grid { grid-template-columns: 1fr; }
  .fig-sep { font-size: 1.1rem; } .fig-eq { padding: 0 4px; }
}

/* "why" has 5 cards: flex so the last row is centered instead of leaving a gap */
.why { display: flex; flex-wrap: wrap; justify-content: center; }
.why li { flex: 0 1 calc((100% - 32px) / 3); }
@media (max-width: 1000px) { .why li { flex-basis: calc((100% - 16px) / 2); } }
@media (max-width: 860px) { .why li { flex-basis: 100%; } }

/* ---- legal pages ---- */
.legal { max-width: 760px; margin-inline: auto; line-height: 1.75; }
.legal h2 { font-size: 1.15rem; margin-top: 28px; }
.legal ul { padding-inline-start: 22px; }
.legal li { margin-bottom: 6px; }
.legal table td:first-child { white-space: nowrap; font-weight: 500; }
.draft-banner { margin-bottom: 16px; }
@media (max-width: 560px) {
  /* stack the "what we collect" table into one card per row */
  .legal table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .legal table, .legal tbody, .legal tr, .legal td { display: block; width: 100%; }
  .legal tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
  .legal td { border: 0; padding: 4px 0; }
  .legal td:first-child { color: var(--accent); font-size: 1.05rem; }
  .legal td:last-child { color: var(--muted); }
  .legal td:last-child::before { content: "למה: "; font-weight: 500; }
}

/* ---- email verification notice ---- */
.verify-notice { background: var(--warn-soft); border-color: var(--warn); }
.verify-notice h2 { margin: 0 0 6px; font-size: 1.1rem; }
.verify-notice p { margin: 0 0 12px; }
.site-footer-min { padding: 14px 16px; text-align: center; }
.site-footer-min a { color: var(--muted); }
