/* Büromanagement-Lernplattform — ein Stylesheet, keine Abhängigkeiten. */

:root {
  --grund: #f6f7f9;
  --flaeche: #ffffff;
  --flaeche-2: #eef1f5;
  --rand: #d6dbe3;
  --rand-stark: #b6bec9;
  --text: #1b2028;
  --text-leise: #5c6675;
  --akzent: #1f5f9c;
  --akzent-hell: #e6eff8;
  --gut: #1d7a4c;
  --gut-hell: #e3f4ea;
  --warn: #9a6206;
  --warn-hell: #fdf1dc;
  --fehler: #a72c2c;
  --fehler-hell: #fbe9e9;
  --radius: 10px;
  --schatten: 0 1px 2px rgba(20, 28, 40, 0.06), 0 3px 12px rgba(20, 28, 40, 0.05);
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='hell']) {
    --grund: #14171c;
    --flaeche: #1c2027;
    --flaeche-2: #242a33;
    --rand: #333a45;
    --rand-stark: #4a5361;
    --text: #e6e9ee;
    --text-leise: #a0aab8;
    --akzent: #6aa8e0;
    --akzent-hell: #1d2c3b;
    --gut: #5cc48c;
    --gut-hell: #16301f;
    --warn: #e0ac54;
    --warn-hell: #33280f;
    --fehler: #e88b8b;
    --fehler-hell: #35191a;
    --schatten: 0 1px 2px rgba(0, 0, 0, 0.3), 0 3px 12px rgba(0, 0, 0, 0.25);
  }
}

:root[data-theme='dunkel'] {
  --grund: #14171c;
  --flaeche: #1c2027;
  --flaeche-2: #242a33;
  --rand: #333a45;
  --rand-stark: #4a5361;
  --text: #e6e9ee;
  --text-leise: #a0aab8;
  --akzent: #6aa8e0;
  --akzent-hell: #1d2c3b;
  --gut: #5cc48c;
  --gut-hell: #16301f;
  --warn: #e0ac54;
  --warn-hell: #33280f;
  --fehler: #e88b8b;
  --fehler-hell: #35191a;
  --schatten: 0 1px 2px rgba(0, 0, 0, 0.3), 0 3px 12px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--grund);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.9em; }
a { color: var(--akzent); }

/* --- Gerüst ---------------------------------------------------------------- */

.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}

.kopf-innen {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.marke {
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.marke span { color: var(--text-leise); font-weight: 400; font-size: 0.85em; }

.navigation { display: flex; gap: 0.15rem; flex-wrap: wrap; flex: 1; }

.navigation a {
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-leise);
  font-size: 0.94rem;
  white-space: nowrap;
}
.navigation a:hover { background: var(--flaeche-2); color: var(--text); }
.navigation a[aria-current='page'] { background: var(--akzent-hell); color: var(--akzent); font-weight: 550; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 5rem; }
main.schmal { max-width: 780px; }

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

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--schatten);
  margin-bottom: 1rem;
}

.raster { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.raster-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.reihe { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.reihe-ende { margin-left: auto; }
.stapel { display: flex; flex-direction: column; gap: 0.6rem; }

.leise { color: var(--text-leise); }
.klein { font-size: 0.88rem; }
.mitte { text-align: center; }

button, .knopf {
  font: inherit;
  font-weight: 550;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--rand-stark);
  background: var(--flaeche);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
button:hover:not(:disabled), .knopf:hover { border-color: var(--akzent); color: var(--akzent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.haupt, .knopf.haupt {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #fff;
}
button.haupt:hover:not(:disabled), .knopf.haupt:hover { filter: brightness(1.1); color: #fff; }

button.gefahr { color: var(--fehler); border-color: var(--fehler); }
button.gefahr:hover:not(:disabled) { background: var(--fehler-hell); color: var(--fehler); }

input[type='text'], input[type='email'], input[type='password'], input[type='number'],
input[type='date'], input[type='search'], select, textarea {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rand-stark);
  border-radius: var(--radius);
  background: var(--flaeche);
  color: var(--text);
  width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}
textarea { min-height: 8rem; resize: vertical; }
label { display: block; font-weight: 550; font-size: 0.92rem; margin-bottom: 0.25rem; }
.feld { margin-bottom: 0.9rem; }

.marke-etikett {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--flaeche-2);
  color: var(--text-leise);
  font-size: 0.78rem;
  font-weight: 550;
  white-space: nowrap;
}
.marke-etikett.akzent { background: var(--akzent-hell); color: var(--akzent); }
.marke-etikett.gut { background: var(--gut-hell); color: var(--gut); }
.marke-etikett.warn { background: var(--warn-hell); color: var(--warn); }
.marke-etikett.fehler { background: var(--fehler-hell); color: var(--fehler); }

.hinweis {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--rand);
  background: var(--flaeche-2);
  margin-bottom: 1rem;
}
.hinweis.warn { background: var(--warn-hell); border-color: var(--warn); color: var(--warn); }
.hinweis.fehler { background: var(--fehler-hell); border-color: var(--fehler); color: var(--fehler); }
.hinweis.gut { background: var(--gut-hell); border-color: var(--gut); color: var(--gut); }

.balken {
  height: 8px;
  border-radius: 999px;
  background: var(--flaeche-2);
  overflow: hidden;
}
.balken > div { height: 100%; background: var(--akzent); border-radius: 999px; }
.balken > div.gut { background: var(--gut); }
.balken > div.warn { background: var(--warn); }
.balken > div.fehler { background: var(--fehler); }

.zahl { font-size: 1.9rem; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; }
.zahl-klein { font-size: 1.3rem; font-weight: 650; }

table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rand); }
th { font-weight: 600; color: var(--text-leise); font-size: 0.85rem; }
.tabelle-rollt { overflow-x: auto; }

