@font-face {
    font-family: BARMERBeatScreen;
    src: url('../fonts/BARMERBeatScreen-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: BARMERBeatScreen;
    src: url('../fonts/BARMERBeatScreen-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: BARMERBeatScreen;
    src: url('../fonts/BARMERBeatScreen-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: BARMERBeatScreen;
    src: url('../fonts/BARMERBeatScreen-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

html, body {
    margin: 0;
    background: #fff;
    color: #212121;
    font-family: BARMERBeatScreen, system-ui, sans-serif;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
button, input, select, .mud-typography { font-family: inherit; }
a { color: #6b25c5; }

/* Ladebildschirm der Host-Startseite bis zum Start des Clients. Er erscheint verzögert, damit ein Start aus dem
   Browsercache nicht aufblitzt. */
.app-loading { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: #fff; animation: app-loading-appear 0.3s ease-out 0.25s both; }
/* Der Client fügt seine erste Ausgabe vor dem Ladebildschirm ein; dieser verschwindet dadurch im selben Bild, auch auf
   Seiten ohne Seitengerüst. */
.app-loading:not(:first-child) { display: none; }
.app-loading-content { display: flex; flex-direction: column; align-items: center; gap: 32px; width: min(280px, 70vw); }
.app-loading-logo { display: block; width: 100%; height: auto; }
.app-loading-bar { width: 100%; height: 8px; overflow: hidden; border-radius: 90px; background: #ece5fb; }
/* Blazor meldet den Fortschritt beim Herunterladen der Clientdateien als --blazor-load-percentage am html-Element. Der
   Mindestwert zeigt sofort, dass der Start begonnen hat. */
.app-loading-fill { position: relative; width: max(6%, var(--blazor-load-percentage, 0%)); height: 100%; overflow: hidden; border-radius: inherit; background: #8739f4; transition: width 0.3s ease-out; }
/* Nach dem Herunterladen steht der Balken während des Laufzeitstarts auf 100 %; der Glanz zeigt, dass der Start weiterläuft. */
.app-loading-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent); transform: translateX(-100%); animation: app-loading-shine 1.4s ease-in-out infinite; }
@keyframes app-loading-appear { from { opacity: 0; } }
@keyframes app-loading-shine { to { transform: translateX(100%); } }

.portal-page { display: flex; flex-direction: column; min-height: 100vh; }
.portal-container { width: min(900px, calc(100% - 48px)); margin-inline: auto; }
.portal-header { padding-block: 30px 23px; }
/* Logo und Portaltitel stehen links, der Sprachwechsel bleibt auf jeder Bildschirmbreite oben rechts. */
.brand-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "logo title language"; align-items: center; gap: 20px; }
.brand-row > a { display: inline-flex; grid-area: logo; }
.brand-logo { display: block; width: 160px; height: auto; }
/* Das Grau der bisherigen Anwendung (#818181) erreicht für diese Schriftgröße nicht den Mindestkontrast von 4,5 : 1. */
.portal-title { grid-area: title; color: #6d6d6d; font-size: 22.5px; font-weight: 300; }
.language-switch { grid-area: language; display: flex; gap: 8px; }
.language-option.mud-button-root { min-width: 0; min-height: 40px; padding: 6px 14px; border-radius: 90px; text-transform: none; box-shadow: none; }
.language-option .mud-button-label { gap: 8px; }
.language-flag { display: block; width: 21px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }

.step-navigation { background: #ebfcee; }
/* Reicht die Breite nicht, brechen die Schritte um, statt den aktuellen Schritt aus dem sichtbaren Bereich zu schieben. */
.step-list { display: flex; flex-wrap: wrap; align-items: center; list-style: none; padding: 15px 0; gap: 6px 17px; }
.step-list li { display: flex; align-items: center; gap: 12px; color: #525252; white-space: nowrap; }
.step-list li[aria-current='step'] > span { color: #212121; border-bottom: 3px solid #6b25c5; }
.step-chevron { width: 20px; height: 20px; color: #525252; }

.portal-main { flex: 1; padding-block: 36px 54px; }
.page-intro h1 { margin: 0 0 40px; font-size: 25px; font-weight: 900; line-height: 1.35; }
.page-intro h2 { margin: 0 0 12px; font-size: 20px; font-weight: 700; line-height: 1.4; }
.page-intro p { margin: 0; font-size: 18px; line-height: 1.5; }
.login-content { display: grid; grid-template-columns: 1fr 320px; gap: 70px; margin-top: 48px; }
.login-form { width: 100%; max-width: 340px; padding-top: 25px; }
.order-number-group { margin-bottom: 25px; }
.order-number-group > label, .birth-date-group > legend { display: block; margin-bottom: 9px; font-weight: 700; font-size: 18px; }
.birth-date-group { padding: 0; margin: 0 0 24px; border: 0; min-width: 0; }
/* Die Platzhalter sind die sichtbaren Beschriftungen von Tag, Monat und Jahr; die Spalten teilen sich die Formularbreite,
   damit „Monat“ auch mit erhöhtem Zeichenabstand (WCAG 1.4.12) nicht abgeschnitten wird. */
.date-fields { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.1fr) minmax(0, 1.05fr); gap: 8px; }
.date-field { min-width: 0; }
.login-form .mud-input { min-height: 52px; font-size: 18px; color: #525252; }
.login-form .mud-input-outlined-border { border-color: #8f8f8f; border-radius: 16px; }
.login-form .mud-input-outlined:hover .mud-input-outlined-border { border-color: #525252; }
.login-form .mud-input-control { margin-top: 0; }
.login-form .mud-input.mud-input-outlined .mud-input-slot { padding: 12px 16px; }
.login-form .mud-select .mud-input.mud-input-outlined { padding-right: 0; }
.login-form .mud-select .mud-input.mud-input-outlined .mud-input-slot { padding-inline: 12px 0; }
.login-form .mud-input input.mud-input-root::placeholder { color: #6d6d6d; opacity: 1; }
.login-form .mud-input-adornment-end { margin-inline: 0 12px; }
.login-form .mud-input-adornment-end .mud-icon-root { width: 18px; height: 18px; }
.login-form .mud-input-control-helper-container { padding-inline: 0; }
.login-form .mud-input-helper-text { font-size: 13px; line-height: 1.4; }
.login-form .mud-input-helper-text.mud-input-error, .validation-message { color: #b3261e; }
.date-error .validation-message { margin-top: 8px; font-size: 14px; }
.login-button.mud-button-root { min-height: 48px; padding: 12px 25px; border-radius: 90px; text-transform: none; box-shadow: none; }
.required-note { margin: 16px 0 0; color: #525252; font-size: 13px; }
.portal-notice { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid #ed6c02; border-radius: 16px; color: #663c00; font-size: 14px; line-height: 1.5; }
.portal-notice .notice-icon { width: 22px; height: 22px; flex-shrink: 0; color: #ed6c02; }
.login-form .portal-notice { margin-top: 24px; }
.flow-end-notice { margin-top: 32px; }
.login-help h2 { margin: 0 0 6px; font-weight: 700; font-size: 14px; line-height: 1.5; }
.login-help p { margin: 0; font-size: 14px; line-height: 1.5; }
.order-number-example { display: block; width: 100%; height: auto; margin-top: 16px; }

.portal-footer { margin-top: 10px; padding-block: 16px 40px; background: #f2f0e5; }
.footer-content { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.footer-content nav { display: flex; gap: 30px; }
.footer-content a, .footer-content p { margin: 0; color: #212121; font-size: 12px; text-decoration: none; }
.footer-content a:hover { text-decoration: underline; }

.visually-hidden, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 2000; padding: 12px; background: #fff; color: #6b25c5; border: 2px solid currentColor; }
a:focus-visible { outline: 2px solid #8739f4; outline-offset: 4px; }
/* MudBlazor zeigt den Tastaturfokus einer Schaltfläche nur als schwache Tönung; der Rahmen macht ihn deutlich sichtbar. */
.mud-button-root:focus-visible { outline: 2px solid #8739f4; outline-offset: 2px; }
/* Bei Checkboxen erhält das unsichtbare Eingabeelement den Fokus; der Rahmen erscheint deshalb um das sichtbare Kästchen,
   nach innen versetzt, damit er die Beschriftung nicht berührt. */
.mud-checkbox .mud-icon-button:has(.mud-checkbox-input:focus-visible) { outline: 2px solid #8739f4; outline-offset: -3px; }
/* Hauptbereich und Schrittüberschrift erhalten den Fokus nur als Ziel von Sprunglink und Seitenwechsel; sie sind keine
   Bedienelemente und bleiben deshalb ohne Fokusrahmen. */
.portal-main:focus, .page-intro h2:focus { outline: none; }

@media (max-width: 900px) {
    .step-list { gap: 6px 8px; font-size: 14px; }
    .step-list li { gap: 6px; }
    .step-chevron { width: 16px; height: 16px; }
    .login-content { grid-template-columns: minmax(280px, 1fr) minmax(240px, 300px); gap: 40px; }
}

@media (max-width: 680px) {
    html, body { font-size: 16px; }
    .portal-container { width: calc(100% - 40px); }
    .portal-header { padding-block: 24px; }
    .brand-row { gap: 14px; }
    .brand-logo { width: 135px; }
    .portal-title { font-size: 19px; }
    .step-list { gap: 4px 10px; padding-block: 12px; font-size: 14px; }
    .portal-main { padding-block: 28px 38px; }
    .page-intro h1 { font-size: 24px; line-height: 1.3; margin-bottom: 24px; }
    .page-intro h2 { font-size: 18px; }
    .page-intro p { font-size: 16px; }
    .login-content { grid-template-columns: 1fr; gap: 40px; margin-top: 30px; }
    .login-form { max-width: 400px; padding-top: 0; }
    .order-number-group > label, .birth-date-group > legend { font-size: 16px; }
    .login-form .mud-input { font-size: 16px; }
    .date-fields { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr) minmax(0, 1.05fr); gap: 8px; }
    .login-form .mud-select .mud-input.mud-input-outlined .mud-input-slot { padding-inline: 8px 0; }
    .login-form .mud-select .mud-input-adornment-end { margin-inline-end: 6px; }
    .login-form .mud-select .mud-input-adornment-end .mud-icon-root { width: 16px; height: 16px; }
    .login-help { max-width: 320px; }
    .footer-content { flex-direction: column; gap: 20px; }
    .portal-footer { padding-block: 20px 30px; }
}

/* Unter 390 Pixeln fehlt neben Logo und Sprachwechsel der Platz für den Titel; er rückt in eine eigene Zeile. */
@media (max-width: 389px) {
    .brand-row { grid-template-columns: auto auto; grid-template-areas: "logo language" "title title"; justify-content: space-between; row-gap: 8px; }
}

/* Im Kontrastmodus ersetzt der Browser Hintergrundfarben; Rahmen und Systemfarbe halten den Ladebalken sichtbar. */
@media (forced-colors: active) {
    .app-loading-bar { border: 1px solid CanvasText; }
    .app-loading-fill { forced-color-adjust: none; background: Highlight; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
