/* Online-Test zum Workbook. Mobil zuerst, Systemschriften, keine externen Ressourcen. */

:root {
  --dunkelblau: #1F3A5F;
  --mittelblau: #5B7BA3;
  --hellblau: #DCE5F0;
  --hellblau-2: #EEF3F9;
  --grau: #6B7280;
  --linie: #C9D3E0;
  --orange: #C8742B;
  --orange-text: #9A5215;
  --orange-flaeche: #FBF1E7;
  --gruen: #3E7D5A;
  --gruen-flaeche: #E8F2EC;
  --weiss: #FFFFFF;
  --text: #1C2733;
  --radius: 8px;
  --fokus: 0 0 0 3px var(--weiss), 0 0 0 6px var(--dunkelblau);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--weiss);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

[hidden] { display: none !important; }

a { color: var(--dunkelblau); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: 4px; }

.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;
}

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--dunkelblau); color: var(--weiss); padding: 10px 16px; border-radius: var(--radius);
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 16px; }

/* Kopf */
.kopf { background: var(--dunkelblau); color: var(--weiss); }
.kopf .wrap { padding-top: 14px; padding-bottom: 14px; }
.kopf a { color: var(--weiss); text-decoration: none; display: inline-block; }
.kopf a:focus-visible { box-shadow: 0 0 0 3px var(--dunkelblau), 0 0 0 5px var(--weiss); }
.kopf-titel { display: block; font-weight: 700; font-size: 1.0625rem; line-height: 1.3; }
.kopf-unter { display: block; font-size: 0.9375rem; color: var(--hellblau); }

.hero { background: var(--dunkelblau); color: var(--weiss); padding: 40px 0 40px; }
.hero h1 { color: var(--weiss); font-size: 1.875rem; line-height: 1.2; margin: 0 0 6px; letter-spacing: -0.01em; }
.hero p { margin: 0; color: var(--hellblau); font-size: 1.125rem; }

main { flex: 1 0 auto; padding: 32px 0 56px; }
main:focus { outline: none; }

h1, h2, h3 { color: var(--dunkelblau); line-height: 1.25; }
h1 { font-size: 1.625rem; margin: 0 0 16px; }
h2 { font-size: 1.3125rem; margin: 40px 0 12px; }
h3 { font-size: 1.0625rem; margin: 24px 0 6px; }
h1[tabindex="-1"]:focus { outline: none; box-shadow: none; }
p { margin: 0 0 14px; }

.lead { font-size: 1.1875rem; }

/* Ablauf */
.schritte { list-style: none; counter-reset: schritt; padding: 0; margin: 0 0 20px; }
.schritte li { counter-increment: schritt; position: relative; padding: 0 0 18px 48px; }
.schritte li::before {
  content: counter(schritt); position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--hellblau); color: var(--dunkelblau);
  font-weight: 700; display: flex; align-items: center; justify-content: center;
}

.punkte { padding-left: 1.2em; margin: 0 0 14px; }
.punkte li { margin-bottom: 10px; }

.karte { background: var(--hellblau-2); border-radius: var(--radius); padding: 20px; margin: 24px 0; }
.karte > :last-child { margin-bottom: 0; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--linie); }
.faq details:first-of-type { border-top: 1px solid var(--linie); }
.faq summary {
  cursor: pointer; list-style: none; padding: 14px 32px 14px 0; position: relative;
  font-weight: 600; color: var(--dunkelblau);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--mittelblau); border-bottom: 2px solid var(--mittelblau);
  transform: translateY(-70%) rotate(45deg);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details p { padding-bottom: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 12px 24px; border: 2px solid var(--dunkelblau); border-radius: var(--radius);
  background: var(--dunkelblau); color: var(--weiss);
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: #172C48; border-color: #172C48; }
.btn-zweit { background: var(--weiss); color: var(--dunkelblau); }
.btn-zweit:hover { background: var(--hellblau-2); color: var(--dunkelblau); }
.btn-gruen { background: var(--gruen); border-color: var(--gruen); }
.btn-gruen:hover { background: #33694B; border-color: #33694B; }
.btn:disabled { background: var(--hellblau); border-color: var(--hellblau); color: var(--grau); cursor: not-allowed; }
.btn-link {
  background: none; border: 0; padding: 10px 4px; min-height: 44px;
  color: var(--dunkelblau); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.btn-block { width: 100%; }
.aktion { margin: 28px 0; }

/* Formulare */
label, .label { display: block; font-weight: 600; color: var(--dunkelblau); margin-bottom: 6px; }
input[type="text"] {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 2px solid var(--mittelblau); border-radius: var(--radius);
  font: inherit; color: var(--text); background: var(--weiss);
}
input[type="text"]:focus-visible { border-color: var(--dunkelblau); }
input[aria-invalid="true"] { border-color: var(--orange); }
.feld { margin-bottom: 20px; }
.feldhinweis { font-size: 0.9375rem; color: var(--grau); margin: 6px 0 0; }
.feldfehler { margin: 8px 0 0; color: var(--orange-text); font-weight: 600; padding-left: 12px; border-left: 4px solid var(--orange); }
.feldfehler:empty { display: none; }

.meldung { border-radius: var(--radius); padding: 14px 16px; margin: 0 0 24px; border-left: 4px solid var(--mittelblau); background: var(--hellblau-2); }
.meldung-warnung { border-left-color: var(--orange); background: var(--orange-flaeche); }
.meldung:empty { display: none; }
.klein { font-size: 0.9375rem; color: var(--grau); }

/* Test: Fortschritt */
.fortschritt { margin-bottom: 20px; }
.fortschritt h1 { font-size: 1rem; font-weight: 600; color: var(--grau); margin: 0 0 8px; }
progress {
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--hellblau); overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--hellblau); border-radius: 4px; }
progress::-webkit-progress-value { background: var(--dunkelblau); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--dunkelblau); border-radius: 4px; }