/* --- Lernkarte ------------------------------------------------------------- */

.lernkarte {
  min-height: 11rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: 1.15rem;
  padding: 2rem 1.25rem;
}
.lernkarte .rueckseite { border-top: 1px solid var(--rand); margin-top: 1.2rem; padding-top: 1.2rem; }
.lernkarte .hinweistext { color: var(--text-leise); font-size: 0.92rem; margin-top: 0.8rem; }

.bewertung { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.bewertung button { flex-direction: column; gap: 0.1rem; padding: 0.6rem 0.4rem; }
.bewertung button small { font-weight: 400; color: var(--text-leise); font-size: 0.78rem; }
.bewertung button:nth-child(1):hover { border-color: var(--fehler); color: var(--fehler); }
.bewertung button:nth-child(4):hover { border-color: var(--gut); color: var(--gut); }

/* --- Fragen ---------------------------------------------------------------- */

.frage { border-left: 3px solid var(--rand); padding-left: 1rem; }
.frage.richtig { border-left-color: var(--gut); }
.frage.teils { border-left-color: var(--warn); }
.frage.falsch { border-left-color: var(--fehler); }

.wahl { display: flex; flex-direction: column; gap: 0.4rem; }
.wahl label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}
.wahl label:hover { border-color: var(--akzent); }
.wahl label.gewaehlt { border-color: var(--akzent); background: var(--akzent-hell); }
.wahl label.loesung { border-color: var(--gut); background: var(--gut-hell); }
.wahl label.daneben { border-color: var(--fehler); background: var(--fehler-hell); }
.wahl input { width: auto; margin-top: 0.25rem; flex: none; }

.zuordnung-zeile {
  display: grid;
  grid-template-columns: 1fr auto minmax(11rem, 0.8fr);
  gap: 0.6rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rand);
}
.zuordnung-zeile:last-child { border-bottom: none; }

.schritte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.schritte li {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  background: var(--flaeche);
}
.schritte li .nummer {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--flaeche-2);
  color: var(--text-leise);
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 650;
}
.schritte li .text { flex: 1; }
.schritte li button { padding: 0.2rem 0.45rem; font-size: 0.85rem; }

.stichpunkte { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.stichpunkte label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 400;
  margin: 0;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  cursor: pointer;
}
.stichpunkte label.abgehakt { border-color: var(--gut); background: var(--gut-hell); }
.stichpunkte input { width: auto; flex: none; margin-top: 0.3rem; }

/* --- Prüfungsuhr ----------------------------------------------------------- */

.uhr-leiste {
  position: sticky;
  top: 3.1rem;
  z-index: 15;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  box-shadow: var(--schatten);
}
.uhr { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; }
.uhr.knapp { color: var(--warn); }
.uhr.gleich-vorbei { color: var(--fehler); }

.frageleiste { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.frageleiste button {
  width: 2rem;
  height: 2rem;
  padding: 0;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}
.frageleiste button.beantwortet { background: var(--akzent-hell); border-color: var(--akzent); color: var(--akzent); }
.frageleiste button.aktuell { outline: 2px solid var(--akzent); outline-offset: 1px; }

/* --- Lerntext -------------------------------------------------------------- */

.lerntext h2 { margin-top: 1.6rem; font-size: 1.15rem; }
.lerntext h2:first-child { margin-top: 0; }
.lerntext ul, .lerntext ol { padding-left: 1.4rem; }
.lerntext li { margin-bottom: 0.35rem; }
.lerntext table { margin: 0.8rem 0; }
.lerntext code { background: var(--flaeche-2); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }

/* --- Übersicht der Lerntage ------------------------------------------------ */

.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; overflow-x: auto; padding-bottom: 0.4rem; }
.heatmap i { width: 11px; height: 11px; border-radius: 2px; background: var(--flaeche-2); display: block; }
.heatmap i[data-stufe='1'] { background: color-mix(in srgb, var(--akzent) 30%, var(--flaeche-2)); }
.heatmap i[data-stufe='2'] { background: color-mix(in srgb, var(--akzent) 55%, var(--flaeche-2)); }
.heatmap i[data-stufe='3'] { background: color-mix(in srgb, var(--akzent) 78%, var(--flaeche-2)); }
.heatmap i[data-stufe='4'] { background: var(--akzent); }

.saeulen { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.saeulen i { flex: 1; background: var(--akzent); border-radius: 2px 2px 0 0; min-height: 2px; display: block; }

/* --- Anmeldung ------------------------------------------------------------- */

.anmelde-seite { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.anmelde-karte { width: 100%; max-width: 27rem; }

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

#meldung {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(34rem, calc(100vw - 2rem));
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--grund);
  box-shadow: var(--schatten);
  display: none;
}
#meldung.sichtbar { display: block; }
#meldung.fehler { background: var(--fehler); color: #fff; }

.laedt { color: var(--text-leise); padding: 2rem 0; text-align: center; }

@media (max-width: 620px) {
  .bewertung { grid-template-columns: repeat(2, 1fr); }
  .zuordnung-zeile { grid-template-columns: 1fr; }
  .uhr-leiste { top: 0; }
}
