/* Souveränitäts-Befragung — CD & Barrierefreiheit.
   Farben (Spec §11): weißer Grund, Navy-Text #0E3958, Aktion Royal Blue #1F66FF,
   Pink #FF99D8 nur als Akzent. */

/* Lato — SELBST gehostet (OFL), KEINE Google-Fonts. Bleibt CSP default-src 'self'.
   Herkunft/Lizenz: public/assets/fonts/OFL.txt. font-family-Stack unverändert. */
@font-face{font-family:'Lato';font-style:normal;font-weight:300;font-display:swap;src:url('/assets/fonts/lato-300.woff2') format('woff2')}
@font-face{font-family:'Lato';font-style:normal;font-weight:400;font-display:swap;src:url('/assets/fonts/lato-400.woff2') format('woff2')}
@font-face{font-family:'Lato';font-style:normal;font-weight:700;font-display:swap;src:url('/assets/fonts/lato-700.woff2') format('woff2')}
@font-face{font-family:'Lato';font-style:normal;font-weight:900;font-display:swap;src:url('/assets/fonts/lato-900.woff2') format('woff2')}

:root {
  --navy: #0e3958;
  --royal: #1f66ff;
  --pink: #ff99d8;
  --mid-blue: #2973a8;
  --light-blue: #74a9cf;
  --white: #ffffff;
  --grey-line: #d5dbe1;
  --focus: #0e3958;
  --font: "Lato", "Helvetica", "Arial", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--navy);
  background: var(--white);
  line-height: 1.5;
  font-size: 1.0625rem;
}

/* Navy-Header mit dünner Pink-Linie. Das Logo hat denselben Navy-Grund (#0E3958)
   → es fügt sich nahtlos ein (weiße Wortmarke schwebt auf dem Header, keine Box). */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--pink);
  padding: 0.4rem 1rem;
}
.site-header__home {
  display: inline-flex;
  border-radius: 4px;
}
.site-header__logo {
  display: block;
  height: 6.5rem;
  width: auto; /* Logo ist quadratisch → Breite = Höhe */
}

.main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

h1 { font-size: 1.5rem; line-height: 1.25; margin: 0.5rem 0 0.75rem; }
.intro, .lead { font-size: 1.0625rem; }
.note { color: #45586a; }

a.link { color: var(--royal); text-decoration: underline; }
a.link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Fragenliste */
.questions { list-style: none; margin: 0; padding: 0; }
.question { margin: 0 0 1.25rem; }

fieldset {
  border: 1px solid var(--grey-line);
  border-radius: 8px;
  margin: 0;
  padding: 0.75rem 1rem 1rem;
}
legend {
  font-weight: 700;
  padding: 0 0.4rem;
}
.question__num {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--royal);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.hint { font-size: 0.9375rem; color: #45586a; margin: 0.25rem 0 0.5rem; }

/* Optionen: großes Touch-Ziel (≥44px), ganze Zeile klickbar via Label */
.options { display: flex; flex-direction: column; gap: 0.25rem; margin-top: 0.5rem; }
.option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--grey-line);
  border-radius: 6px;
}
.option input {
  width: 1.35rem;
  height: 1.35rem;
  min-width: 1.35rem;
  accent-color: var(--royal);
  margin: 0;
}
.option label { flex: 1; padding: 0.4rem 0; cursor: pointer; }

/* Aktive Auswahl: Pink-Akzent (nur Rahmen/Hintergrund-Hauch, nie als Textfarbe) */
.option:has(input:checked) {
  border-color: var(--pink);
  box-shadow: inset 0 0 0 1px var(--pink);
}

/* Sichtbarer Fokus überall */
input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Der per JS als Schritt-Anker fokussierte fieldset (tabindex=-1) braucht keinen
   sichtbaren Ring — Fokus dient nur der Screenreader-Ansage. */
fieldset:focus { outline: none; }

/* Buttons: Royal Blue als Aktionsfarbe — bewusst als Outline (weiße Fläche,
   royal Rahmen + Text), NIE als royale Fläche (Spec §11). Kontrast #1F66FF auf
   Weiß = 4,77:1 (AA). */
.actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn {
  font: inherit;
  font-weight: 700;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  background: var(--white);
  border: 2px solid var(--royal);
  color: var(--royal);
  cursor: pointer;
}
.btn--secondary { border-color: var(--navy); color: var(--navy); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Fortschritt: Pink-Akzent */
.progress { margin: 0.5rem 0 1.25rem; }
.progress__label { margin: 0 0 0.4rem; font-weight: 700; font-size: 0.9375rem; }
.progress__track {
  height: 10px;
  background: #eef1f4;
  border-radius: 999px;
  overflow: hidden;
}
.progress__bar {
  display: block;
  height: 100%;
  background: var(--pink);
  width: 0%;
  transition: width 0.25s ease;
}

/* Fehler- und Statusmeldungen */
.error {
  border: 2px solid var(--royal);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  font-weight: 700;
}
.q8-msg {
  margin: 0.5rem 0 0;
  font-weight: 700;
  color: var(--navy);
}

/* Honeypot: für Menschen unsichtbar, nicht im Tab-Fluss (kein aria-hidden auf
   fokussierbarem Element → axe-konform) */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* JS-Enhancement: im Schritt-Modus wird eine Frage/Gruppe gezeigt.
   Ohne JS (html.no-js) sind alle Fragen sichtbar. */
.js .question[hidden] { display: none; }

/* Betreiber-Auswertung */
.admin-actions { margin: 0.5rem 0 1.5rem; font-weight: 700; }

/* Live-Auswertung (Danke-Screen) + Betreiber-Auswertung */
.results {
  margin-top: 2rem;
  border-top: 1px solid var(--grey-line);
  padding-top: 1.25rem;
}
.results-meta,
.results-empty { color: #45586a; }
.result-questions { list-style: none; margin: 0; padding: 0; }
.result-question { margin: 0 0 1.5rem; }
.result-question h3 { font-size: 1.0625rem; margin: 0 0 0.5rem; }

.bars { list-style: none; margin: 0; padding: 0; }
.bar-row {
  margin: 0 0 0.7rem;
  padding-left: 0.6rem;
  border-left: 4px solid transparent;
}
/* dezenter Pink-Akzent für den häufigsten Wert je Frage (kein Text, keine Fläche) */
.bar-row--top { border-left-color: var(--pink); }

.bar-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--navy);
}
.bar-value { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.bar {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 0.3rem;
  border-radius: 999px;
  overflow: hidden;
}
.bar__track { fill: var(--light-blue); }   /* Light Blue, dekorativer unbefüllter Teil */
.bar__fill { fill: var(--mid-blue); }      /* Mid Blue — Non-Text-Kontrast ~5:1 gegen Weiß */

/* Dezente Wachstums-Animation, rein CSS (auch ohne JS) */
.bar__fill {
  transform-box: fill-box;
  transform-origin: left center;
  animation: barGrow 0.5s ease-out both;
}
@keyframes barGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Rechtsseiten (Impressum/Datenschutz) */
.main address {
  font-style: normal; /* <address> nicht kursiv */
  line-height: 1.6;
  margin: 0 0 1rem;
}
/* Ausklappbare Volltext-Fassung (Datenschutz) — natives <details>/<summary> */
.legal-details {
  margin: 0.5rem 0 1.25rem;
}
.legal-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
}

/* Fußzeile mit Rechts-Links (auf allen Seiten) */
.site-footer {
  border-top: 1px solid var(--grey-line);
  padding: 1.25rem 1rem 2rem;
  text-align: center;
}
.site-footer__nav a {
  display: inline-block;
  padding: 0.4rem 0.5rem;
  color: var(--royal);
  text-decoration: underline;
}
.site-footer__nav a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.site-footer__sep { color: #45586a; }

@media (prefers-reduced-motion: reduce) {
  .progress__bar { transition: none; }
  .bar__fill { animation: none; }
}
