/* Gestaltung des Anamnese-Satelliten.
   Ruhig, große Schrift, große Flächen zum Antippen. Handy zuerst.
   Keine externen Schriften oder Bilder — die CSP lässt nur eigene Dateien zu. */

:root {
  --grund: #f7f5f1;
  --karte: #ffffff;
  --schrift: #23201c;
  --leise: #5f5952;
  --linie: #ddd6cc;
  --akzent: #4a6b5d;
  --akzent-hell: #e8efeb;
  --warnung: #8c3b2e;
  --warnung-hell: #f7e8e5;
  --rund: 14px;
  --schatten: 0 1px 2px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #1a1917;
    --karte: #242220;
    --schrift: #eceae6;
    --leise: #a9a29a;
    --linie: #3c3833;
    --akzent: #8fbfa9;
    --akzent-hell: #2b332f;
    --warnung: #e6a294;
    --warnung-hell: #3a2723;
    --schatten: none;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0 0 4rem;
  background: var(--grund);
  color: var(--schrift);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.15rem;
  line-height: 1.6;
}

.huelle {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* --- Kopf --------------------------------------------------------------- */

.kopf {
  background: var(--karte);
  border-bottom: 1px solid var(--linie);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.kopf p {
  margin: 0;
}

.kopf .praxis {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.kopf .bogen {
  font-size: 0.95rem;
  color: var(--leise);
}

/* --- Textbausteine ------------------------------------------------------ */

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.35rem;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

h3 {
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

p {
  margin: 0 0 1rem;
}

.leise {
  color: var(--leise);
  font-size: 0.98rem;
}

.einleitung {
  background: var(--akzent-hell);
  border-radius: var(--rund);
  padding: 1rem 1.15rem;
  margin-bottom: 1.5rem;
}

.einleitung p:last-child {
  margin-bottom: 0;
}

/* --- Karten ------------------------------------------------------------- */

.karte {
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: var(--rund);
  box-shadow: var(--schatten);
  padding: 1.15rem;
  margin-bottom: 1.15rem;
}

.frage .titel {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.frage .hilfe {
  color: var(--leise);
  font-size: 0.98rem;
  margin-bottom: 0.75rem;
}

.frage .ueberspringen {
  color: var(--leise);
  font-size: 0.92rem;
  font-style: italic;
  margin-bottom: 0.75rem;
}

/* --- Eingaben ----------------------------------------------------------- */

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="file"],
textarea,
select {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--grund);
  border: 1px solid var(--linie);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  min-height: 3rem;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
}

.feld {
  margin-bottom: 1rem;
}

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

button {
  font: inherit;
  font-weight: 600;
  color: var(--schrift);
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 10px;
  padding: 0.75rem 1.1rem;
  min-height: 3rem;
  cursor: pointer;
}

button:hover {
  border-color: var(--akzent);
}

button.wichtig {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  button.wichtig {
    color: #16211d;
  }
}

button.schlicht {
  background: transparent;
  border-color: transparent;
  color: var(--leise);
  text-decoration: underline;
  padding-left: 0;
  padding-right: 0;
}

button.gefahr {
  color: var(--warnung);
  border-color: var(--warnung);
  background: transparent;
}

button[disabled] {
  opacity: 0.5;
  cursor: default;
}

.knopfreihe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.knopfreihe.verteilt {
  justify-content: space-between;
}

.knopfreihe.rechts {
  justify-content: flex-end;
}

.feld.sonstiges {
  margin-top: 0.9rem;
}

/* --- Kacheln (Listenfragen) --------------------------------------------- */

.kacheln {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

@media (min-width: 30rem) {
  .kacheln {
    grid-template-columns: 1fr 1fr;
  }
}

.kachel {
  border: 1px solid var(--linie);
  border-radius: 12px;
  background: var(--grund);
  padding: 0.85rem 0.9rem;
  min-height: 3.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
}

.kachel.gewaehlt {
  border-color: var(--akzent);
  background: var(--akzent-hell);
}

.kachel > button.wahl {
  all: unset;
  cursor: pointer;
  display: block;
  font-weight: 600;
  min-height: 1.5rem;
}

.kachel > button.wahl::before {
  content: "☐ ";
  color: var(--leise);
}

.kachel.gewaehlt > button.wahl::before {
  content: "☑ ";
  color: var(--akzent);
}

.staerke {
  display: flex;
  gap: 0.4rem;
}

.staerke button {
  flex: 1;
  min-height: 2.6rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.95rem;
  background: var(--karte);
}

.staerke button.gewaehlt {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .staerke button.gewaehlt {
    color: #16211d;
  }
}

/* --- Ja/Nein ------------------------------------------------------------ */

.janein {
  display: flex;
  gap: 0.6rem;
}

.janein button {
  flex: 1;
}

.janein button.gewaehlt {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .janein button.gewaehlt {
    color: #16211d;
  }
}

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

.fortschritt {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--grund);
  padding: 0.6rem 0 0.8rem;
}

.balken {
  height: 10px;
  background: var(--linie);
  border-radius: 999px;
  overflow: hidden;
}

.balken > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--akzent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.fortschritt .zahl {
  font-size: 0.95rem;
  color: var(--leise);
  margin: 0.35rem 0 0;
}

/* --- Meldungen ---------------------------------------------------------- */

.meldung {
  border-radius: var(--rund);
  padding: 0.9rem 1.05rem;
  margin-bottom: 1.15rem;
  background: var(--akzent-hell);
}

.meldung.fehler {
  background: var(--warnung-hell);
  color: var(--warnung);
  font-weight: 600;
}

.meldung p:last-child {
  margin-bottom: 0;
}

.warnkasten {
  border: 2px solid var(--warnung);
  background: var(--warnung-hell);
  border-radius: var(--rund);
  padding: 1rem 1.15rem;
  margin-bottom: 1.15rem;
}

.warnkasten p:last-child {
  margin-bottom: 0;
}

/* --- Listen (Dianas Eingänge) ------------------------------------------- */

.eintrag {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.8rem;
  margin-bottom: 0.6rem;
}

.chiffre {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.merkmal {
  font-size: 0.9rem;
  border: 1px solid var(--linie);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  color: var(--leise);
}

.merkmal.eingegangen {
  border-color: var(--akzent);
  color: var(--akzent);
  font-weight: 600;
}

.linkfeld {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  word-break: break-all;
  background: var(--grund);
  border: 1px solid var(--linie);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  margin-top: 0.6rem;
}

/* --- Entsiegelter Bogen ------------------------------------------------- */

.bogen .abschnitt {
  margin-bottom: 1.6rem;
}

.bogen .abschnitt > h3 {
  border-bottom: 2px solid var(--linie);
  padding-bottom: 0.25rem;
  margin-bottom: 0.75rem;
}

.bogen .zeile {
  margin-bottom: 0.9rem;
  break-inside: avoid;
}

.bogen .zeile .frage-titel {
  font-weight: 600;
}

.bogen .zeile .antwort {
  white-space: pre-wrap;
}

.bogen .zeile .antwort.leer {
  color: var(--leise);
  font-style: italic;
}

.bogen ul {
  margin: 0.2rem 0 0;
  padding-left: 1.3rem;
}

/* --- Druck -------------------------------------------------------------- */

@media print {
  :root {
    --grund: #ffffff;
    --karte: #ffffff;
    --schrift: #000000;
    --leise: #444444;
    --linie: #999999;
    --akzent: #000000;
    --akzent-hell: #ffffff;
    --schatten: none;
  }

  body {
    font-size: 11pt;
    padding: 0;
  }

  .kopf {
    border-bottom: 1px solid #000;
    margin-bottom: 1rem;
  }

  .nicht-drucken,
  .knopfreihe,
  button {
    display: none !important;
  }

  .karte {
    border: none;
    padding: 0;
    margin-bottom: 0.8rem;
  }

  .huelle {
    max-width: none;
    padding: 0;
  }

  a[href]::after {
    content: "";
  }
}

/* QR-Code der Ersteinrichtung: heller Rahmen, damit Scanner ihn sicher lesen. */
.qr-rahmen {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #ffffff;
  border-radius: 8px;
  width: fit-content;
  margin: 0 auto;
}
