@font-face {
  font-family: 'Inter';
  src: url('fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-0: #0a0d0a;
  --bg-1: #11161a;
  --bg-2: #1a2128;
  --text: #f1f5f0;
  --text-muted: #a8b3a8;
  --accent: #9dd31e;
  --accent-soft: #c2eb5c;
  --accent-glow: rgba(157, 211, 30, 0.35);
  --warning: #ffb547;
  --danger: #ff7a6b;
  --ok: #4fd67a;
  --ok-bg: rgba(79, 214, 122, 0.10);
  --bad: #ff6b5e;
  --bad-bg: rgba(255, 107, 94, 0.10);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --radius: 14px;
  --radius-lg: 22px;
  --sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Space Grotesk', system-ui, sans-serif;
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(157, 211, 30, 0.08), transparent 60%), var(--bg-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
a:hover { color: var(--accent-soft); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}
.brand-logo { height: 38px; width: auto; display: block; }
.topbar-title { font-family: var(--serif); font-weight: 600; color: var(--text-muted); font-size: 15px; }

.wrap { width: 100%; max-width: 920px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) clamp(16px, 4vw, 32px) 64px; flex: 1; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.1; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 54px); letter-spacing: -1.2px; font-weight: 700; margin: 18px 0 16px; }
h2 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.4px; margin-bottom: 10px; }
h3 { font-size: 18px; }
.lead { font-size: clamp(16px, 2vw, 19px); color: var(--text-muted); margin: 0 0 24px; }
.small { font-size: 14px; color: var(--text-muted); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(157, 211, 30, 0.10); color: var(--accent);
  padding: 8px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  border: 1px solid rgba(157, 211, 30, 0.25);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  font: inherit; font-weight: 600; font-size: 16px;
  cursor: pointer; transition: all 0.2s ease;
  border: 1px solid transparent; text-align: center; text-decoration: none;
}
.btn-primary { background: var(--accent); color: #0a0d0a; box-shadow: 0 12px 30px var(--accent-glow); }
.btn-primary:hover { background: var(--accent-soft); color: #0a0d0a; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: wait; transform: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .scale input:focus-visible + span {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.card, .notice {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px);
}
.notice { margin-top: 28px; }
.notice h2 { font-size: 18px; }
/* Progress */
.progress { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: var(--p, 0%); background: var(--accent); transition: width 0.3s ease; }
.step-meta { color: var(--text-muted); font-size: 14px; margin: 10px 0 18px; }
.form-error { color: var(--warning); font-weight: 600; margin: 12px 0 0; }
/* Result */
.result-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 4vw, 40px); align-items: center; margin: 20px 0 32px; }
.score-ring {
  width: 168px; height: 168px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--accent) calc(var(--pct, 0) * 1%), var(--bg-2) 0);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--bg-0); }
.score-value, .score-label { position: relative; }
.score-value { font-family: var(--serif); font-size: 44px; font-weight: 700; line-height: 1; }
.score-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 6px; }
.result-title { margin: 0 0 10px; font-size: clamp(30px, 4.5vw, 46px); }
.result-head .lead { margin-bottom: 10px; }
.hebel { margin: 0; font-weight: 600; color: var(--accent); }
.dim-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.dim-result { background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.dim-result.is-weakest { border-color: var(--accent); }
.dim-result-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.dim-result h3 { font-size: 16px; }
.dim-result .val { font-family: var(--serif); font-weight: 700; color: var(--accent); white-space: nowrap; }
.bar { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); border-radius: 999px; }
.dim-result p { margin: 0; font-size: 14px; color: var(--text-muted); }
.dim-result .band { font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); }
.footer { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; padding: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-muted); }
.footer a { color: var(--text-muted); }

/* ── KI-fiziert Wissenstest ─────────────────────────── */
.loading { color: var(--text-muted); }

