:root {
  --bg: #f6f3ee;
  --paper: #ffffff;
  --ink: #1f2430;
  --muted: #5d6475;
  --line: #e2ddd4;
  --brand: #e2581c;       /* oranje */
  --brand-ink: #ffffff;
  --brand-soft: #fde9dd;
  --blue: #1f4e8c;
  --blue-soft: #e4ecf7;
  --ok: #1f7a4d;
  --ok-soft: #dff3e8;
  --warn: #9a6200;
  --warn-soft: #fff1d1;
  --bad: #b3261e;
  --bad-soft: #fbe3e1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.5;
}
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: -.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }

/* Top bar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar .logo { font-weight: 700; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.topbar .logo .dot { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; }
.topbar .spacer { flex: 1; }

/* Cards & panels */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.job-card {
  text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.job-card:hover, .job-card:focus-visible { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); outline: none; }
.job-card .emoji { font-size: 2rem; }
.job-card .title { font-weight: 700; font-size: 1.1rem; }
.job-card .company { color: var(--blue); font-weight: 700; }
.job-card .meta { color: var(--muted); font-size: .9rem; }

/* Forms */
label { font-weight: 700; display: block; margin-bottom: 4px; }
input[type=text], input[type=password], select, textarea {
  font: inherit; color: inherit; width: 100%;
  border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
.row { display: grid; gap: 14px; grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 10px; padding: 10px 18px;
  border: 2px solid transparent; background: var(--brand); color: var(--brand-ink);
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--ink); }
.btn.blue { background: var(--blue); }
.btn.small { padding: 6px 12px; font-size: .9rem; }

.alert { border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.alert.error { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--blue-soft); color: var(--blue); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

/* Hero */
.hero { display: grid; gap: 8px; margin: 12px 0 24px; }
.steps { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; padding: 0; list-style: none; }
.steps li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .95rem; }
.steps b { color: var(--brand); }

/* Test page */
.test-layout { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; padding: 16px; max-width: 1500px; margin: 0 auto; }
@media (max-width: 900px) { .test-layout { grid-template-columns: 1fr; } }
.vacature { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
@media (max-width: 900px) { .vacature { position: static; max-height: none; } }
.vacature .tag { display: inline-block; background: var(--brand-soft); color: var(--brand); font-weight: 700; border-radius: 6px; padding: 2px 8px; font-size: .85rem; }
.vacature h2 { margin-top: 8px; }
.vacature h3 { margin: 14px 0 4px; color: var(--blue); }
.vacature ul { margin: 0; padding-left: 20px; }
.vacature .addr { font-family: var(--mono); font-size: .85rem; background: var(--bg); border-radius: 8px; padding: 10px; white-space: pre-line; }

.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.tab { font: inherit; font-weight: 700; background: none; border: none; padding: 10px 14px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--brand); }
.tab .count { font-weight: 400; font-size: .85rem; color: var(--muted); margin-left: 4px; }

.editor textarea {
  min-height: 62vh; resize: vertical; font-size: 16px; line-height: 1.6;
  font-family: var(--font); white-space: pre-wrap;
}
.editor-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.wordcount { font-weight: 700; }
.wordcount.ok { color: var(--ok); }
.wordcount.low { color: var(--warn); }
.wordcount.high { color: var(--warn); }

.timer { font-family: var(--mono); font-weight: 700; font-size: 1.1rem; padding: 6px 12px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); }
.timer.warn { background: var(--warn-soft); color: var(--warn); }
.timer.over { background: var(--bad-soft); color: var(--bad); }

details.help { background: var(--blue-soft); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
details.help summary { cursor: pointer; font-weight: 700; color: var(--blue); }
details.help ul { margin: 8px 0; padding-left: 20px; }
details.help pre { background: #fff; border-radius: 8px; padding: 10px; font-size: .82rem; white-space: pre-wrap; font-family: var(--mono); }

/* Confirm bar */
.confirm { position: fixed; inset: 0; background: rgba(20,22,30,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.confirm .panel { max-width: 460px; width: 100%; }
.confirm .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* Result page */
.grade-hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
@media (max-width: 600px) { .grade-hero { grid-template-columns: 1fr; text-align: center; } }
.grade-circle {
  width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  font-size: 3rem; font-weight: 700; color: #fff; background: var(--ok);
}
.grade-circle.mid { background: #c27a00; }
.grade-circle.low { background: var(--bad); }
.grade-circle small { display: block; font-size: .9rem; font-weight: 400; margin-top: -10px; text-align: center; }

.group { margin-top: 18px; }
.group-head { display: flex; justify-content: space-between; align-items: baseline; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 10px; }
.bar > span { display: block; height: 100%; background: var(--ok); border-radius: 999px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checks li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start; padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.checks .icon { font-weight: 700; text-align: center; border-radius: 6px; }
.checks .full .icon { color: var(--ok); }
.checks .part .icon { color: var(--warn); }
.checks .zero .icon { color: var(--bad); }
.checks .why { color: var(--muted); font-size: .9rem; }
.checks .pts { font-family: var(--mono); font-size: .9rem; }

.fb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .fb-cols { grid-template-columns: 1fr; } }
.fb-good { border-left: 5px solid var(--ok); }
.fb-better { border-left: 5px solid var(--brand); }
.fb-cols ul { margin: 0; padding-left: 20px; }
.fb-cols li { margin-bottom: 6px; }

.example { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 10px; }
.example div { padding: 10px 14px; }
.example .old { background: var(--bad-soft); }
.example .new { background: var(--ok-soft); }
.example .lbl { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; display: block; color: var(--muted); }

.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--brand); animation: spin 1s linear infinite; margin: 10px auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }

pre.submitted { white-space: pre-wrap; font-family: var(--font); background: var(--bg); padding: 12px; border-radius: 10px; font-size: .95rem; }

/* Teacher */
table { width: 100%; border-collapse: collapse; background: var(--paper); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; cursor: pointer; user-select: none; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--bg); }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.pill.graded { background: var(--ok-soft); color: var(--ok); }
.pill.pending, .pill.grading { background: var(--warn-soft); color: var(--warn); }
.pill.error { background: var(--bad-soft); color: var(--bad); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.toolbar input[type=text], .toolbar select { width: auto; min-width: 160px; }
.toolbar input[type=checkbox] { width: 18px; height: 18px; margin: 0; }

.drawer { position: fixed; inset: 0; background: rgba(20,22,30,.45); z-index: 40; display: flex; justify-content: flex-end; }
.drawer .sheet { background: var(--bg); width: min(980px, 100%); height: 100%; overflow: auto; padding: 20px 16px 60px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }

@media print {
  .topbar, .no-print, .btn { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border: none; padding: 0; }
  .drawer { position: static; background: none; }
  .drawer .sheet { width: 100%; height: auto; overflow: visible; }
}
