/* CASCADOS Partner-Lizenzen: Oberfläche des Partner-Lizenztools (Teil 1, aus dem MVP übernommen).
 *
 * Farben und Schrift verwandt mit dem Auslieferungs-Tool. Orange #f18711 ist die
 * einzige Signalfarbe und bleibt den Hauptaktionen vorbehalten (Anmelden, Schlüssel
 * erzeugen, Erzeugen im Bestätigungsfenster). Kein Grün und kein Türkis, auch nicht
 * für Erfolg: der Normalfall wird neutral dargestellt. Rot nur für Widerrufen,
 * Fehler und Löschendes.
 *
 * Schrift: Systemschrift, keine externe Quelle (Content-Security-Policy default-src 'self').
 */

:root {
  --orange:      #f18711;
  --orange-d:    #e9600e;
  --charcoal:    #3a3a3a;
  --charcoal-2:  #5a5a5a;
  --dark:        #1a1a1a;
  --grau:        #6b6b6a;
  --linie:       #e0e0de;
  --hell:        #f5f5f3;
  --weiss:       #ffffff;
  --gefahr:      #d63b1e;
  --gefahr-text: #a8290f;
  --gefahr-hell: #fdece8;
  --warn-hell:   #fdf3e0;
  --warn-linie:  #f0dcb4;
  --etikett:     #ececea;

  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: Consolas, "SF Mono", Menlo, "Courier New", monospace;

  --radius: 6px;
  --radius-gross: 8px;
  --schatten: 0 1px 3px rgba(58, 58, 58, 0.08), 0 1px 2px rgba(58, 58, 58, 0.06);
  --schatten-hoch: 0 8px 24px rgba(58, 58, 58, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.55;
  color: var(--charcoal);
  background: var(--hell);
  -webkit-font-smoothing: antialiased;
}

body.dialog-offen { overflow: hidden; }

h1, h2, h3, h4 { margin: 0 0 12px 0; font-weight: 600; line-height: 1.25; color: var(--charcoal); }
h1 { font-size: 24px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p { margin: 0 0 12px 0; }
a { color: var(--orange-d); }
a:hover { color: var(--orange); }
code, .mono { font-family: var(--mono); font-size: 13px; }

[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; }

/* Nur für Vorlesegeräte sichtbar */
.nur-leser {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Banner und Meldungsleiste ---------- */

.oben { position: sticky; top: 0; z-index: 60; }

.banner {
  background: var(--warn-hell);
  color: var(--charcoal);
  border-bottom: 1px solid var(--warn-linie);
  padding: 8px 20px;
  font-size: 13px;
  text-align: center;
}

.leisten:empty { display: none; }

.leiste {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px;
  font-size: 14px;
  background: var(--weiss);
  border-bottom: 1px solid var(--linie);
  border-left: 4px solid var(--charcoal-2);
}
.leiste__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.leiste__zu {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.leiste--fehler {
  background: var(--gefahr-hell);
  color: var(--gefahr-text);
  border-bottom-color: var(--gefahr);
  border-left-color: var(--gefahr);
}

/* Leiste im Fenster */
.leisten--dialog { margin: 0 0 14px; }
.leisten--dialog .leiste { border: 1px solid var(--linie); border-left-width: 4px; border-radius: var(--radius); padding: 8px 12px; }
.leisten--dialog .leiste--fehler { border-color: var(--gefahr); }

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

.anmeldung {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.anmeldung__karte { width: 100%; max-width: 420px; box-shadow: var(--schatten-hoch); padding: 32px; }
.anmeldung__hinweis { color: var(--grau); margin-bottom: 20px; }

/* ---------- Kopf und Reiter ---------- */

.kopf {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 20px;
  background: var(--weiss);
  border-bottom: 1px solid var(--linie);
  flex-wrap: wrap;
}
.kopf__titel { margin: 0; font-size: 20px; }
.kopf__rechts { margin-left: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.kopf__info { font-size: 14px; }
.kopf__etikett { color: var(--grau); font-size: 12px; margin-right: 4px; }
.kopf__auswahl { display: flex; align-items: center; gap: 8px; }
.kopf__auswahl label { color: var(--grau); font-size: 12px; }
.kopf__auswahl select { padding: 5px 8px; }

.reiter {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  background: var(--weiss);
  border-bottom: 1px solid var(--linie);
  overflow-x: auto;
}
.reiter a {
  padding: 11px 14px;
  color: var(--charcoal-2);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  font-weight: 500;
}
.reiter a:hover { color: var(--charcoal); background: var(--hell); }
.reiter a[aria-current="page"] { color: var(--dark); border-bottom-color: var(--charcoal); font-weight: 600; }

.inhalt { max-width: 1240px; margin: 0 auto; padding: 24px 20px 48px; }

/* Umschalter und Unterreiter */
.partnerzeile { margin: 0 0 12px; font-size: 14px; color: var(--grau); }
.partnerzeile strong { color: var(--charcoal); }
.umschalter { display: inline-flex; border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; background: var(--weiss); }
.umschalter a {
  padding: 7px 18px;
  color: var(--charcoal-2);
  text-decoration: none;
  font-weight: 500;
}
.umschalter a + a { border-left: 1px solid var(--linie); }
.umschalter a:hover { background: var(--hell); }
.umschalter a[aria-current="page"] { background: var(--charcoal); color: var(--weiss); }

/* ---------- Karten und Raster ---------- */

.karte {
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  box-shadow: var(--schatten);
  padding: 22px;
}
.karte + .karte { margin-top: 16px; }

.zweispaltig { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.zweispaltig .karte + .karte { margin-top: 0; }

.leer { color: var(--grau); padding: 18px 4px; margin: 0; }
.leise { color: var(--grau); font-size: 14px; }
.meta { color: var(--grau); font-size: 14px; }
/* Freitext mit Zeilenumbrüchen (User Data, Bemerkungen), lange Wörter brechen um */
.mehrzeilig { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Formularfelder ---------- */

.feld, fieldset.feld { margin: 0 0 16px 0; padding: 0; border: 0; min-width: 0; }
.feld label, fieldset.feld legend {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 5px;
  padding: 0;
}
.feld__hinweis { color: var(--grau); font-size: 13px; margin-top: 4px; }
.feld__fehler { color: var(--gefahr-text); font-size: 13px; margin-top: 4px; font-weight: 500; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--charcoal);
  background: var(--weiss);
  border: 1px solid #c9c9c6;
  border-radius: var(--radius);
  padding: 8px 10px;
}
input[type="number"] { max-width: 180px; }
input[type="date"] { max-width: 220px; }
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--charcoal); outline-offset: 1px; border-color: var(--charcoal); }
input:disabled, select:disabled, textarea:disabled { background: var(--hell); color: var(--grau); }

.feld--fehler input, .feld--fehler select, .feld--fehler textarea { border-color: var(--gefahr); }
.feld--fehler legend, .feld--fehler > label { color: var(--gefahr-text); }

.feld--haken label { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
/* Liste von Häkchen, zum Beispiel die Erweiterungen beim Erzeugen */
.hakenliste .feld--haken { margin-bottom: 8px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--charcoal); width: 16px; height: 16px; margin: 0; }

/* Auswahlknöpfe (Radio als Knöpfe) */
.wahlgruppe { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl { position: relative; display: block; margin: 0; }
.wahl input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.feld .wahl { font-weight: 500; margin-bottom: 0; }
.wahl span {
  display: block;
  padding: 8px 16px;
  border: 1px solid #c9c9c6;
  border-radius: var(--radius);
  background: var(--weiss);
  color: var(--charcoal);
}
.wahl:hover span { background: var(--hell); }
.wahl input:checked + span { background: var(--charcoal); border-color: var(--charcoal); color: var(--weiss); }
.wahl input:focus-visible + span { outline: 2px solid var(--charcoal); outline-offset: 2px; }
.wahl input:disabled + span { opacity: 0.5; cursor: not-allowed; }

.formsperre { border: 0; margin: 0; padding: 0; min-width: 0; }
.formsperre:disabled { opacity: 0.6; }

.festwerte { margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--linie); }
.festwerte p { margin: 0 0 4px; color: var(--grau); font-size: 14px; }

.zeile { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 12px; }
.zeile .feld { margin-bottom: 0; }
.zeile__text { color: var(--grau); font-size: 14px; }

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

.knopf {
  display: inline-block;
  font: inherit;
  font-weight: 500;
  line-height: 1.3;
  padding: 8px 16px;
  color: var(--charcoal);
  background: var(--weiss);
  border: 1px solid #c9c9c6;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.knopf:hover { background: var(--hell); color: var(--charcoal); }
.knopf:disabled { opacity: 0.5; cursor: not-allowed; }
.knopf--klein { padding: 4px 10px; font-size: 13px; }
.knopf--gross { padding: 11px 22px; font-size: 16px; font-weight: 600; }

/* Hauptaktion: Orange mit dunkler Schrift, weil Weiß auf Orange zu wenig Kontrast hat */
.knopf--primaer { background: var(--orange); border-color: var(--orange); color: var(--dark); font-weight: 600; }
.knopf--primaer:hover { background: var(--orange-d); border-color: var(--orange-d); color: var(--dark); }

.knopf--dunkel { background: var(--charcoal); border-color: var(--charcoal); color: var(--weiss); }
.knopf--dunkel:hover { background: var(--dark); border-color: var(--dark); color: var(--weiss); }

.knopf--gefahr { background: var(--gefahr); border-color: var(--gefahr); color: var(--weiss); font-weight: 600; }
.knopf--gefahr:hover { background: #b9300f; border-color: #b9300f; color: var(--weiss); }

.knopfreihe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- Etiketten ---------- */

.etikett {
  display: inline-block;
  padding: 1px 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  border-radius: 999px;
  background: var(--etikett);
  color: var(--charcoal);
  white-space: nowrap;
}
.etikett--frei { background: var(--weiss); border: 1px solid #c9c9c6; padding: 0 8px; }
.etikett--aktiv { background: #dcdcd9; }
.etikett--gefahr { background: var(--gefahr-hell); color: var(--gefahr-text); }
.etikett--warn { background: var(--warn-hell); border: 1px solid var(--warn-linie); padding: 0 8px; }
.etikett--klein { font-size: 11px; padding: 0 7px; margin-left: 4px; }
.etiketten { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

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

progress.balken {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: var(--linie);
  color: var(--charcoal-2);
  overflow: hidden;
}
progress.balken::-webkit-progress-bar { background: var(--linie); border-radius: 4px; }
progress.balken::-webkit-progress-value { background: var(--charcoal-2); border-radius: 4px; }
progress.balken::-moz-progress-bar { background: var(--charcoal-2); border-radius: 4px; }

.nutzung { margin: 16px 0; padding-top: 14px; border-top: 1px solid var(--linie); }
.nutzung p { margin: 0 0 6px; font-size: 14px; }
.nutzung .balken { margin-bottom: 12px; }

.summe { font-size: 17px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; }
.stapel__zahl { margin: 6px 0 4px; font-weight: 600; }
.stapel__status { margin: 0 0 14px; color: var(--charcoal-2); }

.schluesselfeld {
  font-family: var(--mono);
  font-size: 13px;
  height: 220px;
  max-height: 260px;
  white-space: pre;
  overflow: auto;
  resize: vertical;
}

/* ---------- Tabellen ---------- */

.tabellenrahmen {
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: var(--radius-gross);
  box-shadow: var(--schatten);
  overflow-x: auto;
}
.tabelle { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabelle th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--grau);
  background: var(--hell);
  padding: 9px 12px;
  border-bottom: 1px solid var(--linie);
  white-space: nowrap;
}
.tabelle td { padding: 9px 12px; border-bottom: 1px solid var(--linie); vertical-align: middle; }
.tabelle tbody tr:last-child td { border-bottom: 0; }
.tabelle tr.klickbar { cursor: pointer; }
.tabelle tr.klickbar:hover td { background: var(--hell); }
.tabelle .mono { white-space: nowrap; }
.tabelle .zahl { text-align: right; }
.tabelle .mitte { text-align: center; }
.tabelle--rechte th, .tabelle--rechte td { padding-left: 8px; padding-right: 8px; }
.tabelle--rechte th { white-space: normal; max-width: 92px; vertical-align: bottom; }
.schluessel-link { color: var(--charcoal); font-weight: 600; text-decoration: none; }
.schluessel-link:hover { color: var(--orange-d); text-decoration: underline; }

.seiten { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.seiten__info { font-size: 14px; }
.seiten__summe { margin-left: auto; color: var(--grau); font-size: 13px; }

.filter { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 16px; }
.filter .feld { margin-bottom: 0; }
.filter input[type="search"] { min-width: 260px; }
.filter select { min-width: 190px; }

.kopfzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kopfzeile h2 { margin: 0; }

/* ---------- Lizenz-Detail ---------- */

.detail__kopf { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.schluessel-gross {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--dark);
  overflow-wrap: anywhere;
}

.daten { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px 24px; margin: 0; }
.daten div { min-width: 0; }
.daten dt { font-size: 12px; color: var(--grau); margin-bottom: 2px; }
.daten dd { margin: 0; overflow-wrap: anywhere; }
.daten--eng { grid-template-columns: 1fr; gap: 8px; }

.hinweiskasten {
  background: var(--warn-hell);
  border: 1px solid var(--warn-linie);
  border-left: 4px solid var(--charcoal-2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 16px;
}
.hinweiskasten p:last-child { margin-bottom: 0; }
.hinweiskasten--gefahr { background: var(--gefahr-hell); border-color: var(--gefahr); border-left-color: var(--gefahr); color: var(--gefahr-text); }
.hinweiskasten--gefahr h3 { color: var(--gefahr-text); }

.qlmbox { margin-top: 16px; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--hell); }
.qlmbox summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--charcoal-2); }
.qlmbox .daten { padding: 4px 14px 14px; grid-template-columns: 1fr; }
.qlmbox dd { font-family: var(--mono); font-size: 13px; }

.aktion h3 { margin-bottom: 8px; }
.aktion p { margin-bottom: 10px; }
.aktion--gefahr { border-color: #e6b6ab; }

.rechnerliste { list-style: none; margin: 0; padding: 0; }
.rechnerliste li {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 9px 0;
  border-bottom: 1px solid var(--linie);
}
.rechnerliste li:last-child { border-bottom: 0; }
.rechnerliste__name { font-weight: 600; }
.rechnerliste__info { color: var(--grau); font-size: 13px; flex: 1; min-width: 160px; }

/* ---------- Hilfe ---------- */

.hilfe { max-width: 760px; }
.hilfe h3 { margin-bottom: 6px; }
.hilfe section { margin-bottom: 22px; }
.probe { max-width: 760px; margin-top: 26px; }
.probe__ergebnis { margin-top: 16px; }
.probe__urteil { margin: 14px 0 0; font-weight: 600; }
.probe__urteil--fehler { color: var(--gefahr-text); }

/* ---------- Fenster ---------- */

.dialog-hintergrund {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(26, 26, 26, 0.5);
  overflow-y: auto;
}
.dialog {
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--weiss);
  border-radius: var(--radius-gross);
  box-shadow: var(--schatten-hoch);
}
.dialog:focus { outline: none; }
.dialog--breit { max-width: 720px; }
.dialog__kopf { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.dialog__titel { margin: 0 0 8px; font-size: 18px; }
.dialog__zu { border: 0; background: transparent; font-size: 26px; line-height: 1; padding: 0 4px; cursor: pointer; color: var(--charcoal-2); }
.dialog__zu:hover { color: var(--dark); }
.dialog > .leisten { margin: 8px 22px 0; }
.dialog__koerper { padding: 10px 22px 6px; overflow-y: auto; }
.dialog__fuss { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }

/* ---------- Schmale Fenster ---------- */

@media (max-width: 860px) {
  .zweispaltig { grid-template-columns: minmax(0, 1fr); }
  .inhalt { padding: 18px 14px 40px; }
  .kopf, .reiter { padding-left: 14px; padding-right: 14px; }
  .kopf__rechts { margin-left: 0; width: 100%; }
}

/* ---------- Fußzeile: Impressum und Datenschutz, auf jeder Ansicht (steht in index.html außerhalb von #app) ---------- */

.fuss { border-top: 1px solid var(--linie); padding: 14px 20px; font-size: 13px; text-align: center; }
.fuss__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; }
.fuss a { color: var(--grau); text-decoration: underline; padding: 4px 2px; }
.fuss a:hover { color: var(--charcoal); }
@media (max-width: 860px) {
  .fuss { padding-left: 14px; padding-right: 14px; }
}

/* Zwischenüberschrift in einem Block mit Einstellungen (config, features), klein und grau */
.feld__gruppe { margin: 14px 0 8px; font-size: 13px; font-weight: 600; color: var(--grau); }
.feld__gruppe:first-child { margin-top: 0; }

/* ---------- Teil 1: Anmeldung in Schritten, Startpasswort, Konten ---------- */

.anmeldung__schritt { color: var(--grau); font-size: 13px; margin: -6px 0 16px; }
.anmeldung__karte h1 { margin-bottom: 6px; }
.anmeldung__karte .knopf--breit { width: 100%; justify-content: center; }
.anmeldung__nebenknoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.anmeldung__hilfe { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--linie); font-size: 13px; color: var(--grau); }
.code-eingabe { font-family: var(--mono); font-size: 28px; letter-spacing: 0.4em; text-align: center; max-width: 100%; padding: 10px 12px; }
.regelliste { margin: 0 0 16px; padding-left: 18px; color: var(--grau); font-size: 13px; }

.startpasswort {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: var(--hell);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 10px 0 14px;
  overflow-wrap: anywhere;
  user-select: all;
}

.tabelle .aktionen { display: flex; flex-wrap: wrap; gap: 6px; }
.tabelle .klein { font-size: 13px; color: var(--grau); }
.produktblock { margin: 0 0 12px; padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--radius); background: var(--hell); }
.produktblock h4 { margin: 0 0 8px; }
.produktblock .hakenliste { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.zweispaltig-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 16px; }
.knopf--link { border: 0; background: transparent; color: var(--orange-d); text-decoration: underline; padding: 4px 2px; cursor: pointer; font: inherit; }
.knopf--link:hover { color: var(--orange); background: transparent; }
.knopf--link:disabled { opacity: 0.5; cursor: not-allowed; }
