/* ============================================================
   HENBRAIN — Kundenbereich (Anmeldung, Bestellung, Brains)
   Ergaenzt style.css und wird NUR von den Seiten der Web-App geladen.
   Bewusst eine eigene Datei: Aenderungen hier koennen die Landingpage
   nicht veraendern.
   ============================================================ */

/* Klassen mit eigenem display (.knopf, .kopierzeile) hoben das hidden-Attribut auf —
   versteckte Knoepfe und Felder waren dadurch sichtbar, bevor das Skript sie freigab. */
[hidden] { display: none !important; }

.konto main section { padding: 3rem 0 4.5rem; }
.konto h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.6rem; }
.konto-unterzeile { color: var(--text-secondary); max-width: 62ch; margin-bottom: 2rem; }
.zurueck { display: inline-block; font-size: 0.9rem; margin-bottom: 1.25rem; }

/* ── Hinweise ─────────────────────────────────────────── */
.hinweis {
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--text-primary);
  padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); font-size: 0.95rem;
  margin: 0 0 1.75rem;
}
/* Statusfarben Hentecs (Tim 13.11.2026): Fläche #198539 bzw. #C7171E, Text weiß */
.hinweis--ok { background: #198539; border-color: #198539; color: #FFFFFF; }
.hinweis--warn { background: #FBF6EC; border-color: #EAD9B3; color: #5C4200; }
.hinweis strong { font-weight: 600; }
.err { margin: 0 0 1.25rem; }

/* ── Anmelden / Registrieren ─────────────────────────── */
.auth { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 860px) { .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr); gap: 3.5rem; } }
.auth-karte {
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius-md);
  padding: 2rem; max-width: 480px;
}
.auth-karte .formular { margin-top: 1.25rem; max-width: none; }
.auth-karte h2 { margin-top: 0; }
.auth-seite {
  border-top: 2px solid var(--akzent); padding-top: 1.25rem; max-width: 420px;
}
.auth-seite h3 { margin-bottom: 0.5rem; }
.auth-seite p { font-size: 0.97rem; }
.auth-klein { font-size: 0.85rem; color: var(--text-muted); margin-top: 1.25rem; }

/* ── Formulare ───────────────────────────────────────── */
.formular .feldhilfe { font-size: 0.85rem; color: var(--text-muted); margin: 0.35rem 0 0; }
.formular button[disabled] { opacity: 0.5; cursor: not-allowed; }
/* .formular .haken statt .haken: muss die Label-Regel aus style.css (display:block) schlagen. */
.formular .haken {
  display: flex; gap: 0.7rem; align-items: flex-start; margin: 1rem 0 0;
  font-size: 0.93rem; font-weight: 400 !important; color: var(--text-secondary) !important;
  line-height: 1.5; cursor: pointer;
}
.formular .haken input { width: 1.1rem; height: 1.1rem; margin: 0.15rem 0 0; flex: none; accent-color: var(--akzent); }
.feldgruppe {
  border: 1px solid var(--linie); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem 1.25rem;
  margin: 1.75rem 0 0; background: var(--flaeche);
}
.feldgruppe legend { font-weight: 600; font-size: 0.95rem; padding: 0 0.4rem; color: var(--text-primary); }
.feldgruppe p { font-size: 0.9rem; margin: 0.25rem 0 0; }
.feldgruppe label:first-of-type { margin-top: 0.9rem; }
.code-eingabe {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace !important;
  font-size: 1.35rem !important; letter-spacing: 0.18em; text-transform: uppercase;
}

