/* Antrag — ruhig, wenig Farbe. Farbe nur für die Ampel. */

:root {
  --grund:       #F3F2EE;
  --karte:       #FFFFFF;
  --text:        #24272B;
  --text-leise:  #5D636A;
  --linie:       #D6D4CD;
  --akzent:      #2F5D62;
  --akzent-text: #FFFFFF;

  --ampel-gruen: #3F7D4E;
  --ampel-gelb:  #B7860B;
  --ampel-rot:   #B4483A;

  --radius:   14px;
  --radius-g: 22px;
  --schatten: 0 1px 0 rgba(0,0,0,.06), 0 8px 24px -16px rgba(0,0,0,.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund:       #17191C;
    --karte:       #212428;
    --text:        #E7E6E2;
    --text-leise:  #9EA4AA;
    --linie:       #33373C;
    --akzent:      #7FB3B8;
    --akzent-text: #10201F;

    --ampel-gruen: #6DB27D;
    --ampel-gelb:  #E0B54A;
    --ampel-rot:   #E07A6B;

    --schatten: 0 1px 0 rgba(0,0,0,.4), 0 10px 26px -16px rgba(0,0,0,.9);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }

a { color: var(--akzent); }

:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Rahmen ---------------------------------------------------- */

.rahmen {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px calc(32px + env(safe-area-inset-bottom));
}

.kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 0 14px;
}

.marke { font-weight: 700; font-size: 1.1rem; }

.zurueck {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  font-size: 1.8rem;
  text-decoration: none;
  color: var(--text);
}

.inhalt { padding-top: 8px; }

.buehne { padding: 24px 0; }

.leise { color: var(--text-leise); }

/* ---------- Hinweise (freundlich, nie rot) ---------------------------- */

.hinweis {
  background: var(--karte);
  border-left: 4px solid var(--akzent);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: var(--schatten);
}

/* ---------- Knöpfe ---------------------------------------------------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--karte);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* Der eine große Hauptknopf pro Bildschirm */
.knopf.haupt {
  display: flex;
  width: 100%;
  min-height: 64px;
  margin-top: 24px;
  border: 0;
  border-radius: var(--radius-g);
  background: var(--akzent);
  color: var(--akzent-text);
  font-size: 1.15rem;
  box-shadow: var(--schatten);
}

.kopf .rechts { margin-left: auto; }

.knopf.leise-knopf {
  min-height: 44px;
  padding: 8px 14px;
  font-weight: 500;
  font-size: .95rem;
  color: var(--text-leise);
  background: transparent;
}

/* ---------- Formulare ------------------------------------------------- */

.formular label {
  display: block;
  margin: 18px 0 6px;
  font-weight: 600;
}

.formular input[type=text],
.formular input[type=password],
.formular input[inputmode] {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--karte);
  color: var(--text);
  font: inherit;
}

.formular input.gross {
  font-size: 1.6rem;
  letter-spacing: .15em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.knopf.voll { width: 100%; margin-top: 18px; }

/* ---------- Bausteine ------------------------------------------------- */

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin: 12px 0;
}

.karte > summary,
details.klein > summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.karte[open] { padding-bottom: 16px; }

details.klein { margin-top: 20px; color: var(--text-leise); }
details.klein > summary { font-weight: 500; }

.schritte { padding-left: 1.3em; }
.schritte li { margin-bottom: 16px; }

.qr {
  display: block;
  width: 240px;
  height: 240px;
  margin: 14px 0;
  border-radius: 10px;
}

.geheimnis, .codes code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.1rem;
  letter-spacing: .05em;
  word-break: break-all;
}

.codes {
  list-style: none;
  padding: 16px;
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 16px;
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
}

.formular textarea,
.formular select {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  background: var(--karte);
  color: var(--text);
  font: inherit;
}

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

.klein-text { font-size: .9rem; }

/* ---------- Fortschritt ------------------------------------------------ */

progress.fortschritt {
  width: 100%;
  height: 10px;
  margin: 4px 0 20px;
  border: 0;
  border-radius: 99px;
  background: var(--linie);
  overflow: hidden;
  appearance: none;
}
progress.fortschritt::-webkit-progress-bar { background: var(--linie); border-radius: 99px; }
progress.fortschritt::-webkit-progress-value { background: var(--akzent); border-radius: 99px; }
progress.fortschritt::-moz-progress-bar { background: var(--akzent); border-radius: 99px; }

/* ---------- Eine Frage pro Bildschirm ---------------------------------- */

.bisher {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 12px 16px;
  word-break: break-word;
}

.trenner { text-align: center; margin: 22px 0 0; }