/* Start: Anzahl wählen */
.choose-title { margin-top: 8px; }
.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 8px; }
.count {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 22px 12px 18px; border-radius: var(--radius-lg);
  background: var(--bg-1); border: 1px solid var(--line-strong); color: var(--text);
  font: inherit; cursor: pointer; transition: all 0.2s ease;
}
.count b { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--accent); }
.count span { font-weight: 600; }
.count small { color: var(--text-muted); font-size: 13px; text-align: center; margin-top: 6px; }
.count:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 30px var(--accent-glow); }
.count:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.count:disabled { opacity: 0.5; cursor: wait; transform: none; box-shadow: none; }

/* Frage */
.question { border: 0; margin: 0; padding: 0; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--text-muted); }
.chip-kat { background: rgba(157, 211, 30, 0.10); border-color: rgba(157, 211, 30, 0.25); color: var(--accent); }
.chip-hint { background: var(--bg-2); color: var(--text); }
.chip-hint::before { content: "●"; margin-right: 8px; font-size: 10px; color: var(--accent); }
.chip-hint.is-multi::before { content: "●●"; letter-spacing: -2px; margin-right: 10px; }
.question legend { padding: 0; float: left; width: 100%; font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 2.6vw, 25px); line-height: 1.3; margin-bottom: 20px; }
.options { clear: both; display: grid; gap: 10px; }
.option {
  position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: start;
  padding: 14px 16px; border-radius: var(--radius); cursor: pointer;
  background: var(--bg-1); border: 2px solid var(--line-strong); transition: border-color 0.15s ease, background 0.15s ease;
}
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option .marker {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--line-strong); border-radius: 8px; font-family: var(--serif); font-weight: 700; font-size: 14px; color: var(--text-muted);
}
.option input[type="radio"] ~ .marker { border-radius: 50%; }
.option-text { padding-top: 3px; }
.option-badge { grid-column: 2; font-size: 13px; font-weight: 700; }
.option-badge:empty { display: none; }
.option:not(.is-locked):hover { border-color: var(--accent); }
.option input:focus-visible ~ .marker { outline: 2px solid var(--accent); outline-offset: 2px; }
.option input:checked ~ .marker { background: var(--accent); border-color: var(--accent); color: #0a0d0a; }
.option:has(input:checked):not(.is-locked) { border-color: var(--accent); background: rgba(157, 211, 30, 0.08); }
.option.is-locked { cursor: default; }
.option.is-locked:not(.is-correct):not(.is-wrong) { opacity: 0.6; }
.option.is-correct { border-color: var(--ok); background: var(--ok-bg); }
.option.is-correct .option-badge { color: var(--ok); }
.option.is-correct input:checked ~ .marker { background: var(--ok); border-color: var(--ok); }
.option.is-missed { border-style: dashed; }
.option.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.option.is-wrong .option-badge { color: var(--bad); }
.option.is-wrong input:checked ~ .marker { background: var(--bad); border-color: var(--bad); color: #0a0d0a; }

.feedback { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--bg-1); }
.feedback.is-ok { border-color: var(--ok); background: var(--ok-bg); }
.feedback.is-bad { border-color: var(--bad); background: var(--bad-bg); }
.feedback-title { margin: 0 0 6px; font-family: var(--serif); font-weight: 700; font-size: 18px; }
.feedback.is-ok .feedback-title { color: var(--ok); }
.feedback.is-bad .feedback-title { color: var(--bad); }
.feedback-text { margin: 0; color: var(--text-muted); }
.feedback-text::before { content: "Erläuterung: "; font-weight: 600; color: var(--text); }

/* Ergebnis */
.badge { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
.badge.is-ok { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.badge.is-bad { background: rgba(255, 181, 71, 0.12); color: var(--warning); border: 1px solid var(--warning); }
.score-ring.is-bad { background: conic-gradient(var(--warning) calc(var(--pct, 0) * 1%), var(--bg-2) 0); }
.card h2 { font-size: 20px; margin-bottom: 16px; }
.dim-results { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.dim-result.is-weak { border-color: rgba(255, 181, 71, 0.5); }
.dim-result.is-weak .val { color: var(--warning); }
.dim-result.is-weak .bar i { background: var(--warning); }

@media (max-width: 720px) {
  .counts { grid-template-columns: repeat(2, 1fr); }
  .result-head { grid-template-columns: 1fr; justify-items: start; }
  .nav .btn { flex: 1; }
  .nav > span { display: none; }
}

/* Form fields */
.field { margin-bottom: 22px; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 8px; }
.field .hint { font-size: 14px; color: var(--text-muted); margin: -4px 0 8px; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: 12px; padding: 12px 14px;
}
textarea { min-height: 120px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }

.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-1); cursor: pointer; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.check.is-disabled { opacity: 0.45; cursor: not-allowed; }
.check.consent { margin: 4px 0 6px; font-size: 14px; color: var(--text-muted); }
.check.consent a { color: var(--accent); }

/* ── KI-fiziert Abschlussprüfung ─────────────────────── */
.rules ul { color: var(--text); }
.login { margin-top: 24px; max-width: 620px; }
.brand { display: inline-flex; }

/* Zeitleiste */
.exam-bar { position: sticky; top: 0; z-index: 10; background: rgba(10, 13, 10, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.exam-bar-inner { max-width: 920px; margin: 0 auto; padding: 10px clamp(16px, 4vw, 32px); display: flex; align-items: center; gap: 16px; }
.exam-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-count { color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.exam-count b { color: var(--text); }
.timer { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg-1); white-space: nowrap; }
.timer-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; }
.timer b { font-family: var(--serif); font-size: 24px; font-variant-numeric: tabular-nums; color: var(--accent); line-height: 1.1; }
.timer.is-warn { border-color: var(--warning); }
.timer.is-warn b { color: var(--warning); }
.timer.is-crit { border-color: var(--bad); background: var(--bad-bg); animation: puls 1s ease-in-out infinite; }
.timer.is-crit b { color: var(--bad); }
@keyframes puls { 50% { box-shadow: 0 0 0 6px rgba(255, 107, 94, 0.15); } }
.exam-bar .progress { border-radius: 0; height: 4px; }

/* Fragen-Navigator */
.navigator { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; justify-content: space-between; margin-bottom: 22px; }
.navigator .nav-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 38px)); flex: 1 1 300px; max-width: 434px; }
.navigator .nav-btn { width: auto; aspect-ratio: 1; height: auto; }
.nav-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.nav-btn {
  width: 38px; height: 38px; border-radius: 10px; font: inherit; font-weight: 700; font-size: 14px;
  background: var(--bg-1); color: var(--text-muted); border: 1px solid var(--line-strong); cursor: pointer;
}
.nav-btn:hover { border-color: var(--accent); color: var(--text); }
.nav-btn.is-done { background: rgba(157, 211, 30, 0.16); border-color: rgba(157, 211, 30, 0.5); color: var(--accent); }
.nav-btn.is-current { outline: 2px solid var(--accent); outline-offset: 2px; color: var(--text); }
.btn-small { padding: 9px 18px; font-size: 14px; }
.btn:disabled { cursor: default; }

.step-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.save-state { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.save-state.is-ok { color: var(--ok); }
.save-state.is-bad { color: var(--warning); }

#screen-abgabe .notice { margin-top: 8px; }
.vorlaeufig { border-color: rgba(255, 181, 71, 0.4); margin: 0 0 24px; }
.vorlaeufig p { margin: 6px 0 0; color: var(--text-muted); }
.schliessen { margin-top: 24px; }

@media (max-width: 720px) {
  .exam-bar-inner { gap: 10px; }
  .exam-name { display: none; }
  .exam-count { flex: 1; }
  .timer-label { display: none; }
  .nav-btn { width: 34px; height: 34px; }
}
#form-frage { scroll-margin-top: 90px; }
