/* rijbewijsbtheorie.be — one small stylesheet, mobile first, system fonts, light and dark.
   Colours follow the app (Theme.swift): primary blue, deep navy, sign yellow. Logical properties keep RTL working. */

:root {
  --primary: #1a52d9;
  --primary-deep: #0d297a;
  --night: #081131;
  --accent: #fccc21;
  --ink: #121c38;
  --muted: #566078;
  --bg: #f2f5fa;
  --card: #ffffff;
  --soft: #e9eefb;
  --line: #d9e0ee;
  --link: #1a52d9;
  --correct: #1a9e5c;
  --correct-bg: #e5f6ed;
  --wrong: #d23232;
  --wrong-bg: #fdecec;
  --serious: #9e1419;
  --translation: #2849a8;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(13, 41, 122, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-rtl: "SF Arabic", "Geeza Pro", "Noto Naskh Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #edf0f7;
    --muted: #a5adc0;
    --bg: #0b0e18;
    --card: #161b29;
    --soft: #1d2436;
    --line: #2a3247;
    --link: #9cbcff;
    --correct-bg: #10301f;
    --wrong-bg: #3a1618;
    --serious: #ff8a8e;
    --translation: #b9c6ec;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0;
  font: 17px/1.6 var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow-wrap: break-word;
}
[dir="rtl"] body, [dir="rtl"] { font-family: var(--font-rtl); }
[dir="rtl"] body { line-height: 1.85; }
[lang="nl"], [dir="ltr"][lang] { font-family: var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; line-height: 1.45; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 16px; }
.narrow { max-width: 780px; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--accent); color: #111; padding: 8px 14px; border-radius: 10px; z-index: 50; font-weight: 700; }
.skip:focus { top: 8px; }

