/* ===========================================================================
   komponenten.css - eigene Klassen des Portals, Praefix mp-.

   Enthaelt keinen einzigen Farbwert und keinen px-Abstand: Alles kommt aus
   tokens.css. Klassen, die nur in einer Komponente vorkommen, gehoeren
   stattdessen in deren <Komponente>.razor.css.
   =========================================================================== */

/* --- Seitenbreiten ------------------------------------------------------
   Statt style="max-width: ..." im Markup: Die geplante CSP verbietet
   unsafe-inline, inline gesetzte Stile funktionieren danach nicht mehr. */

.mp-anmeldung {
    max-width: var(--mp-breite-anmeldung);
    margin: var(--mp-abstand-7) auto;
}

.mp-formular {
    max-width: var(--mp-breite-formular);
}

.mp-liste {
    max-width: var(--mp-breite-liste);
}

.mp-lesetext {
    max-width: var(--mp-breite-lesetext);
}

/* --- Lead-Absatz -------------------------------------------------------- */

.mp-lead {
    font-size: var(--mp-schrift-l);
    color: var(--mp-text-leise);
    max-width: var(--mp-breite-lesetext);
}

/* --- Hinweisboxen -------------------------------------------------------
   Vier Arten, Aufbau immer gleich: farbiger Balken links, dann der Text.
   Im Dunkelmodus traegt allein der Balken den Status - die Flaechentokens
   fallen dort auf die normale Flaeche zurueck (siehe tokens.css). */

.mp-hinweis {
    border: 1px solid var(--mp-linie);
    border-left-width: 3px;
    border-radius: var(--mp-radius);
    padding: var(--mp-abstand-4);
    margin-bottom: var(--mp-abstand-4);
    background-color: var(--mp-flaeche);
    color: var(--mp-text);
}

.mp-hinweis > :last-child {
    margin-bottom: 0;
}

.mp-hinweis-titel {
    font-weight: 600;
    display: block;
}

.mp-hinweis--erfolg {
    background-color: var(--mp-erfolg-flaeche);
    border-color: var(--mp-erfolg-rand);
    color: var(--mp-erfolg-text);
}

.mp-hinweis--warnung {
    background-color: var(--mp-warnung-flaeche);
    border-color: var(--mp-warnung-rand);
    color: var(--mp-warnung-text);
}

.mp-hinweis--fehler {
    background-color: var(--mp-fehler-flaeche);
    border-color: var(--mp-fehler-rand);
    color: var(--mp-fehler-text);
}

.mp-hinweis--info {
    background-color: var(--mp-hinweis-flaeche);
    border-color: var(--mp-hinweis-rand);
    color: var(--mp-hinweis-text);
}

/* Technische Fehlertexte - etwa die Antwort eines SMTP-Servers - gehoeren
   vollstaendig in die Box. Ein Mailproblem, das nur im Containerlog steht,
   kostet Stunden. */
.mp-hinweis pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
    font-size: var(--mp-schrift-s);
}

/* --- Zustandspillen -----------------------------------------------------
   Der Text steht immer da. Eine Pille, die nur aus einem farbigen Punkt
   besteht, ist fuer einen Teil der Nutzer leer. */

.mp-zustandspille {
    display: inline-flex;
    align-items: center;
    gap: var(--mp-abstand-1);
    border-radius: var(--mp-radius-pille);
    padding: var(--mp-abstand-1) var(--mp-abstand-3);
    font-size: var(--mp-schrift-xs);
    font-weight: 600;
    background-color: var(--mp-flaeche-leise);
    color: var(--mp-text-leise);
    border: 1px solid var(--mp-linie);
}

.mp-zustandspille::before {
    content: "";
    width: var(--mp-abstand-2);
    height: var(--mp-abstand-2);
    border-radius: var(--mp-radius-pille);
    background-color: currentColor;
}

.mp-zustandspille--erfolg {
    background-color: var(--mp-erfolg-flaeche);
    border-color: var(--mp-erfolg-rand);
    color: var(--mp-erfolg-text);
}

.mp-zustandspille--warnung {
    background-color: var(--mp-warnung-flaeche);
    border-color: var(--mp-warnung-rand);
    color: var(--mp-warnung-text);
}

.mp-zustandspille--fehler {
    background-color: transparent;
    border-color: var(--mp-fehler-rand);
    color: var(--mp-fehler-text);
}

.mp-zustandspille--info {
    background-color: var(--mp-hinweis-flaeche);
    border-color: var(--mp-hinweis-rand);
    color: var(--mp-hinweis-text);
}

/* --- Formularvalidierung ------------------------------------------------
   Blazor setzt diese Klassen selbst. Farben aus den Statustokens statt aus
   dem Template-Rot/Gruen. */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--mp-erfolg-rand);
}

.invalid {
    outline: 1px solid var(--mp-fehler-rand);
    border-color: var(--mp-fehler-rand);
}

.validation-message {
    color: var(--mp-fehler-text);
    font-size: var(--mp-schrift-s);
    display: block;
    margin-top: var(--mp-abstand-1);
}

/* --- QR-Code der Zwei-Faktor-Einrichtung --------------------------------
   Das SVG kommt ohne feste Groesse aus dem Erzeuger. */

.mp-qr-code {
    max-width: 15rem;
}

.mp-qr-code svg {
    width: 100%;
    height: auto;
    display: block;
}

/* --- Wiederherstellungscodes -------------------------------------------- */

.mp-codeliste {
    max-width: 26rem;
}

/* --- Fehlergrenze des Frameworks ---------------------------------------- */

.blazor-error-boundary {
    background: var(--mp-fehler-rand);
    padding: var(--mp-abstand-4);
    color: var(--mp-text-invers);
    border-radius: var(--mp-radius);
}

