/* Remote Control – E-Commerce Lernkarten
   Styles fuer Kategorie-Hub und Karteikarten-App. */

:root {
  --bg: #eef1f5;
  --flaeche: #ffffff;
  --text: #1f2933;
  --text-leise: #5b6675;
  --rand: #d8dee6;
  --akzent: #2563eb;
  --gruen: #1e9e54;
  --rot: #d23b3b;
  --schatten: 0 6px 22px rgba(15, 30, 60, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

/* ---------- Hinweis zur Herkunft ---------- */

.hinweis-leiste {
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}
/* Dieselbe Breite wie das Kachelraster der Startseite - die Leiste sitzt
   auf jeder Seite gleich und wirkt neben den Kacheln nicht eingerueckt. */
.hinweis-leiste-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 10px 22px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-leise);
}
.hinweis-leiste p { margin: 0; }
.hinweis-leiste a { color: var(--akzent); white-space: nowrap; }

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

.kopf {
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  padding: 18px 22px;
}
.kopf h1 { font-size: 1.45rem; }
.kopf-hub {
  text-align: center;
  padding: 46px 22px 38px;
}
.kopf-hub h1 { font-size: 2rem; }
.untertitel {
  max-width: 620px;
  margin: 12px auto 0;
  color: var(--text-leise);
}
.zurueck-link {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--akzent);
  text-decoration: none;
  font-size: 0.92rem;
}
.zurueck-link:hover { text-decoration: underline; }

/* ---------- Inhalt ---------- */

.inhalt {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 22px 56px;
}

/* ---------- Hub: Kategorie-Kacheln ---------- */

/* Nur die Startseite wird breiter. Die 960 px von .inhalt gelten weiterhin
   fuer die Karteikarte, das Impressum und die Datenschutzerklaerung - dort
   waeren lange Zeilen schlecht lesbar. */
body[data-page="hub"] .inhalt { max-width: 1340px; }

/* 240 px Mindestbreite ergeben ab etwa 1366 px Bildschirmbreite fuenf
   Spalten, darunter automatisch vier, drei, zwei und schliesslich eine. */