/* ---- header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(8, 17, 49, .94); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); color: #fff; }
.top-in { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; line-height: 1.05; margin-inline-end: auto; }
.brand img { border-radius: 9px; }
.brand small { display: block; font-weight: 600; font-size: .72rem; opacity: .75; letter-spacing: .02em; }
.brand span { font-family: var(--font); }
.nav { display: none; gap: 4px; }
.nav a { color: #dfe6ff; text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); color: #fff; }
.langs { position: relative; }
.langs summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; color: #fff; font-weight: 700; font-size: .9rem; font-family: var(--font); }
.langs summary::-webkit-details-marker { display: none; }
.langs summary svg { width: 20px; height: 20px; }
.langs summary:hover, .langs[open] summary { background: rgba(255, 255, 255, .12); }
.langs ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); list-style: none; margin: 0; padding: 6px; min-width: 190px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .25); }
.langs li { margin: 0; }
.langs a { display: block; padding: 9px 12px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 600; }
.langs a:hover { background: var(--soft); }
.langs a[aria-current="true"] { background: var(--soft); color: var(--primary); }
@media (prefers-color-scheme: dark) { .langs a[aria-current="true"] { color: var(--link); } }
@media (min-width: 760px) { .nav { display: flex; } }

/* ---- hero */
.hero { background: radial-gradient(120% 90% at 85% 10%, #1d3fa6 0%, rgba(29, 63, 166, 0) 60%), linear-gradient(160deg, #0b1d4f 0%, var(--night) 70%); color: #fff; overflow: hidden; }
.hero-in { display: grid; gap: 28px; padding-block: 34px 40px; }
.eyebrow { display: inline-block; font-weight: 800; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: .8em; }
[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: .95rem; }
.hero h1 { color: #fff; }
.lead { font-size: 1.12rem; color: inherit; opacity: .92; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 22px 0 8px; }
.cta-note { font-size: .9rem; opacity: .8; }
.store { display: inline-block; line-height: 0; border-radius: 12px; }
.store img { display: block; height: 55px; width: auto; }
.store-sm img { height: 45px; }
/* hero visual: one of our own illustrations with the question it asks (no app screenshots) */
.hero-visual { position: relative; padding-bottom: 8px; }
.hv-scene { border-radius: 22px; overflow: hidden; border: 5px solid rgba(255, 255, 255, .92); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); transform: rotate(-1.5deg); }
[dir="rtl"] .hv-scene { transform: rotate(1.5deg); }
.hv-scene img { display: block; width: 100%; height: auto; }
.hv-card { position: relative; margin: -30px 14px 0; background: #fff; color: #121c38; border-radius: 18px; padding: 16px 18px 18px; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.hv-timer { position: absolute; top: -20px; inset-inline-end: 16px; width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; display: grid; place-items: center; border: 3px solid #fff; font-family: var(--font); }
.hv-nl { font-weight: 800; font-size: 1.12rem; margin: 0 0 4px; padding-inline-end: 46px; text-align: left; }
.hv-tr { color: #2849a8; margin: 0 0 12px; }
.hv-btn { min-height: 42px; padding: 8px 18px; margin-top: 8px; }
@media (min-width: 900px) {
  .hero-in { grid-template-columns: 1.05fr .95fr; align-items: center; padding-block: 64px 72px; gap: 48px; }
  .hero-visual { padding-bottom: 70px; }
  .hv-card { position: absolute; bottom: 0; inset-inline-start: -34px; width: 330px; margin: 0; }
}

/* ---- sections */
.sec { padding-block: 44px; }
.sec-soft { background: var(--soft); }
.sec-dark { background: linear-gradient(180deg, var(--primary-deep), var(--night)); color: #fff; }
.sec-dark h2 { color: #fff; }
.checked { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); background: var(--card); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.checked::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--correct); flex: none; }
.checked-light { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); color: #e4e9ff; }
.more { margin-top: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 14px; background: var(--primary); color: #fff; font-weight: 700; text-decoration: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn-light { background: var(--accent); color: #111; }
.btn-ghost { background: transparent; color: var(--link); border: 2px solid currentColor; }

.grid { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 0; }
.card p { margin: 0; color: var(--muted); }
.ico { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--soft); color: var(--primary); margin-bottom: 12px; display: block; }
@media (prefers-color-scheme: dark) { .ico { color: var(--link); } }

.facts { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .facts { grid-template-columns: repeat(3, 1fr); } }
.facts li { margin: 0; padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); }
.facts strong { display: block; font-size: 1.7rem; line-height: 1.1; color: var(--accent); font-family: var(--font); unicode-bidi: plaintext; text-align: start; }
.facts span { font-size: .95rem; opacity: .9; }
.facts-box { margin: 26px 0 8px; padding: 18px; border-radius: var(--radius); background: linear-gradient(160deg, var(--primary-deep), var(--night)); color: #fff; }
.facts-box .facts { margin: 0; }


.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding-inline-start: 52px; margin-bottom: 18px; min-height: 40px; padding-top: 6px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 0; top: 0; width: 38px; height: 38px; border-radius: 12px; background: var(--accent); color: #111; font-weight: 800; display: grid; place-items: center; font-family: var(--font); }

.faq-i { background: var(--card); border-radius: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.faq-i summary { cursor: pointer; list-style: none; padding: 16px 18px; font-weight: 700; display: flex; justify-content: space-between; gap: 12px; }
.faq-i summary::-webkit-details-marker { display: none; }
.faq-i summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); flex: none; }
.faq-i[open] summary::after { content: "−"; }
.faq-i p { padding: 0 18px 16px; margin: 0; color: var(--muted); }

.cta-final { padding-block: 48px 56px; background: var(--soft); text-align: center; }
.cta-in { display: flex; flex-direction: column; align-items: center; }
.cta-final .cta-note { color: var(--muted); margin-top: 10px; }

/* 2027 notice under the hero */
.notice { background: var(--accent); }
.notice a { display: flex; align-items: center; gap: 12px; padding-block: 12px; color: #111; text-decoration: none; font-weight: 700; line-height: 1.35; }
.notice strong { background: #111; color: var(--accent); border-radius: 8px; padding: 2px 8px; font-family: var(--font); flex: none; }
.notice span { flex: 1; }
.notice b { flex: none; font-size: 1.2rem; }
[dir="rtl"] .notice b { transform: scaleX(-1); }

/* answer the sample question -> download */
.sample-cta { margin-top: 16px; padding: 18px; border-radius: 18px; background: var(--soft); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.sample-cta[hidden] { display: none; }
.sample-cta p { margin: 0; font-weight: 800; font-size: 1.1rem; }

/* more situations from the quiz */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.strip-i { display: block; border-radius: 16px; overflow: hidden; border: 4px solid rgba(255, 255, 255, .9); transition: transform .2s ease; }
.strip-i:hover { transform: translateY(-3px); }
.strip-i img { display: block; width: 100%; height: auto; }
@media (max-width: 720px) {
  .strip { grid-template-columns: repeat(3, 80%); overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: -16px; padding-inline: 16px; padding-bottom: 6px; }
  .strip-i { scroll-snap-align: center; }
}

/* download bar that follows the reader on phones (shown by the script once the hero badge is out of view) */
.sticky-cta { position: fixed; z-index: 30; inset-inline: 10px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-block: 8px; padding-inline: 16px 8px; border-radius: 16px; background: rgba(8, 17, 49, .96); color: #fff; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); transform: translateY(160%); transition: transform .25s ease; font-weight: 700; font-size: .95rem; line-height: 1.3; }
.sticky-cta.show { transform: none; }
.sticky-cta .store img { height: 42px; }
@media (min-width: 900px) { .sticky-cta { display: none; } }
@media (prefers-reduced-motion: reduce) { .sticky-cta { transition: none; } }

/* ---- exam guide and info pages */
.page-head { background: linear-gradient(160deg, #0b1d4f 0%, var(--night) 75%); color: #fff; padding-block: 38px 34px; }
.page-head h1 { color: #fff; }
.page-head .lead { margin-bottom: 14px; }
.toc { background: var(--card); border-radius: var(--radius); padding: 18px 20px 8px; box-shadow: var(--shadow); margin: 20px 0 8px; }
.toc h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
[dir="rtl"] .toc h2 { letter-spacing: 0; }
.toc ol { margin: 0 0 8px; }
.prose { padding-block: 10px 20px; }
.prose-sec { padding-top: 26px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.prose-sec:last-child { border-bottom: 0; }
.prose li { margin-bottom: .55em; }
.sources { font-size: .95rem; }
.tm-note { font-size: .85rem; color: var(--muted); }
.nf-list { list-style: none; padding: 26px 0; }
.nf-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* ---- quiz */
.qlist { list-style: none; padding: 0; margin: 26px 0 0; }
.q { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.q-sample { margin-top: 18px; }
.q-num { font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 10px; }
.q-img { display: flex; justify-content: center; padding: 14px; background: var(--soft); border-radius: 14px; margin-bottom: 14px; }
.q-img img { height: 132px; width: auto; }
.q-scene { padding: 0; background: none; overflow: hidden; }
.q-scene img { width: 100%; height: auto; display: block; border-radius: 14px; }
.q-text { font-weight: 700; font-size: 1.08rem; margin-bottom: .35em; text-align: start; }
.q-tr, .opt-tr, .expl-tr, .right-tr { color: var(--translation); }
.q-tr { margin-bottom: 1em; }
[dir="rtl"] .q-text, [dir="rtl"] .opt-nl, [dir="rtl"] .expl, [dir="rtl"] .right strong { text-align: left; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: start; cursor: default; }
.js .opt { cursor: pointer; }
.js .opt:hover:not([disabled]) { border-color: var(--primary); }
.opt[disabled] { opacity: 1; }
.opt-l { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--soft); font-weight: 800; font-size: .9rem; color: var(--primary); font-family: var(--font); }
.opt-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.opt-nl { font-weight: 600; }
.opt-tr { font-size: .95rem; }
.opt.is-right { border-color: var(--correct); background: var(--correct-bg); }
.opt.is-right .opt-l { background: var(--correct); color: #fff; }
.opt.is-wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.opt.is-wrong .opt-l { background: var(--wrong); color: #fff; }
.ans { margin-top: 14px; }
.ans summary { cursor: pointer; font-weight: 700; color: var(--link); padding: 6px 0; }
.js .ans summary { display: none; }
.ans-body { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.verdict { font-weight: 800; font-size: 1.05rem; }
.verdict.ok { color: var(--correct); }
.verdict.ko { color: var(--wrong); }
.right span:first-child { color: var(--muted); }
.right strong { display: block; }
.right-tr { display: block; }
.serious { display: inline-block; font-weight: 700; color: var(--serious); background: var(--wrong-bg); padding: 4px 10px; border-radius: 8px; font-size: .92rem; }
.expl { margin-bottom: .4em; }
.sign-i { height: 1.35em; width: auto; vertical-align: -.3em; }
.law { font-size: .9rem; color: var(--muted); }
.score-bar { position: sticky; bottom: 12px; z-index: 5; margin: 10px auto; width: max-content; max-width: 100%; padding: 10px 18px; border-radius: 999px; background: var(--night); color: #fff; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.result { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-align: center; margin: 18px 0; }
.result-score { unicode-bidi: plaintext; font-size: 2.2rem; font-weight: 800; color: var(--primary); margin-bottom: .2em; font-family: var(--font); }
@media (prefers-color-scheme: dark) { .result-score { color: var(--link); } }
.note { font-size: .9rem; color: var(--muted); margin-top: 18px; }

/* ---- footer */
.foot { background: var(--night); color: #c9d2ea; padding-block: 34px 40px; font-size: .92rem; }
.foot a { color: #fff; }
.foot-nav, .foot-langs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 16px; }
.foot-nav li, .foot-langs li { margin: 0; }
.foot-nav a { font-weight: 700; text-decoration: none; }
.foot-langs a { text-decoration: none; opacity: .85; }
.foot-langs a[aria-current="true"] { opacity: 1; text-decoration: underline; }
.disclaimer { color: #e5eaf8; }
.small { font-size: .85rem; }
.tm { opacity: .7; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .top, .foot, .cta-final, .hero-visual, .sticky-cta, .notice { display: none; } }