.blazor-error-boundary::after {
    content: "Es ist ein Fehler aufgetreten.";
}

/* --- Formularabschnitt zum Anlegen -------------------------------------- */

.mp-abschnitt {
    margin-top: var(--mp-abstand-6);
    padding: var(--mp-abstand-5);
    background-color: var(--mp-flaeche);
    border: 1px solid var(--mp-linie);
    border-radius: var(--mp-radius);
    box-shadow: var(--mp-schatten);
}

/* Pflicht ist der Normalfall; optionale Felder werden markiert - das spart das
   Sternchen-Rauschen an Formularen, in denen ohnehin fast alles Pflicht ist. */
.optional {
    font-weight: 400;
    color: var(--mp-text-leise);
    font-size: var(--mp-schrift-s);
}

/* --- Brotkrumenpfad ----------------------------------------------------- */

.brotkrumen {
    font-size: var(--mp-schrift-s);
    color: var(--mp-text-leise);
    margin-bottom: var(--mp-abstand-2);
}

.brotkrumen a {
    color: var(--mp-marke-700);
}

/* --- Tabellenrahmen ausserhalb der Datenliste --------------------------- */

.tabellenrahmen {
    overflow-x: auto;
}

fieldset legend {
    font-size: var(--mp-schrift-l);
    font-weight: 600;
    margin-bottom: var(--mp-abstand-3);
}

/* --- Beteiligtenliste eines Mietverhaeltnisses -------------------------- */

.beteiligte {
    list-style: none;
    margin: 0;
    padding: 0;
}

.beteiligte li {
    display: flex;
    align-items: center;
    gap: var(--mp-abstand-2);
    padding: var(--mp-abstand-2) 0;
    border-bottom: 1px solid var(--mp-linie);
}

/* --- Umschalter ueber einer Liste --------------------------------------- */

.ansichtswahl {
    margin-bottom: var(--mp-abstand-4);
}

/* --- Kennzahlenliste (Definitionsliste) --------------------------------- */

.kennzahlen {
    display: grid;
    grid-template-columns: minmax(10rem, auto) 1fr;
    gap: var(--mp-abstand-2) var(--mp-abstand-4);
    margin: 0;
}

.kennzahlen dt {
    font-weight: 600;
    color: var(--mp-text-leise);
}

.kennzahlen dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

/* --- Kachelreihe der Startseite ----------------------------------------- */

.kacheln {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mp-abstand-4);
    margin-bottom: var(--mp-abstand-6);
}

/* --- Handlungsreihe ------------------------------------------------------
   Mehrere gleichrangige Schaltflaechen nebeneinander, die bei schmalem
   Fenster umbrechen statt aus dem Bild zu laufen. */

.mp-handlungen {
    display: flex;
    flex-wrap: wrap;
    gap: var(--mp-abstand-3);
}

/* --- Befehl zum Kopieren -------------------------------------------------
   Ein Shell-Befehl, den jemand markiert und kopiert. Er bricht bewusst um
   statt seitlich zu scrollen: Ein unsichtbares Stueck Befehl waere beim
   Kopieren von Hand die haeufigste Fehlerquelle. */

.mp-befehl {
    padding: var(--mp-abstand-3);
    background: var(--mp-flaeche-leise);
    border: 1px solid var(--mp-linie);
    border-radius: var(--mp-radius);
    font-family: var(--mp-schrift-fest);
    font-size: var(--mp-schrift-s);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    user-select: all;
}

/* Feste Schriftbreite im Fliesstext - Fingerabdruecke, Pfade, Kennungen. Dort
   muss "l" von "1" unterscheidbar sein, weil jemand sie abgleicht. */

.mp-fest {
    font-family: var(--mp-schrift-fest);
    font-size: var(--mp-schrift-s);
    overflow-wrap: anywhere;
}

/* --- Fortschritt ---------------------------------------------------------
   Das native <progress>-Element. Ein eigener Balken bekaeme seine Breite nur
   ueber ein style-Attribut, und das schliesst die Content-Security-Policy
   aus - siehe docs/02-recht-und-datenschutz.md. */

.mp-fortschritt {
    display: block;
    width: 100%;
    max-width: 32rem;
    height: 0.75rem;
    margin-bottom: var(--mp-abstand-2);
    border: none;
    border-radius: var(--mp-radius-pille);
    background: var(--mp-flaeche-leise);
    /* Firefox faerbt ueber die Randfarbe, WebKit und Blink ueber die
       Pseudoelemente darunter. Beide Wege sind noetig. */
    color: var(--mp-marke-700);
    accent-color: var(--mp-marke-700);
}

.mp-fortschritt::-webkit-progress-bar {
    border-radius: var(--mp-radius-pille);
    background: var(--mp-flaeche-leise);
}

.mp-fortschritt::-webkit-progress-value {
    border-radius: var(--mp-radius-pille);
    background: var(--mp-marke-700);
}

.mp-fortschritt::-moz-progress-bar {
    border-radius: var(--mp-radius-pille);
    background: var(--mp-marke-700);
}

/* --- Fusszeile -----------------------------------------------------------
   Impressum und Datenschutz auf jeder Seite. Zurueckhaltend gesetzt, aber
   nicht versteckt: Verlangt ist "leicht erkennbar und unmittelbar
   erreichbar", und das schliesst grau auf grau in 10 px aus. */

.fusszeile {
    display: flex;
    gap: var(--mp-abstand-4);
    margin-top: var(--mp-abstand-6);
    padding-top: var(--mp-abstand-3);
    border-top: 1px solid var(--mp-linie);
    font-size: var(--mp-schrift-s);
}