.merken {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 14px;
  color: var(--text-leise);
  font-weight: 500;
}
.merken input { width: 22px; height: 22px; accent-color: var(--akzent); }

.antworten { display: grid; gap: 10px; margin-top: 18px; }
.knopf.antwort { width: 100%; min-height: 58px; font-size: 1.05rem; }
.knopf.antwort.gewaehlt { border: 2px solid var(--akzent); }

.nebenaktion {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

/* ---------- Profil-Übersicht ------------------------------------------ */

.gruppe { margin: 28px 0; }
.gruppe h2 { margin-bottom: 8px; }

.feldzeile {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: baseline;
  padding: 12px 4px;
  border-bottom: 1px solid var(--linie);
  color: var(--text);
  text-decoration: none;
  min-height: 52px;
}
.feldname { font-weight: 600; }
.feldwert { grid-column: 1 / -1; color: var(--text-leise); word-break: break-word; white-space: pre-line; }
.feldwert.leer { font-style: italic; }
.marke-pruefen {
  grid-row: 1;
  grid-column: 2;
  font-size: .8rem;
  padding: 2px 10px;
  border: 1px solid var(--text-leise);
  border-radius: 99px;
  color: var(--text-leise);
  white-space: nowrap;
}

.person {
  border-left: 3px solid var(--linie);
  padding-left: 12px;
  margin-bottom: 14px;
}

/* ---------- Prüfansicht --------------------------------------------- */

.pruefzeile {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--linie);
}
.pruefzeile form { flex: none; }
.pruefinhalt {
  flex: 1;
  display: grid;
  gap: 2px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}
.pruefinhalt .marke-pruefen { justify-self: start; }
.feldwert.anlage { color: var(--text); }

.haken {
  width: 44px;
  height: 44px;
  border: 2px solid var(--linie);
  border-radius: 12px;
  background: var(--karte);
  color: transparent;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
}
.haken[aria-pressed="true"] {
  border-color: var(--akzent);
  background: var(--akzent);
  color: var(--akzent-text);
}
.pruefzeile.erledigt .feldname { color: var(--text-leise); }

svg.vorschau {
  display: block;
  width: 100%;
  height: auto;
  margin: 12px 0 20px;
  background: #fff;
  border: 1px solid var(--linie);
  border-radius: 8px;
  box-shadow: var(--schatten);
}
.feldmarke {
  fill: transparent;
  stroke: var(--akzent);
  stroke-width: 1;
  stroke-dasharray: 3 2;
  cursor: pointer;
}
.feldmarke:hover, a:focus .feldmarke { fill: rgba(47, 93, 98, .12); stroke-width: 2; }

/* ---------- Brief ----------------------------------------------------- */

.brieftext {
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: .95rem;
  line-height: 1.6;
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0;
  max-height: 60vh;
  overflow: auto;
}
mark.geschwaerzt {
  background: var(--text);
  color: var(--grund);
  border-radius: 4px;
  padding: 0 4px;
  font-size: .85em;
  white-space: nowrap;
}

/* ---------- Ampel (die einzige Farbe) ---------------------------------- */

.ampel {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 99px;
  font-weight: 700;
  border: 2px solid currentColor;
}
.ampel-gruen { color: var(--ampel-gruen); }
.ampel-gelb  { color: var(--ampel-gelb); }
.ampel-rot   { color: var(--ampel-rot); }
.ampelpunkt {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  background: currentColor;
  flex: none;
}
.liste-links .ampelpunkt { vertical-align: middle; }

.gross-text { font-size: 1.2rem; }

.frist {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--radius-g);
  padding: 18px 20px;
  margin: 8px 0 24px;
  box-shadow: var(--schatten);
}
.frist p { margin: 0 0 4px; }
.frist-datum { font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.frist-noch { font-weight: 600; }
.frist-vorbei .frist-noch { color: var(--ampel-rot); }

.schritte-liste { padding-left: 1.3em; }
.schritte-liste li { margin-bottom: 10px; }

.begriff p { margin: 0 0 8px; }
.hinweis.rechtlich { font-size: .95rem; }

.entwurf-banner {
  border: 2px dashed var(--text-leise);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 16px 0;
  background: var(--karte);
}
.entwurf-banner strong { letter-spacing: .08em; }

.brief-editor {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .9rem;
  line-height: 1.5;
}
.frist-zeile { margin: 0; }

.zusammenfassung { padding-left: 1.2em; }
.zusammenfassung li { margin-bottom: 6px; }

.liste-links { display: grid; gap: 4px; margin-top: 28px; }
.liste-links a { padding: 12px 0; min-height: 44px; }

@media (prefers-reduced-motion: no-preference) {
  .knopf { transition: transform .08s ease; }
  .knopf:active { transform: scale(.98); }
}
