/* ==========================================================================
   FF Schulungsplattform
   Mobil zuerst (die meisten oeffnen die Plattform am Handy aus der Mail),
   keine externen Schriften oder CDNs.
   ========================================================================== */

:root {
  --grund:          #f3f4f6;
  --flaeche:        #ffffff;
  --rand:           #d9dce1;
  --text:           #16181d;
  --text-leise:     #5b6472;
  --rot:            #b5121b;
  --rot-dunkel:     #8f0e15;
  --rot-flaeche:    #fde8e9;
  --ok:             #15803d;
  --ok-flaeche:     #dcfce7;
  --warn:           #a15c07;
  --warn-flaeche:   #fef3c7;
  --info-flaeche:   #e0ecff;
  --radius:         8px;
  --schatten:       0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --schrift:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--grund); color: var(--text); font-family: var(--schrift); font-size: 16px; line-height: 1.5; }
h1 { font-size: 1.45rem; margin: 0 0 .5rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: 0 0 .7rem; }
a { color: var(--rot); }
a:hover { color: var(--rot-dunkel); }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.leise { color: var(--text-leise); }
.klein { font-size: .875rem; }
.sr-nur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

/* ---------------------------------------------------------------- Kopf */
.kopf { background: var(--rot); color: #fff; }
.kopf-inhalt { max-width: 1200px; margin: 0 auto; padding: .6rem 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.marke { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; font-weight: 700; }
.marke:hover { color: #fff; }
.marke img { height: 32px; width: auto; background: #fff; border-radius: 4px; padding: 2px; }
.marke-symbol { width: 32px; height: 32px; border-radius: 6px; background: #fff; color: var(--rot); display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.navigation { display: flex; flex-wrap: wrap; gap: .25rem; flex: 1 1 auto; }
.navigation a { color: #fff; text-decoration: none; padding: .35rem .6rem; border-radius: 6px; font-size: .95rem; }
.navigation a:hover, .navigation a.aktiv { background: rgba(255,255,255,.18); }
.kopf-benutzer { display: flex; align-items: center; gap: .5rem; font-size: .9rem; margin-left: auto; }
.kopf-benutzer a { color: #fff; }
.kopf-benutzer .knopf { background: transparent; border-color: rgba(255,255,255,.6); color: #fff; padding: .3rem .7rem; }

/* --------------------------------------------------------------- Inhalt */
.inhalt { max-width: 1200px; margin: 0 auto; padding: 1rem; }
.schmal { max-width: 720px; }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: var(--radius); box-shadow: var(--schatten); padding: 1rem; margin-bottom: 1rem; }
.karte > h2:first-child, .karte > h3:first-child { margin-top: 0; }
.zeile { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.zeile-zwischen { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; }
.raster { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 800px) { .raster-2 { grid-template-columns: 1fr 1fr; } .raster-3 { grid-template-columns: repeat(3, 1fr); } }
.fuss { text-align: center; color: var(--text-leise); font-size: .85rem; padding: 1.5rem 1rem; }
.fuss a { color: var(--text-leise); }

/* ---------------------------------------------------------- Meldungen */
.meldungen { display: grid; gap: .5rem; margin-bottom: 1rem; }
.meldung { padding: .7rem .9rem; border-radius: var(--radius); border: 1px solid transparent; }
.meldung-erfolg { background: var(--ok-flaeche); border-color: #86efac; }
.meldung-fehler { background: var(--rot-flaeche); border-color: #f5a3a7; }
.meldung-hinweis { background: var(--warn-flaeche); border-color: #fcd34d; }
.hinweis { background: var(--info-flaeche); border-radius: var(--radius); padding: .7rem .9rem; margin: .5rem 0 1rem; }
.warnung { background: var(--warn-flaeche); border-radius: var(--radius); padding: .7rem .9rem; margin: .5rem 0 1rem; }

/* ------------------------------------------------------------- Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--rot); background: var(--rot); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.knopf:hover { background: var(--rot-dunkel); color: #fff; }
.knopf[disabled], .knopf.deaktiviert { opacity: .45; cursor: not-allowed; }
.knopf-zweit { background: #fff; color: var(--rot); }
.knopf-zweit:hover { background: var(--rot-flaeche); color: var(--rot-dunkel); }
.knopf-schlicht { background: #fff; color: var(--text); border-color: var(--rand); font-weight: 500; }
.knopf-schlicht:hover { background: var(--grund); color: var(--text); }
.knopf-klein { min-height: 34px; padding: .3rem .7rem; font-size: .9rem; }
.knopf-breit { width: 100%; }
form.inline { display: inline; }

/* ------------------------------------------------------------ Formulare */
.feld { margin-bottom: .9rem; }
.feld label, .feld .label { display: block; font-weight: 600; margin-bottom: .25rem; }
.feld .hilfe { font-size: .85rem; color: var(--text-leise); margin-top: .2rem; }
.feld .fehlertext { font-size: .85rem; color: var(--rot); margin-top: .2rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=file], select, textarea {
  width: 100%; font: inherit; padding: .55rem .65rem; border: 1px solid var(--rand); border-radius: 6px; background: #fff; min-height: 44px; }
textarea { min-height: 6rem; resize: vertical; }
.feld-fehler input, .feld-fehler select, .feld-fehler textarea { border-color: var(--rot); }
.auswahl { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem 0; cursor: pointer; font-weight: 400; }
.auswahl input { width: 1.25rem; height: 1.25rem; margin-top: .15rem; flex: 0 0 auto; accent-color: var(--rot); }
.code-eingabe { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }

/* -------------------------------------------------------------- Tabellen */
.tabelle-huelle { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { font-size: .85rem; color: var(--text-leise); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; }
.matrix th, .matrix td { text-align: center; white-space: nowrap; }
.matrix th:first-child, .matrix td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }

/* ---------------------------------------------------------------- Marken */
.marke-status { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eceef1; color: var(--text); white-space: nowrap; }
.st-offen { background: #e0ecff; color: #1e3a8a; }
.st-bestaetigt { background: var(--warn-flaeche); color: #7c4a03; }
.st-bestanden { background: var(--ok-flaeche); color: #14532d; }
.st-gesperrt, .st-ueberfaellig { background: var(--rot-flaeche); color: var(--rot-dunkel); }
.st-zurueckgezogen, .st-archiviert, .st-entwurf { background: #eceef1; color: var(--text-leise); }
.st-aktiv { background: var(--ok-flaeche); color: #14532d; }

/* ------------------------------------------------------------- Teilnehmer */
.schulung-liste { display: grid; gap: .75rem; }
.schulung-eintrag { display: block; text-decoration: none; color: inherit; }
.schulung-eintrag:hover { color: inherit; border-color: var(--rot); }
.schulung-eintrag h2 { margin: 0 0 .25rem; font-size: 1.05rem; }
.schritte { list-style: none; padding: 0; margin: 0; counter-reset: schritt; }
.schritte > li { position: relative; padding: 0 0 1rem 2.6rem; }
.schritte > li::before { counter-increment: schritt; content: counter(schritt); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: #eceef1; display: grid; place-items: center; font-weight: 700; }
.schritte > li.erledigt::before { content: "✓"; background: var(--ok); color: #fff; }
.schritte > li.aktuell::before { background: var(--rot); color: #fff; }
.dokument-link { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .8rem; border: 1px solid var(--rand); border-radius: var(--radius);
  text-decoration: none; color: var(--text); margin-bottom: .5rem; background: #fff; }
.dokument-link:hover { border-color: var(--rot); color: var(--text); }
.frage { border: 1px solid var(--rand); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; background: #fff; }
.frage legend { font-weight: 600; padding: 0; margin-bottom: .5rem; }
.frage fieldset { border: 0; margin: 0; padding: 0; }
.frage .antwort { border: 1px solid var(--rand); border-radius: 6px; padding: .55rem .7rem; margin-bottom: .4rem; }
.frage-richtig { border-left: 5px solid var(--ok); }
.frage-falsch { border-left: 5px solid var(--rot); }
.antwort-loesung { background: var(--ok-flaeche); }
.antwort-falsch-gewaehlt { background: var(--rot-flaeche); }
.ergebnis-zahl { font-size: 2.5rem; font-weight: 800; line-height: 1; }

/* ---------------------------------------------------------- Anmeldeseiten */
.seite-schlicht { min-height: 100vh; display: flex; flex-direction: column; }
.anmelde-flaeche { width: 100%; max-width: 460px; margin: 0 auto; padding: 2rem 1rem; flex: 1; }
.anmelde-kopf { text-align: center; margin-bottom: 1.25rem; }
.anmelde-kopf img { max-height: 72px; width: auto; }
.anmelde-kopf .marke-symbol { margin: 0 auto .5rem; width: 56px; height: 56px; font-size: 1.1rem; background: var(--rot); color: #fff; }

@media print {
  .kopf, .fuss, .knopf, form { display: none !important; }
  body { background: #fff; }
  .karte { box-shadow: none; border: 0; }
}
.mittig { text-align: center; }
.abstand-oben { margin-top: .8rem; }
.flex-1 { flex: 1 1 12rem; }
.vorschau-bild { max-height: 90px; max-width: 100%; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid var(--rand); }
pre { white-space: pre-wrap; font-family: inherit; }