.kachel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}
.kachel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 14px;
  padding: 22px 20px 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--schatten);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  --akzent: #2563eb;
}
.kachel:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 30, 60, 0.16);
}
.kachel::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  border-radius: 14px 0 0 14px;
  background: var(--akzent);
}
.kachel-punkt {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--akzent);
  opacity: 0.16;
  margin-bottom: 12px;
}
.kachel-titel { font-size: 1.12rem; margin-bottom: 6px; }
.kachel-text {
  font-size: 0.92rem;
  color: var(--text-leise);
  flex: 1;
}
.kachel-anzahl {
  margin-top: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--akzent);
}
.kachel-fortschritt {
  height: 6px;
  margin-top: 10px;
  background: var(--rand);
  border-radius: 99px;
  overflow: hidden;
}
.kachel-balken {
  height: 100%;
  width: 0%;
  background: var(--akzent);
  border-radius: 99px;
  transition: width 0.3s ease;
}
.kachel-stand {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-leise);
}
.kachel-alle {
  --akzent: #1f2933;
  background: #1f2933;
  color: #fff;
}
.kachel-alle .kachel-text { color: #c7ced8; }
.kachel-alle .kachel-anzahl { color: #fff; }
.kachel-alle .kachel-punkt { background: #fff; }
.kachel-alle .kachel-fortschritt { background: rgba(255, 255, 255, 0.22); }
.kachel-alle .kachel-balken { background: #fff; }
.kachel-alle .kachel-stand { color: #c7ced8; }

.fuss {
  text-align: center;
  padding: 0 22px 40px;
  color: var(--text-leise);
  font-size: 0.85rem;
}

/* ---------- Modus-Umschalter ---------- */

.modus-leiste {
  display: flex;
  gap: 6px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 22px;
}
.modus-tab {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--text-leise);
  cursor: pointer;
}
.modus-tab.aktiv {
  background: var(--akzent);
  color: #fff;
}

.versteckt { display: none !important; }

/* ---------- Fortschrittsbalken ---------- */

.fortschritt {
  height: 8px;
  background: var(--rand);
  border-radius: 99px;
  overflow: hidden;
}
.fortschritt-balken {
  height: 100%;
  width: 0%;
  background: var(--gruen);
  transition: width 0.3s ease;
}
.lern-kopf { margin-bottom: 18px; }
.lern-zaehler,
.quiz-zaehler {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--text-leise);
  text-align: center;
}

/* ---------- Karteikarte ---------- */

.karte {
  perspective: 1200px;
  cursor: pointer;
  margin-bottom: 18px;
}
.karte-inner {
  position: relative;
  width: 100%;
  min-height: 280px;
  transition: transform 0.55s;
  transform-style: preserve-3d;
}
.karte.gedreht .karte-inner { transform: rotateY(180deg); }
.karte-seite {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 26px;
  border-radius: 16px;
  border: 1px solid var(--rand);
  box-shadow: var(--schatten);
  overflow: auto;
}
.karte-vorne { background: var(--flaeche); }
.karte-hinten {
  background: #1f2933;
  color: #fff;
  transform: rotateY(180deg);
}
.karte.ist-gewusst .karte-vorne {
  border-color: var(--gruen);
  box-shadow: 0 0 0 2px rgba(30, 158, 84, 0.35), var(--schatten);
}
.karte.ist-schwierig .karte-vorne {
  border-color: var(--rot);
  box-shadow: 0 0 0 2px rgba(210, 59, 59, 0.30), var(--schatten);
}
.karte-label {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--akzent);
  margin-bottom: 14px;
}
.karte-hinten .karte-label { color: #7fb4ff; }
.karte-text { font-size: 1.5rem; font-weight: 600; }
.karte-text-def { font-size: 1.12rem; font-weight: 400; }
.karte-hinweis {
  margin-top: 16px;
  font-size: 0.78rem;
  color: var(--text-leise);
}

/* ---------- Buttons ---------- */

.btn {
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border: 1px solid var(--rand);
  border-radius: 9px;
  background: var(--flaeche);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.05s ease;
}
.btn:hover { background: #f0f3f7; }
.btn:active { transform: scale(0.97); }
.btn-flip { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.btn-flip:hover { background: #1d4fd0; }
.btn-gruen { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.btn-gruen:hover { background: #178247; }
.btn-rot { background: var(--rot); color: #fff; border-color: var(--rot); }
.btn-rot:hover { background: #b62f2f; }
.btn-klein { padding: 7px 12px; font-size: 0.85rem; }
.btn-gross { padding: 13px 26px; font-size: 1.02rem; }

.bewertung,
.nav {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.bewertung .btn,
.nav .btn { flex: 1; }

.lern-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--rand);
}
.schalter {
  font-size: 0.88rem;
  color: var(--text-leise);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

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

.quiz-start,
.quiz-ende {
  text-align: center;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 16px;
  padding: 38px 26px;
  box-shadow: var(--schatten);
}
.quiz-intro { color: var(--text-leise); margin-bottom: 14px; }
.quiz-bestwert {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--akzent);
  margin-bottom: 20px;
}
.quiz-ende h2 { font-size: 1.5rem; margin-bottom: 12px; }
.quiz-ergebnis { font-size: 1.15rem; font-weight: 600; margin-bottom: 8px; }
.quiz-ende .quiz-bestwert { margin: 8px 0 22px; }

.quiz-frage {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 16px;
  padding: 24px 22px;
  box-shadow: var(--schatten);
}
.quiz-frage .fortschritt { margin: 10px 0 18px; }
.quiz-def-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--akzent);
}
.quiz-def {
  font-size: 1.18rem;
  margin: 8px 0 20px;
}
.quiz-optionen {
  display: grid;
  gap: 10px;
}
.quiz-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  font-weight: 600;
  text-align: left;
  padding: 13px 16px;
  border: 1px solid var(--rand);
  border-radius: 10px;
  background: var(--flaeche);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
/* Richtig/falsch nicht nur ueber Farbe anzeigen. */
.quiz-markierung {
  flex: none;
  font-size: 1.05rem;
  font-weight: 700;
}
.quiz-option:hover:not(:disabled) {
  background: #f0f3f7;
  border-color: var(--akzent);
}
.quiz-option:disabled { cursor: default; }
.quiz-option.richtig {
  background: rgba(30, 158, 84, 0.14);
  border-color: var(--gruen);
  color: #136c39;
}
.quiz-option.falsch {
  background: rgba(210, 59, 59, 0.12);
  border-color: var(--rot);
  color: #9c2a2a;
}
#btn-quizweiter { margin-top: 18px; width: 100%; }

/* ---------- Hinweis ---------- */

.hinweis {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.hinweis a { color: var(--akzent); }

/* ---------- Textseiten (Impressum, Datenschutz) ---------- */

/* Ohne eigene Angabe gelten die 960 px aus .inhalt - dieselbe Breite wie
   Karteikarte und Kursverwaltung. */
.text-seite h2 {
  font-size: 1.05rem;
  margin: 26px 0 8px;
}
.text-seite p { margin-bottom: 12px; }
.text-seite ul {
  margin: 0 0 12px 20px;
}
.text-seite li { margin-bottom: 5px; }
.text-seite a { color: var(--akzent); }
.platzhalter {
  background: #fff6e0;
  border: 1px solid #e8c887;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 0.9rem;
  color: #6b4c10;
}
.stand {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--text-leise);
}

/* ---------- Hinweis auf den Geraeteabgleich (Startseite) ---------- */

.sync-hinweis {
  position: relative;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-left: 4px solid var(--akzent);
  border-radius: 12px;
  padding: 18px 46px 18px 20px;
  margin-bottom: 22px;
  box-shadow: var(--schatten);
}
.sync-hinweis-titel {
  font-size: 1rem;
  margin-bottom: 6px;
}
.sync-hinweis-text {
  font-size: 0.9rem;
  color: var(--text-leise);
  margin-bottom: 12px;
  max-width: 62ch;
}
.sync-hinweis .btn { margin-top: 2px; }
.sync-hinweis-zu {
  position: absolute;
  top: 10px;
  right: 12px;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 4px 6px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-leise);
  cursor: pointer;
}
.sync-hinweis-zu:hover { background: var(--bg); color: var(--text); }
/* Bestaetigung nach dem Verbinden: gruen statt Akzentfarbe, ohne Knopf. */
.sync-hinweis-fertig {
  border-left-color: var(--gruen);
  padding-right: 20px;
}
.sync-hinweis-fertig .sync-hinweis-text { margin-bottom: 0; }
.sync-hinweis .sync-formular { margin-top: 12px; }
/* Zusammengeklappt: eine Zeile, die kaum Platz braucht, aber sichtbar
   ueber den Kacheln stehen bleibt. */
.sync-hinweis-klein {
  margin-bottom: 18px;
  font-size: 0.85rem;
}

/* ---------- Geraeteabgleich ---------- */

.sync {
  max-width: 420px;
  margin: 14px auto 0;
}
.sync-zeile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sync-punkt {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gruen);
  flex: none;
}
.sync-link {
  font: inherit;
  font-size: 0.85rem;
  color: var(--akzent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.sync-formular {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 16px;
}
.sync-beschriftung {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.sync-feld {
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  padding: 10px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
}
.sync-feld:focus {
  outline: 2px solid var(--akzent);
  outline-offset: 1px;
}
.sync-einwilligung {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-leise);
  cursor: pointer;
}
.sync-einwilligung input { margin-top: 3px; flex: none; }
/* Der Text ist das zweite und letzte Flex-Kind und darf den Rest fuellen. */
.sync-einwilligung-text { flex: 1; }
.sync-meldung {
  margin-top: 8px;
  font-size: 0.8rem;
  min-height: 1.2em;
}
.sync-ok { color: var(--gruen); }
.sync-fehler { color: var(--rot); }
.sync-warnung { color: #b26a00; }
.sync-laeuft { color: var(--text-leise); }

.fuss-links {
  margin-top: 18px;
  font-size: 0.8rem;
}
.fuss-links a { color: var(--text-leise); }

/* ---------- Responsive ---------- */

@media (max-width: 560px) {
  .hinweis-leiste-inner {
    padding: 10px 16px;
    font-size: 0.78rem;
  }
  .kopf-hub { padding: 32px 18px 26px; }
  .kopf-hub h1 { font-size: 1.6rem; }
  .inhalt { padding: 20px 16px 44px; }
  .kachel-grid { grid-template-columns: 1fr; }
  .karte-text { font-size: 1.3rem; }
  .karte-text-def { font-size: 1.05rem; }
  .bewertung,
  .nav { flex-wrap: wrap; }
  .nav .btn { flex: 1 1 100%; }
  .bewertung .btn { flex: 1 1 calc(50% - 5px); }
}