/* ── Bestellung ──────────────────────────────────────── */
.bestellung { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 900px) { .bestellung { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 3.5rem; } }
.bestellung .formular { max-width: 520px; margin-top: 0; }
.zusammenfassung {
  background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius-md);
  padding: 1.75rem; box-shadow: var(--schatten);
}
@media (min-width: 900px) { .zusammenfassung { position: sticky; top: 1.5rem; } }
.zusammenfassung h3 { margin-bottom: 1rem; }
.preiszeilen { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.preiszeilen td { padding: 0.55rem 0; border-bottom: 1px solid var(--linie); vertical-align: top; color: var(--text-secondary); }
.preiszeilen td:last-child { text-align: right; white-space: nowrap; color: var(--text-primary); padding-left: 1rem; }
.preiszeilen tr.summe td { border-bottom: 0; padding-top: 0.9rem; font-weight: 600; color: var(--text-primary); }
.zusammenfassung .kleingedruckt { font-size: 0.85rem; color: var(--text-muted); margin: 1rem 0 0; }

/* ── Übersicht ───────────────────────────────────────── */
.uebersicht { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 960px) { .uebersicht { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 3rem; } }
.brainliste { display: grid; gap: 1rem; }
.brainzeile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 1rem; align-items: center;
  border: 1px solid var(--linie); border-radius: var(--radius-md); padding: 1.25rem 1.4rem;
  background: var(--karte); color: inherit; text-decoration: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Gleiche Spezifitaet wie die Textlink-Regel in style.css, spaeter geladen — gewinnt. */
.konto main a.brainzeile { border: 1px solid var(--linie); }
.konto main a.brainzeile:hover { border-color: rgba(0, 0, 0, 0.3); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06); }
.brainzeile .brainbild {
  grid-column: 1 / -1; width: 56px; height: 56px; object-fit: cover; border-radius: 50%;
  margin-bottom: 0.15rem;
}
.brainzeile h3 { margin: 0; font-size: 1.1rem; }
.brainzeile .brainzahlen { grid-column: 1 / -1; font-size: 0.9rem; color: var(--text-muted); margin: 0; }
.brainzeile .pfeil { color: var(--text-muted); font-size: 1.1rem; }
.leer {
  border: 1px dashed rgba(0, 0, 0, 0.2); border-radius: var(--radius-md); padding: 2rem;
  text-align: left; background: var(--flaeche);
}
.leer h3 { margin-bottom: 0.4rem; }
.aktionen { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.5rem; }

