/* LiveLink Academy — app-schermen (B3C). Zelfde vormtaal als de site (site/src/assets/site.css): mobiel-eerst, rustig,
   technisch en helder; hiërarchie uit typografie en witruimte; blauw is functioneel (links, actieve staat, volgende stap,
   voortgang). Bewust niet: verlopen, glas, pillen, decoratieve animatie, webfonts. Status nooit alleen met kleur. */

:root {
  /* Kleur — gelijk aan de designtokens van de site (test/b3c-frontend.test.mjs bewaakt dat) */
  --ink: #16181b;
  --text: #2b2e33;
  --muted: #5a5f66;
  --line: #e4e6e9;
  --line-strong: #c5c9ce;
  --surface: #f5f6f8;
  --surface-2: #eceef1;
  --bg: #ffffff;
  --blue: #072d78;
  --blue-pale: #eaf0f8;
  --on-blue: #ffffff;
  --navy: #0b1f4d;
  --ok: #1d6b4f;
  --ok-pale: #eef6f2;
  --warn: #8a4b0f;
  --warn-pale: #fbf3ec;
  --error: #a3261b;
  --error-pale: #fbeeed;
  --shadow-1: 0 1px 2px rgba(22, 24, 27, .05), 0 6px 16px rgba(22, 24, 27, .06);
  --radius-card: 8px;
  --radius: 4px;
  --dur: 200ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --s-1: .25rem;
  --s-2: .5rem;
  --s-3: .75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --fs-h1: 1.75rem;
  --fs-h2: 1.25rem;
  --fs-h3: 1.0625rem;
  --fs-body: 1rem;
  --fs-small: .875rem;
  --fs-label: .75rem;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, "Liberation Sans", sans-serif;
  --max: 64rem;
  --measure: 42rem;
  --header-h: 3.5rem;
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@media (min-width: 48rem) { :root { --fs-h1: 2rem; --fs-h2: 1.375rem; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; font-size: var(--fs-body); overflow-wrap: anywhere; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3 { color: var(--ink); line-height: 1.25; margin: 0 0 var(--s-3); letter-spacing: -.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); margin-top: var(--s-6); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 var(--s-3); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: var(--s-3); top: -3rem; background: var(--blue); color: var(--on-blue); padding: var(--s-2) var(--s-3); border-radius: var(--radius); z-index: 50; }
.skip-link:focus { top: var(--s-2); }

/* ── kop ─────────────────────────────────────────────────────────────────────────────────────────────────────── */
.app-header { background: var(--bg); border-bottom: 1px solid var(--line); }
.app-header .row { max-width: var(--max); margin: 0 auto; padding: 0 var(--s-4); display: flex; align-items: center; gap: var(--s-3); min-height: var(--header-h); flex-wrap: wrap; }
.app-name { display: inline-flex; align-items: center; gap: .45em; color: var(--ink); text-decoration: none; font-size: 1.0625rem; min-height: 44px; margin-right: auto; }
.app-name svg { width: 24px; height: 24px; flex: none; }
.app-name strong { font-weight: 700; }
.app-name span { color: var(--muted); }
.app-nav { display: flex; gap: var(--s-1); flex-wrap: wrap; align-items: center; }
.app-nav a, .app-nav button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-3); color: var(--text); text-decoration: none; border-radius: var(--radius); font: inherit; font-size: var(--fs-small); background: none; border: 0; cursor: pointer; }
.app-nav a:hover, .app-nav button:hover { background: var(--surface); }
.app-nav a[aria-current="page"] { color: var(--blue); font-weight: 600; box-shadow: inset 0 -2px 0 var(--blue); border-radius: 0; }

main { flex: 1; width: 100%; max-width: var(--max); margin: 0 auto; padding: var(--s-5) var(--s-4) var(--s-7); }
.narrow { max-width: 30rem; margin: 0 auto; }
.lead { font-size: 1.0625rem; color: var(--muted); max-width: var(--measure); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.app-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: var(--fs-small); }
.app-footer .row { max-width: var(--max); margin: 0 auto; padding: var(--s-4); }

