@import url('rekapio-farben.css');
@import url('fonts.css');
@import url('konten.css');

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--rk-papier);
  color: var(--rk-tinte);
  font-family: var(--rk-font-text);
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--rk-font-display);
  font-weight: 700;
  /* Space Grotesk laeuft in Displaygroessen leicht negativ (CI-Book Kap. 5). */
  letter-spacing: -0.3px;
  margin: 0 0 8px;
}

a {
  color: var(--rk-petrol);
}

.app-header {
  background: var(--rk-petrol);
  color: var(--rk-papier);
  padding: 20px 24px;
}

/* Dunkelmodus: Petrol hellt zur Akzentfarbe auf und taugt dann nicht mehr als
   grosse Flaeche — die Kopfleiste steht nachts auf dem Karten-Fond. Wie in
   rekapio-farben.css stehen die Werte zweimal (Systemeinstellung und
   Attribut-Schalter); AENDERUNGEN IMMER IN BEIDEN BLOECKEN. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .app-header {
    background: var(--rk-flaeche);
    color: var(--rk-tinte);
    border-bottom: 1px solid var(--rk-linie);
  }
}

[data-theme="dark"] .app-header {
  background: var(--rk-flaeche);
  color: var(--rk-tinte);
  border-bottom: 1px solid var(--rk-linie);
}

/* Beide Fassungen des Kombi-Logos liegen im Markup, sichtbar ist genau eine. */
.grund-dunkel {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .grund-hell {
    display: none;
  }

  :root:not([data-theme="light"]) .grund-dunkel {
    display: inline;
  }
}

[data-theme="dark"] .grund-hell {
  display: none;
}

[data-theme="dark"] .grund-dunkel {
  display: inline;
}

[data-theme="light"] .grund-hell {
  display: inline;
}

[data-theme="light"] .grund-dunkel {
  display: none;
}

.app-header .wrap {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-header .logo {
  height: 48px;
  width: auto;
}

.app-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.karte {
  background: var(--rk-flaeche);
  border-radius: var(--rk-radius);
  box-shadow: var(--rk-schatten);
  padding: 24px;
  margin-top: 16px;
}

.btn-demo {
  display: inline-block;
  background: var(--rk-petrol);
  color: var(--rk-papier);
  border: none;
  border-radius: var(--rk-radius-klein);
  padding: 12px 26px;
  font-weight: 800;
  font-family: var(--rk-font-text);
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}

.btn-demo.sekundaer {
  background: transparent;
  color: var(--rk-petrol);
  box-shadow: inset 0 0 0 2.5px var(--rk-petrol);
}

#blazor-error-ui {
  color-scheme: light only;
  background: var(--rk-fast-fond);
  color: var(--rk-tinte);
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.blazor-error-boundary {
  background: var(--rk-falsch-fond);
  border-radius: var(--rk-radius-klein);
  padding: 1rem;
  color: var(--rk-falsch);
}

.blazor-error-boundary::after {
  content: "Da ist etwas schiefgelaufen.";
}

.loading-progress {
  position: absolute;
  display: block;
  width: 8rem;
  height: 8rem;
  inset: 20vh 0 auto 0;
  margin: 0 auto 0 auto;
}

.loading-progress circle {
  fill: none;
  stroke: var(--rk-linie);
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: var(--rk-petrol);
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: bold;
  inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
  color: var(--rk-tinte);
}

.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "Lädt");
}

/* ---------------------------------------------------------------------------
   Quiz-Verwaltung — Formulare, Listen, Editor.
   Werte kommen aus rekapio-farben.css (Quelle der Wahrheit), hier nur Anordnung.
   CI-Book Kap. 7: Papier-Metapher, Touch-Ziele 48 px, Lerninhalte >= 1.15 rem.
   --------------------------------------------------------------------------- */

.app-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.app-nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  padding: 8px 4px;
  border-bottom: 3px solid transparent;
}

.app-nav a.aktiv {
  border-bottom-color: var(--rk-stern);
}

.logo-link {
  display: inline-flex;
}

.kopfzeile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.kopfzeile h1,
.kopfzeile h2 {
  margin: 0;
}

.kopfzeile-rechts {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nebentext {
  color: var(--rk-tinte-sanft);
  font-size: 0.9rem;
  font-weight: 400;
}

.leer {
  color: var(--rk-tinte-sanft);
}

.meldung-fehler {
  background: var(--rk-falsch-fond);
  color: var(--rk-falsch);
  font-weight: 700;
}

/* Formularfelder */

.feld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  flex: 1 1 240px;
}

.feld label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--rk-tinte-sanft);
}