/* Test: Frage und Antworten */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend.frage { font-size: 1.25rem; font-weight: 700; color: var(--dunkelblau); line-height: 1.35; margin-bottom: 18px; padding: 0; }
.optionen { display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; margin: 0;
  min-height: 56px; padding: 14px 16px;
  border: 2px solid var(--linie); border-radius: var(--radius); background: var(--weiss);
  font-weight: 400; color: var(--text); cursor: pointer;
}
.option:hover { border-color: var(--mittelblau); background: var(--hellblau-2); }
.option input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--dunkelblau); cursor: pointer; }
.option input:focus-visible { box-shadow: none; }
.option:focus-within { box-shadow: var(--fokus); }
.option.gewaehlt, .option:has(input:checked) { border-color: var(--dunkelblau); background: var(--hellblau); }

.nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.nav-einzeln, .nav-stapel { grid-template-columns: 1fr; }
.meldung.aktion { margin: 20px 0 16px; }
.unter-nav { text-align: center; margin-top: 8px; }

/* Übersicht */
.raster { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.raster button {
  width: 100%; min-height: 48px; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer;
  border: 2px solid var(--dunkelblau); background: var(--hellblau); color: var(--dunkelblau);
}
.raster button.offen { background: var(--weiss); border: 2px dashed var(--orange); color: var(--orange-text); }
.raster button:hover { background: var(--hellblau-2); }
.legende { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 0.9375rem; color: var(--grau); margin: 0 0 8px; padding: 0; list-style: none; }
.legende span { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: -3px; margin-right: 6px; }
.leg-ja { background: var(--hellblau); border: 2px solid var(--dunkelblau); }
.leg-nein { background: var(--weiss); border: 2px dashed var(--orange); }

/* Ergebnis */
.ergebnis { border-radius: var(--radius); padding: 24px 20px; margin-bottom: 28px; border-top: 6px solid var(--orange); background: var(--orange-flaeche); }
.ergebnis.bestanden { border-top-color: var(--gruen); background: var(--gruen-flaeche); }
.ergebnis h1 { margin-bottom: 4px; }
.ergebnis.bestanden h1 { color: var(--gruen); }
.ergebnis-zahl { font-size: 3rem; font-weight: 700; line-height: 1.1; color: var(--dunkelblau); margin: 8px 0 4px; }
.ergebnis-zahl small { font-size: 1.25rem; font-weight: 600; color: var(--grau); }
.ergebnis > :last-child { margin-bottom: 0; }

.falsch-liste { list-style: none; padding: 0; margin: 0; }
.falsch-liste > li { border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.falsch-liste h3 { margin: 0 0 12px; font-size: 1.0625rem; }
.falsch-liste .nr { display: block; font-size: 0.875rem; font-weight: 600; color: var(--grau); margin-bottom: 2px; }
.falsch-liste dl { margin: 0; }
.falsch-liste dt { font-size: 0.875rem; font-weight: 600; color: var(--grau); margin-top: 10px; }
.falsch-liste dd { margin: 2px 0 0; padding-left: 12px; border-left: 4px solid var(--linie); }
.falsch-liste dd.deine { border-left-color: var(--orange); }
.falsch-liste dd.richtige { border-left-color: var(--gruen); font-weight: 600; }
.falsch-liste .kapitel { margin: 12px 0 0; font-size: 0.9375rem; color: var(--dunkelblau); font-weight: 600; }

/* Fuß */
.fuss { border-top: 1px solid var(--linie); background: var(--hellblau-2); font-size: 0.9375rem; color: var(--grau); }
.fuss .wrap { padding-top: 20px; padding-bottom: 24px; }
.fuss nav a { display: inline-block; padding: 6px 0; margin-right: 18px; color: var(--dunkelblau); }
.fuss p { margin: 6px 0 0; }

/* Platzhalter Impressum und Datenschutz */
.platzhalter { border: 3px dashed var(--orange); background: var(--orange-flaeche); border-radius: var(--radius); padding: 20px; }
.platzhalter strong { color: var(--orange-text); }

@media (min-width: 40rem) {
  .hero { padding: 56px 0 56px; }
  .hero h1 { font-size: 2.375rem; }
  h1 { font-size: 1.875rem; }
  .raster { grid-template-columns: repeat(10, 1fr); }
  .nav { grid-template-columns: auto auto; justify-content: space-between; }
  .nav .btn { min-width: 10rem; }
  .ergebnis { padding: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  .kopf, .fuss, .nav, .aktion, .skip { display: none; }
}