/* ── knoppen ─────────────────────────────────────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 44px; padding: 0 var(--s-4); border-radius: var(--radius); border: 1px solid var(--blue); background: var(--blue); color: var(--on-blue); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--navy); border-color: var(--navy); }
.btn.secondary { background: var(--bg); color: var(--blue); }
.btn.secondary:hover { background: var(--blue-pale); }
.btn.danger { background: var(--bg); color: var(--error); border-color: var(--error); }
.btn.danger:hover { background: var(--error-pale); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }

/* ── formulieren ─────────────────────────────────────────────────────────────────────────────────────────────── */
.field { margin: 0 0 var(--s-4); }
.field label, .field legend { display: block; font-weight: 600; color: var(--ink); margin-bottom: var(--s-1); }
.field .hint { display: block; color: var(--muted); font-size: var(--fs-small); margin-bottom: var(--s-1); }
.field input[type="email"], .field input[type="text"], .field input[type="search"], .field select {
  width: 100%; min-height: 44px; padding: var(--s-2) var(--s-3); font: inherit; color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--bg);
}
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field [aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.field .error { display: block; color: var(--error); font-size: var(--fs-small); margin-top: var(--s-1); font-weight: 600; }
.field .error::before { content: "⚠ "; }
fieldset.field { border: 0; padding: 0; }
.check { display: flex; gap: var(--s-2); align-items: flex-start; padding: var(--s-2) 0; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: none; }
.check label { font-weight: 400; margin: 0; }
.check .muted { display: block; font-size: var(--fs-small); }
.filters { display: grid; gap: var(--s-3); grid-template-columns: 1fr; align-items: end; margin: var(--s-5) 0 var(--s-4); }
@media (min-width: 40rem) { .filters { grid-template-columns: 2fr 1fr 1fr; } .filters .field { margin: 0; } }

/* ── meldingen (icoon + tekst, nooit alleen kleur) ──────────────────────────────────────────────────────────── */
.notice { border: 1px solid var(--line-strong); border-left-width: 4px; border-radius: var(--radius); padding: var(--s-3) var(--s-4); margin: 0 0 var(--s-4); background: var(--surface); }
.notice > :last-child { margin-bottom: 0; }
.notice strong { display: block; margin-bottom: var(--s-1); }
.notice.info { border-left-color: var(--blue); background: var(--blue-pale); }
.notice.success { border-left-color: var(--ok); background: var(--ok-pale); }
.notice.warn { border-left-color: var(--warn); background: var(--warn-pale); }
.notice.error { border-left-color: var(--error); background: var(--error-pale); }
.notice.info strong::before { content: "ℹ "; }
.notice.success strong::before { content: "✓ "; }
.notice.warn strong::before { content: "! "; }
.notice.error strong::before { content: "⚠ "; }

/* ── kaarten en voortgang ────────────────────────────────────────────────────────────────────────────────────── */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
@media (min-width: 48rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card { border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--s-4); background: var(--bg); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: var(--s-2); }
.card h2, .card h3 { margin: 0; font-size: var(--fs-h3); }
.card h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover, .card h3 a:hover { color: var(--blue); text-decoration: underline; }
.card .summary { color: var(--muted); font-size: var(--fs-small); margin: 0; }
.card .meta { font-size: var(--fs-small); color: var(--muted); margin: 0; }
.card .btn-row { margin-top: auto; padding-top: var(--s-2); }
.progress { display: grid; gap: var(--s-1); }
.progress-label { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-small); }
.progress progress { appearance: none; -webkit-appearance: none; width: 100%; height: .5rem; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--blue); overflow: hidden; }
.progress progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.progress progress::-webkit-progress-value { background: var(--blue); border-radius: 999px; }
.progress progress::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
.progress.done progress { color: var(--ok); }
.progress.done progress::-webkit-progress-value { background: var(--ok); }
.progress.done progress::-moz-progress-bar { background: var(--ok); }
.status { display: inline-flex; align-items: center; gap: .35em; font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.status::before { content: "○"; font-size: .9rem; line-height: 1; }
.status.in_progress { color: var(--blue); }
.status.in_progress::before { content: "◐"; }
.status.completed { color: var(--ok); }
.status.completed::before { content: "●"; }
.status.new { color: var(--warn); }
.status.new::before { content: "✦"; }
.status.unavailable { color: var(--muted); }
.status.unavailable::before { content: "–"; }

/* ── lessenlijst ─────────────────────────────────────────────────────────────────────────────────────────────── */
.lessons { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); counter-reset: les; }
.lessons li { border-bottom: 1px solid var(--line); padding: var(--s-3) 0; display: grid; grid-template-columns: 2rem 1fr; gap: var(--s-1) var(--s-3); align-items: start; counter-increment: les; }
.lessons li::before { content: counter(les); grid-row: span 2; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-small); font-weight: 600; background: var(--surface); color: var(--muted); }
.lessons li.completed::before { content: "✓"; background: var(--ok-pale); color: var(--ok); }
.lessons li.current::before { background: var(--blue); color: var(--on-blue); }
.lessons a { font-weight: 600; }
.lessons .status { grid-column: 2; }

/* ── tabellen (beheer); smal scherm = gestapeld, geen horizontaal scrollen ────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table th, .table td { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; font-size: var(--fs-label); text-transform: uppercase; letter-spacing: .04em; }
.table td a { font-weight: 600; }
@media (max-width: 47.99rem) {
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border: 1px solid var(--line); border-radius: var(--radius-card); margin-bottom: var(--s-3); padding: var(--s-2) 0; }
  .table td { border: 0; padding: var(--s-1) var(--s-3); }
  .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
}
.dl { display: grid; grid-template-columns: 1fr; gap: var(--s-1) var(--s-4); margin: 0 0 var(--s-4); }
.dl dt { color: var(--muted); font-size: var(--fs-small); }
.dl dd { margin: 0 0 var(--s-2); color: var(--ink); }
@media (min-width: 40rem) { .dl { grid-template-columns: 12rem 1fr; } .dl dd { margin: 0; } }
.panel { border: 1px solid var(--line); border-radius: var(--radius-card); padding: var(--s-4); margin: 0 0 var(--s-4); }
.panel h2 { margin-top: 0; }
#overzicht { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); }
#overzicht > * { margin: 0; }
#overzicht .progress, #overzicht .notice { align-self: stretch; }
#overzicht .btn-row { margin-top: var(--s-2); }
.inline-list { list-style: none; margin: 0; padding: 0; }
.inline-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-2); padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.breadcrumb { font-size: var(--fs-small); margin-bottom: var(--s-3); }
.loading { color: var(--muted); }
.loading::before { content: "… "; }
.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius-card); padding: var(--s-5); text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .btn, .app-nav a { transition: background-color var(--dur) var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) { .progress progress { border: 1px solid CanvasText; } }