.eingabe {
  font-family: var(--rk-font-text);
  font-size: 1rem;
  color: var(--rk-tinte);
  background: var(--rk-flaeche);
  border: 2px solid var(--rk-linie);
  border-radius: var(--rk-radius-klein);
  padding: 12px 14px;
  min-height: 48px;
  width: 100%;
}

.eingabe:focus {
  outline: none;
  border-color: var(--rk-petrol);
}

.lerntext {
  font-size: 1.15rem;
}

.zeile-zwei {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.knopfreihe {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.btn-demo:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-demo.gefahr {
  background: var(--rk-falsch);
  color: var(--rk-flaeche);
}

.btn-still {
  background: transparent;
  border: none;
  color: var(--rk-tinte-sanft);
  font-family: var(--rk-font-text);
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--rk-radius-klein);
  min-width: 48px;
  min-height: 48px;
  cursor: pointer;
}

.btn-still:hover:not(:disabled) {
  background: var(--rk-neutral-fond);
  color: var(--rk-tinte);
}

.btn-still:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-still.gefahr {
  color: var(--rk-falsch);
  font-size: 0.9rem;
}

/* Quizliste */

.kartenraster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.quizkarte .zahlen {
  margin: 4px 0 0;
}

.quizkarte .zahl {
  font-family: var(--rk-font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--rk-petrol);
}

.bestaetigung {
  background: var(--rk-falsch-fond);
  border-radius: var(--rk-radius-klein);
  padding: 12px 16px;
  margin-top: 12px;
}

.bestaetigung p {
  margin: 0;
}

/* Editor */

.fragenkopf,
.fragenzeile {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.fragenkopf {
  margin-top: 16px;
  padding: 0 4px 6px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--rk-tinte-sanft);
  border-bottom: 1px solid var(--rk-linie);
}

.fragenzeile {
  padding: 6px 0;
}

.fragenzeile.unfertig .eingabe {
  border-color: var(--rk-fast);
  background: var(--rk-fast-fond);
}

.zeilenknoepfe {
  display: flex;
  gap: 2px;
}

@media (max-width: 620px) {
  .fragenkopf {
    display: none;
  }

  .fragenzeile {
    grid-template-columns: 1fr;
    border-bottom: 1px solid var(--rk-linie);
    padding-bottom: 12px;
  }
}

/* Einfügen aus der Zwischenablage */

.einfuegen {
  background: var(--rk-papier);
  border-radius: var(--rk-radius-klein);
  padding: 16px;
  margin-top: 12px;
}

.einfuegen-feld {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  font-size: 0.95rem;
  min-height: 140px;
}

.vorschau {
  border-collapse: collapse;
  width: 100%;
  margin-top: 8px;
  background: var(--rk-flaeche);
  border-radius: var(--rk-radius-klein);
  overflow: hidden;
}

.vorschau th,
.vorschau td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--rk-linie);
  font-size: 0.95rem;
}

.uebersprungen {
  background: var(--rk-fast-fond);
  border-radius: var(--rk-radius-klein);
  padding: 10px 16px;
  margin-top: 12px;
  font-size: 0.9rem;
}

.uebersprungen p {
  margin: 0 0 4px;
}

.roh {
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  color: var(--rk-tinte-sanft);
}

/* Zuweisung */

.schalterzeile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--rk-linie);
  min-height: 48px;
  cursor: pointer;
}

.schalter {
  width: 28px;
  height: 28px;
  accent-color: var(--rk-petrol);
  cursor: pointer;
}

.schaltername {
  font-weight: 700;
  font-size: 1.15rem;
  flex: 1 1 auto;
}

/* Speicherquittung */

.quittung {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--rk-tinte-sanft);
}

.quittung-punkt {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rk-neutral);
}

.quittung-gut .quittung-punkt {
  background: var(--rk-richtig);
}

.quittung-gut {
  color: var(--rk-richtig);
}

.quittung-laeuft .quittung-punkt {
  background: var(--rk-fast);
}

.quittung-schlecht .quittung-punkt {
  background: var(--rk-falsch);
}

.quittung-schlecht {
  color: var(--rk-falsch);
}

/* ---------------------------------------------------------------------------
   Einstieg der Startseite — CI-Book Kap. 7: Zeichen, Wortmarke, zwei Aktionen.
   --------------------------------------------------------------------------- */

.einstieg {
  text-align: center;
  padding: 24px 0 8px;
}

.einstieg-marke {
  margin: 0;
}

.einstieg-logo {
  width: 100%;
  max-width: 280px;   /* Kombi-Logo: Mindestbreite laut CI 150 px */
  height: auto;
}

.claim {
  font-family: var(--rk-font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.3px;
  margin: 4px 0 0;
}

.einstieg-text {
  max-width: 42ch;
  margin: 8px auto 0;
  color: var(--rk-tinte-sanft);
}
