/* Barriere-Check – fürs Tablet gedacht, Ziel WCAG 2.1 AA:
   große Bedienflächen, starke Kontraste, sichtbarer Fokus, alles in rem (Schrift vergrößerbar). */

:root {
  --text: #1b1b1f;
  --text-leise: #4a4a55;
  --grund: #ffffff;
  --flaeche: #f3f1f7;
  --rand: #6b6878;
  --haupt: #4b1d6e;          /* Kontrast zu Weiß 12:1 */
  --haupt-text: #ffffff;
  --haupt-hell: #ebe3f3;
  --gut: #1f6e43;
  --warnung: #8a3b00;
  --fehler: #a4161a;
  --fokus: #ffbf47;
  --radius: 0.6rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f2f0f6;
    --text-leise: #c9c5d3;
    --grund: #16141b;
    --flaeche: #24212c;
    --rand: #a29eb0;
    --haupt: #c9a6ea;
    --haupt-text: #16141b;
    --haupt-hell: #3a2d48;
    --gut: #7fd6a3;
    --warnung: #ffb37a;
    --fehler: #ff8f8f;
  }
}

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

html { font-size: 112.5%; }   /* 18 px als Grundgröße, folgt der Einstellung des Browsers */

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  line-height: 1.55;
  color: var(--text);
  background: var(--grund);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--haupt); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 0.15em; }

:focus-visible {
  outline: 0.2rem solid var(--text);
  outline-offset: 0.15rem;
  box-shadow: 0 0 0 0.45rem var(--fokus);
}
main:focus { outline: none; }

.sprung {
  position: absolute; left: 0.5rem; top: -4rem;
  background: var(--haupt); color: var(--haupt-text);
  padding: 0.75rem 1rem; border-radius: var(--radius); z-index: 10;
}
.sprung:focus { top: 0.5rem; }

.unsichtbar {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Kopf und Fuß */
.kopf { background: var(--haupt); color: var(--haupt-text); }
.kopf-innen, main, .fuss {
  width: 100%; max-width: 54rem; margin: 0 auto; padding-left: 1.25rem; padding-right: 1.25rem;
}
.kopf-innen { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.kopf a { color: var(--haupt-text); }
.marke { font-weight: 700; font-size: 1.2rem; text-decoration: none; }
.beta { font-size: 0.75rem; font-weight: 600; border: 1px solid currentColor; border-radius: 1rem; padding: 0.05rem 0.5rem; vertical-align: middle; }
#nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
#nav a { display: inline-block; padding: 0.5rem 0; }
#nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 0.2em; }

main { flex: 1; padding-top: 1.5rem; padding-bottom: 3rem; }
.fuss { border-top: 1px solid var(--rand); padding-top: 1rem; padding-bottom: 2rem; color: var(--text-leise); font-size: 0.9rem; }
.fuss nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.fuss a { display: inline-block; padding: 0.4rem 0; }

h1 { font-size: 1.75rem; line-height: 1.3; margin: 0.25rem 0 1rem; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.35rem; }

/* Knöpfe */
.knopf, button {
  font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.6rem 1.25rem;
  border: 0.13rem solid var(--haupt); border-radius: var(--radius);
  background: var(--grund); color: var(--haupt);
  text-decoration: none; cursor: pointer;
}
.knopf.haupt, button.haupt { background: var(--haupt); color: var(--haupt-text); }
.knopf.leise, button.leise { border-color: var(--rand); color: var(--text); }
button.gefahr { border-color: var(--fehler); color: var(--fehler); }
button:disabled { opacity: 0.6; cursor: wait; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }

/* Formulare */
label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input[type="text"], textarea {
  font: inherit; width: 100%; padding: 0.7rem 0.8rem;
  border: 0.13rem solid var(--rand); border-radius: var(--radius);
  background: var(--grund); color: var(--text);
}
textarea { min-height: 6rem; resize: vertical; }
.feld { margin: 1.25rem 0; }
.feld-hilfe { color: var(--text-leise); font-size: 0.9rem; margin: 0.25rem 0 0; }
.wahl { display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.6rem 0; font-weight: 400; cursor: pointer; }
.wahl input { width: 1.6rem; height: 1.6rem; margin: 0.1rem 0 0; flex: none; accent-color: var(--haupt); }
fieldset { border: 0; padding: 0; margin: 1.25rem 0; }
legend { font-weight: 700; margin-bottom: 0.5rem; padding: 0; }

/* Code */
.code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 2rem; font-weight: 700; letter-spacing: 0.12em;
  background: var(--flaeche); border: 0.13rem dashed var(--haupt); border-radius: var(--radius);
  padding: 0.75rem 1rem; display: inline-block; margin: 0.5rem 0;
}
#code-eingabe { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.4rem; letter-spacing: 0.1em; text-transform: uppercase; max-width: 22rem; }

/* Kästen */
.kasten { background: var(--flaeche); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 1.25rem 0; }
.kasten > :last-child { margin-bottom: 0; }
.hinweis { border-left: 0.35rem solid var(--haupt); }
.fehler { border-left: 0.35rem solid var(--fehler); }

/* Frage */
.pfad { color: var(--text-leise); font-size: 0.95rem; margin: 0; }
.fortschritt { margin: 0.5rem 0 1rem; }
.balken { height: 0.7rem; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 1rem; overflow: hidden; }
.balken > span { display: block; height: 100%; background: var(--haupt); }
.nr { color: var(--text-leise); font-weight: 600; font-size: 1rem; display: block; }
.antworten { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; margin: 1.25rem 0; }
.antworten button { min-height: 4rem; font-size: 1.1rem; justify-content: flex-start; text-align: left; }
.antworten button[aria-pressed="true"] { background: var(--haupt); color: var(--haupt-text); }
.antworten button[aria-pressed="true"]::before { content: "✓"; font-weight: 700; }
.antworten .neben { border-color: var(--rand); color: var(--text); font-weight: 500; }
details { border: 0.1rem solid var(--rand); border-radius: var(--radius); margin: 0.75rem 0; }
summary { cursor: pointer; font-weight: 600; padding: 0.85rem 1rem; min-height: 3rem; }
details > div { padding: 0 1rem 1rem; }
details[open] > summary { border-bottom: 1px solid var(--rand); margin-bottom: 0.75rem; }
.aufwand { display: inline-block; font-size: 0.85rem; font-weight: 600; border: 1px solid var(--rand); border-radius: 1rem; padding: 0 0.6rem; margin-right: 0.4rem; }
.unten { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; margin-top: 2rem; }

/* Übersicht */
.bereich { border: 0.1rem solid var(--rand); border-radius: var(--radius); padding: 0.5rem 1rem 1rem; margin: 1rem 0; }
.bereich h2 { margin-top: 0.75rem; }
.gruppen { list-style: none; padding: 0; margin: 0; }
.gruppen li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.5rem 1rem; padding: 0.5rem 0; border-top: 1px solid var(--flaeche); }
@media (max-width: 30rem) { .gruppen li { grid-template-columns: 1fr auto; } .gruppen li button { grid-column: 1 / -1; justify-self: start; } }
.gruppen a { padding: 0.35rem 0; }
.zahl { color: var(--text-leise); font-size: 0.95rem; white-space: nowrap; }
.erledigt { color: var(--gut); font-weight: 600; }
.klein { min-height: 2.75rem; padding: 0.35rem 0.9rem; font-size: 0.9rem; }