/* ── Statuspillen ────────────────────────────────────── */
.pille {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 500;
  padding: 0.22rem 0.65rem; border-radius: 999px; background: var(--flaeche);
  border: 1px solid var(--linie); color: var(--text-secondary); white-space: nowrap;
}
.pille::before { content: ""; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: currentColor; }
.pille--bereit { color: #FFFFFF; background: #198539; border-color: #198539; }
.pille--arbeit { color: #5C4200; background: #FBF6EC; border-color: #EAD9B3; }
.pille--fehler { color: #FFFFFF; background: #C7171E; border-color: #C7171E; }

/* ── Brain-Detail ────────────────────────────────────── */
.brainkopf { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; margin-bottom: 0.4rem; }
.brainkopf h2 { margin: 0; }
.abschnitt { border-top: 1px solid var(--linie); padding-top: 2rem; margin-top: 2.5rem; }
.abschnitt > h3 { font-size: 1.2rem; margin-bottom: 0.4rem; }
.abschnitt > p { max-width: 64ch; }
.feld { margin-top: 1.25rem; max-width: 640px; }
.feld-titel {
  display: block; font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 0.4rem;
}
.kopierzeile { display: flex; gap: 0.5rem; align-items: stretch; }
.kopierzeile .schluessel-kasten { flex: 1; min-width: 0; display: flex; align-items: center; }
.kopierzeile pre.schluessel { flex: 1; min-width: 0; margin: 0; }
.abschnitt > .kopierzeile { margin: 0.4rem 0 1.4rem; }

/* Schluesselanzeige: Serveradresse, Zugangs- und Rettungsschluessel gleich gross
   (vorher 0.88rem gegen 1.05rem, Hilfetexte ausserhalb von Formularen ungestylt). */
.konto .schluessel-kasten, .konto pre.schluessel {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1rem; line-height: 1.5;
  letter-spacing: 0.02em; padding: 0.95rem 1.1rem; margin: 0; word-break: break-all;
}
.abschnitt .feldhilfe { font-size: 0.9rem; color: var(--text-muted); margin: 0.5rem 0 0; }
/* Der Rettungsschluessel ist der wichtigste: roter Grund, dunkle Schrift (Kontrast ~11:1). */
.konto pre.schluessel--rettung {
  background: #FDE8E8; border: 2px solid #8A1F1F; color: #4A0C0C; font-weight: 600;
}
.knopf--klein { font-size: 0.85rem; padding: 0.5rem 0.9rem; cursor: pointer; font-family: inherit; }
.verdeckt { filter: blur(5px); user-select: none; }
.passkeyliste { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.passkeyliste li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem;
  padding: 0.75rem 0; border-top: 1px solid var(--linie);
}
.passkeyliste li:first-child { border-top: 0; }
.passkeyliste li > span:first-child { font-weight: 500; }
.passkeyliste li > form { margin-left: auto; }
@media (max-width: 580px) {
  .kopierzeile { flex-wrap: wrap; }
  .kopierzeile .schluessel-kasten, .kopierzeile pre.schluessel { flex-basis: 100%; }
}

.kennzahlen { display: grid; gap: 1rem; margin-top: 1.5rem; }
@media (min-width: 720px) { .kennzahlen { grid-auto-flow: column; grid-auto-columns: 1fr; } }
.kennzahl {
  border: 1px solid var(--linie); border-radius: var(--radius-md); padding: 1.25rem 1.35rem;
  background: var(--karte);
}
.kennzahl-titel { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 0.35rem; }
.kennzahl-wert { font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--text-primary); margin: 0; }
.kennzahl-neben { font-size: 0.85rem; color: var(--text-muted); margin: 0.5rem 0 0; }
.balken { height: 6px; border-radius: 999px; background: #EDEDED; overflow: hidden; margin-top: 0.85rem; }
.balken > span { display: block; height: 100%; background: var(--akzent); border-radius: inherit; }
.balken--warn > span { background: #9A6700; }
.stand { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.9rem; }
.empfehlung { margin-top: 1.25rem; }
.empfehlung p { margin-bottom: 0.9rem; }

.gefahr { border-top-color: #F3C9C9; }
.knopf--gefahr { background: #C7171E; border-color: #C7171E; color: #FFFFFF; }
.knopf--gefahr:hover { background: #9E1218; border-color: #9E1218; }
button.knopf { cursor: pointer; font-family: inherit; line-height: inherit; }

/* ── Dialog (Löschen, 1. Bestätigung) ────────────────── */
dialog.dialog {
  border: 0; border-radius: var(--radius-md); padding: 0; max-width: min(92vw, 460px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25); color: var(--text-primary);
}
dialog.dialog::backdrop { background: rgba(18, 18, 18, 0.5); }
.dialog-innen { padding: 1.75rem 1.75rem 1.5rem; }
.dialog-innen h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.dialog-innen p { font-size: 0.97rem; }
.dialog-innen .aktionen { justify-content: flex-end; margin-top: 1.5rem; }

/* ── Fuss im Kundenbereich ───────────────────────────── */
.konto .fuss { padding: 2rem 0; }
.konto .fuss-reihen { margin-bottom: 1rem; }

/* --- Echtbetrieb 18.09.2026: Bestellung, Schluessel, Pflichtangaben --- */

/* § 312j Abs. 3 BGB: Die Pflichtangaben muessen unmittelbar ueber dem Bestellknopf
   stehen und hervorgehoben sein — deshalb abgesetzte Flaeche statt Fliesstext. */
.pflichtangaben {
  margin: 1.75rem 0 1rem; padding: 1rem 1.15rem;
  border: 1px solid var(--linie); border-left: 3px solid var(--akzent);
  border-radius: var(--radius-sm); background: var(--flaeche);
}
.pflichtangaben p { margin: 0 0 0.6rem; font-size: 0.92rem; line-height: 1.55; }
.pflichtangaben p:last-child { margin-bottom: 0; }

/* Werbeeinwilligung sichtbar vom Vertrag getrennt (Koppelungsverbot). */
.formular .haken--getrennt {
  margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--linie);
}

/* Die einmalige Schluesselanzeige: gross, monospace, umbruchfaehig. */
pre.schluessel {
  margin: 0.4rem 0 1.4rem; padding: 0.95rem 1.1rem;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem;
  letter-spacing: 0.02em; background: var(--flaeche); border: 1px solid var(--linie);
  border-radius: var(--radius-sm); white-space: pre-wrap; word-break: break-all;
  -webkit-user-select: all; user-select: all;
}

/* Menuepunkt "Konto" im Kopf: bleibt auch auf dem Handy sichtbar (.nav-herkunft nicht). */
.nav-konto { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); text-decoration: none;
  padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.nav-konto:hover { border-bottom-color: var(--text-primary); }
.kuendigung { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--linie); }
.kuendigung h4 { margin: 0 0 0.5rem; font-size: 1rem; }
.kuendigung p { font-size: 0.92rem; }
.kuendigung .aktionen { margin-top: 1rem; }

/* Dokumente nach Jahr gruppiert. */
.dokumentjahr { border-top: 1px solid var(--linie); padding: 0.55rem 0; }
.dokumentjahr:last-of-type { border-bottom: 1px solid var(--linie); }
.dokumentjahr summary { cursor: pointer; font-weight: 600; }
.dokumentliste { list-style: none; margin: 0.5rem 0 0.2rem; padding: 0; }
.dokumentliste li { padding: 0.25rem 0; }
