/* Academy-Quiz – dezentes helles Design, mobil-first, keine externen Ressourcen */

:root {
  --hintergrund: #f4f6f8;
  --karte: #ffffff;
  --text: #1f2933;
  --text-leise: #616e7c;
  --primaer: #2f6f4f;
  --primaer-dunkel: #26593f;
  --sekundaer: #e4ebf1;
  --rand: #d6dee6;
  --gruen: #2e7d32;
  --gruen-hell: #e6f4e6;
  --rot: #c62828;
  --rot-hell: #fdecea;
  --gelb-hell: #fff8e1;
  --radius: 12px;
  --schatten: 0 1px 3px rgba(31, 41, 51, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--hintergrund);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.versteckt { display: none !important; }

.app-header { text-align: center; margin: 8px 0 20px; }
.app-header h1 { margin: 0 0 4px; font-size: 1.6rem; }
.untertitel { margin: 0; color: var(--text-leise); }

/* Knappe App-Erklärung unter dem Titel – bewusst dezent */
.intro {
  margin: 10px auto 0;
  max-width: 480px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-leise);
}

/* Sprachschalter (DE/EN) – gut sichtbar, touch-tauglich */
.sprach-schalter {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.sprach-knopf {
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  font-weight: 600;
  letter-spacing: 0.04em;
  touch-action: manipulation;
}

.karte {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 20px;
  margin-bottom: 16px;
}

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

/* ---------- Buttons: groß, touch-tauglich ---------- */

.btn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 18px;
  margin: 10px 0;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
}

.btn-detail {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 2px;
}

.btn-primaer { background: var(--primaer); color: #fff; }
.btn-primaer:active { background: var(--primaer-dunkel); }

.btn-sekundaer {
  background: var(--sekundaer);
  color: var(--text);
  border: 1px solid var(--rand);
}

.btn-leise {
  background: none;
  border: none;
  color: var(--text-leise);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  padding: 10px;
  min-height: 44px;
}

.btn:disabled, .btn-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Kurs-Karten auf der Startseite */
.kurs-karte {
  width: 100%;
  text-align: left;
  background: var(--karte);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 18px 20px;
  margin-bottom: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  cursor: pointer;
  min-height: 64px;
}
.kurs-karte:active { border-color: var(--primaer); }
.kurs-karte .kurs-titel { font-weight: 700; display: block; }
.kurs-karte .statistik { margin: 4px 0 0; }

.statistik {
  color: var(--text-leise);
  font-size: 0.9rem;
  margin: 0 0 12px;
}

/* Fortschrittsbalken auf Kurskarte */
.mini-balken {
  height: 6px;
  background: var(--sekundaer);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.mini-balken > div {
  height: 100%;
  background: var(--primaer);
  border-radius: 3px;
}

/* Prüfungs-Anzahl-Chips */
.pruefung-block { margin: 10px 0; }
.pruefung-block .btn { margin-bottom: 6px; }
.anzahl-wahl { display: flex; gap: 8px; }
.btn-chip {
  flex: 1;
  min-height: 44px;
  border: 1px solid var(--rand);
  background: var(--karte);
  border-radius: 22px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--text);
}
.btn-chip.aktiv {
  background: var(--primaer);
  border-color: var(--primaer);
  color: #fff;
  font-weight: 600;
}

/* ---------- Quiz-Ansicht ---------- */

.quiz-kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
#quiz-fortschritt-text { font-weight: 600; color: var(--text-leise); }
.btn-abbrechen { padding-left: 0; }

.fortschritt-balken {
  height: 8px;
  background: var(--sekundaer);
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
}
#fortschritt-fuellung {
  height: 100%;
  width: 0%;
  background: var(--primaer);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.frage-meta {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-leise);
}
.frage-text { margin: 0 0 16px; font-size: 1.2rem; line-height: 1.4; }

.antworten { display: flex; flex-direction: column; gap: 10px; }

.antwort {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  text-align: left;
  background: var(--hintergrund);
  border: 2px solid var(--rand);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.4;
  cursor: pointer;
  color: var(--text);
  touch-action: manipulation;
}
.antwort:active { border-color: var(--primaer); }
.antwort.gewaehlt { border-color: var(--primaer); background: #eef5f1; }
.antwort.richtig { border-color: var(--gruen); background: var(--gruen-hell); }
.antwort.falsch { border-color: var(--rot); background: var(--rot-hell); }
.antwort:disabled { cursor: default; opacity: 1; }
.antwort:disabled:not(.richtig):not(.falsch) { opacity: 0.6; }

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--gelb-hell);
  border: 1px solid #f0e0b0;
}
.feedback.richtig { background: var(--gruen-hell); border-color: #bfe3bf; }
.feedback.falsch { background: var(--rot-hell); border-color: #f2c4c0; }
.feedback-titel { margin: 0 0 6px; font-weight: 700; }
.feedback p:last-child { margin-bottom: 0; }
#feedback-erklaerung { margin: 0; }

/* ---------- Ergebnis ---------- */

.ergebnis-karte { text-align: center; }
.ergebnis-prozent { font-size: 2.6rem; font-weight: 800; margin: 8px 0; }
.ergebnis-prozent.bestanden { color: var(--gruen); }
.ergebnis-prozent.durchgefallen { color: var(--rot); }

.falsche-frage {
  background: var(--karte);
  border: 1px solid var(--rand);
  border-left: 4px solid var(--rot);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.falsche-frage h3 { margin: 0 0 6px; font-size: 1rem; }
.falsche-frage p { margin: 4px 0; font-size: 0.95rem; }
.falsche-frage .deine-antwort { color: var(--rot); }
.falsche-frage .richtige-antwort { color: var(--gruen); font-weight: 600; }
.falsche-frage .erklaerung { color: var(--text-leise); }

.fehler-karte { border-left: 4px solid var(--rot); }

@media (min-width: 480px) {
  .app { padding-top: 32px; }
}