/* Ergebnis */
.punkte { font-size: 3.5rem; font-weight: 800; line-height: 1; margin: 0.5rem 0; color: var(--haupt); }
.punkte small { font-size: 1.4rem; font-weight: 600; color: var(--text); }
.stufe { font-size: 1.3rem; font-weight: 700; }
.wertungen { list-style: none; padding: 0; }
.wertungen li { margin: 0.9rem 0; }
.wertungen .zeile { display: flex; justify-content: space-between; gap: 1rem; }
.schritte li { margin-bottom: 0.75rem; }
.schritte .frage { display: block; color: var(--text-leise); font-size: 0.9rem; }

/* Zertifikat */
.zertifikat { border: 0.25rem double var(--haupt); border-radius: var(--radius); padding: 1.5rem 1.75rem; margin: 1rem 0; }
.zertifikat h1 { margin-top: 0; }
.zertifikat .fusszeile { font-size: 0.9rem; color: var(--text-leise); border-top: 1px solid var(--rand); padding-top: 0.75rem; margin-top: 1.5rem; }

.status { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); max-width: calc(100% - 2rem); }
.status:not(:empty) { background: var(--text); color: var(--grund); padding: 0.6rem 1.1rem; border-radius: var(--radius); font-weight: 600; }
.status.fehler-meldung:not(:empty) { background: var(--fehler); color: #fff; }

@media (max-width: 30rem) {
  h1 { font-size: 1.45rem; }
  .code { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .balken > span { transition: width 0.3s ease; }
}

@media print {
  :root { --text: #000; --grund: #fff; --haupt: #4b1d6e; --flaeche: #f1f1f1; }
  .kopf, .fuss, .sprung, .status, .knopfreihe, .nicht-drucken { display: none !important; }
  main { padding: 0; max-width: none; }
  .zertifikat { margin: 0; }
  a { color: inherit; }
}
details h2 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
