/* =====================================================================
   Abo-Portal (Patris-Webkomponente <lh-patris-webcomponent>) – NIAG und LOOK
   Geladen nur auf /abo/ über das Fragment niag/abo.php (Module 48 und 50).
   Marke über #patris_wrapper[data-brand="niag|look"].

   Die eigentlichen Ursachen liegen beim Hersteller der Komponente:
     https://abo.niag.de/prod/kunden/kundenportal-styles.css (+ -external-styles.css)
     https://abo.look-busreisen.de/prod/look/kunden/kundenportal-styles.css (+ -external-styles.css)
   Nach jedem Update der Komponente gegenprüfen.
   Barrierefreiheit: Quickfix vom 29.10.2026, PDF "NIAG_LOOK_Abo_Barrierefreiheits-Check".
   ===================================================================== */

/* ---------- Theme NIAG ----------
   Variablen am :root mit !important, weil die Komponente sie als Inline-Style am <html> setzt. */
:root:has(#patris_wrapper) {
    --lh-gray6: #e3ebf1 !important;
}
:root:has(#patris_wrapper[data-brand="niag"]) {
    --lh-gray60: #5b6573 !important;      /* Labels 5,9:1 statt 4,4:1 (Befund 2) */
    --lh-toast-info: #005a9c !important;  /* Info-Meldung 7,1:1 (Befund 10) */
    --lh-toast-error: #b33f00 !important; /* Fehlermeldung 5,8:1 statt 3,0:1 */
    /* Textfarben: Die Komponente nimmt seit einem Update --lh-toast-*-text (Vorgabe Schwarz) –
       auf dem abgedunkelten Rot wären das nur 2,4:1. Weiß 5,8:1. */
    --lh-toast-error-text: #fff !important;
    /* --lh-toast-success bleibt Gelb (#f3f707) mit schwarzer Schrift: 19:1 */
}
/* Fokusfarbe der Marke – am :root, damit sie auch für die Karten über dem Portal gilt */
:root:has(#patris_wrapper[data-brand="niag"]) {
    --abo-focus: #0066b3;
    --abo-active: #4fb848; /* NIAG-Grün */
}
:root:has(#patris_wrapper[data-brand="look"]) {
    --abo-focus: #125042;
    --abo-active: #ffad00; /* LOOK-Orange – Grün wäre auf den dunkelgrünen Buttons nicht zu sehen */
}

/* ---------- Theme LOOK ----------
   Variablen direkt am Container; die Meldungen liegen innerhalb, ein :root greift hier nicht. */
#patris_wrapper[data-brand="look"] {
    --lh-white: #ffffff;
    --lh-primary-light: #125042 !important;
    --lh-primary: #05164d !important;
    --lh-primary-dark: #125042 !important;
    --lh-secondary: #ffffff;
    --lh-accent: #ffad00;
    --lh-accent-light: #ffdd95;
    --lh-gray80: #333333;
    --lh-gray60: #5b6573;          /* war #787878 – Labels 5,9:1 (Befund 2) */
    --lh-gray25: #dde6e3;
    --lh-gray12: #eeeeee;
    --lh-gray6: #f4f4f4;
    --lh-red: #a32222;
    --lh-yellow: #f3f707;
    --lh-green: rgb(9, 123, 15);
    --lh-green-light: #86ca86;
    --lh-background-shadow: 0 2px 4px rgba(0, 0, 0, .5);
    --yellow-primary: var(--lh-primary);
    --lh-toast-info: #1f6f8b;      /* Info-Meldung 5,7:1 statt 2,1:1 (L1) */
    --lh-toast-error: #a8322d;     /* Fehlermeldung 6,7:1 statt 4,0:1 */
    --lh-toast-success: #2e7031;   /* Erfolgsmeldung 6,0:1 statt 2,5:1 */
    /* Textfarben passend zu den dunklen Gründen (Komponente: Vorgabe Schwarz) */
    --lh-toast-info-text: #fff !important;
    --lh-toast-error-text: #fff !important;
    --lh-toast-success-text: #fff !important;
}
#patris_wrapper[data-brand="look"] .p-steps .p-steps-item.p-highlight .p-steps-number,
#patris_wrapper[data-brand="look"] lh-patris-webcomponent .lh-button--filled,
#patris_wrapper[data-brand="look"] lh-patris-webcomponent .lh-custom-photo-uploader .p-fileupload-buttonbar .p-button {
    background-color: #125042 !important;
}
#patris_wrapper[data-brand="look"] lh-patris-webcomponent .lh-button--filled:active,
#patris_wrapper[data-brand="look"] lh-patris-webcomponent .lh-custom-photo-uploader .p-fileupload-buttonbar .p-button:active {
    background-color: #000 !important;
}
#patris_wrapper[data-brand="look"] lh-patris-webcomponent .lh-radio-button--blue .lh-checked {
    background-color: #409683 !important;
}

/* ---------- Layout (beide Marken) ---------- */
#patris_wrapper > .uk-container {
    position: relative;
}
/* Nichts unter der festen Kopfzeile (80px, uk-sticky show-on-up) verschwinden lassen: weder das Ziel nach
   Klick auf eine Einstiegs-Karte noch ein Feld, das beim Zurück-Tabben in den Blick gescrollt wird (WCAG 2.4.11) */
html:has(#patris_wrapper) {
    scroll-padding-top: 100px;
}
#patris_wrapper:focus {
    outline: none;
}
#patris_wrapper lh-patris-webcomponent {
    position: relative;
    clear: both;
}
#patris_wrapper lh-patris-webcomponent .lh-header-content-fixed,
#patris_wrapper lh-patris-webcomponent .lh-header__sticky {
    z-index: 1;
    box-shadow: none;
    transition: none;
}
#patris_wrapper .lh-label-title {
    display: block;
    clear: both;
}
#patris_wrapper lh-patris-webcomponent hr {
    border: 0;
    height: 1px;
    background: #0066b3;
}
#patris_wrapper .lh__produkt,
#patris_wrapper lh-patris-webcomponent .lh-input__input {
    font-size: 1rem;
}
#patris_wrapper .p-card {
    background: #fff;
    color: #495057;
    box-shadow: 0 1px 15px rgba(0, 0, 0, .08);
    border-radius: 0;
}
#patris_wrapper .p-card .p-card-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: .5rem;
    background: #0066b3;
    color: #fff;
    padding-left: 10px;
}
#patris_wrapper lh-patris-webcomponent .lh-panel--calculated-height {
    height: auto;
}
#patris_wrapper lh-patris-webcomponent .lh-panel.p-3.lh-panel--calculated-height {
    width: 100%;
}
#patris_wrapper lh-patris-webcomponent .lh-container {
    padding-right: .9375rem;
    padding-left: .9375rem;
    max-width: 100%;
    margin: 0 auto;
}
#patris_wrapper .lh-modal-body {
    padding-top: 80px;
}
#patris_wrapper fieldset {
    box-shadow: 0 1px 1px rgba(0, 0, 0, .08);
    border: 1px solid #eee;
}
#patris_wrapper lh-patris-webcomponent .lh-content-container {
    margin: 3% 0 0;
    background-color: transparent;
    padding: 0;
}
/* von Angular erzeugtes Attribut – ändert sich ggf. mit Updates der Komponente */
#patris_wrapper [_nghost-lh-webcomponent-c229] {
    position: relative !important;
    background-color: transparent;
    display: block;
    margin: 0;
}
#patris_wrapper lh-patris-webcomponent .lh-container-abo,
#patris_wrapper lh-patris-webcomponent .lh-container-tarifzonen {
    display: flex;
    flex-direction: column;
    height: auto;
    justify-content: flex-start;
    align-items: flex-start;
}

/* ---------- Barrierefreiheit (beide Marken) ---------- */
/* Transparenz aus kundenportal-external-styles.css (.p-toast{opacity:.9}) aufheben (Befund 10 / L1) */
.p-toast {
    opacity: 1 !important;
}
/* Icon und Schließen-× der Meldung auf dunklem Grund lesbar */
.p-toast .p-toast-message .p-toast-message-icon,
.p-toast .p-toast-message .p-toast-icon-close {
    color: #fff !important;
}
/* Sichtbarer Tastaturfokus: Radio-Buttons (Befund 9 / L2) und Auswahlfelder (Befund 8 / L2) */
#patris_wrapper lh-patris-webcomponent .lh-radio-button__input:focus-visible ~ .lh-radio-button__radio {
    outline: 3px solid var(--abo-focus, #0066b3);
    outline-offset: 2px;
}
#patris_wrapper lh-patris-webcomponent .lh-input__input:focus-visible {
    outline: 3px solid var(--abo-focus, #0066b3) !important;
    outline-offset: 1px;
    box-shadow: none;
}
/* Buttons („Weiter“ …): Die Komponente setzt keine Schrift, es bleibt die Browser-Vorgabe
   (13,3px Arial, in Safari noch kleiner). Schrift der Seite in normaler Größe. */
#patris_wrapper lh-patris-webcomponent .lh-button,
#patris_wrapper lh-patris-webcomponent .lh-custom-photo-uploader .p-fileupload-buttonbar .p-button {
    font-family: inherit;
    font-size: 1rem;
}
/* Schrittanzeige: Die kommenden Schritte waren per opacity .6 auf 2,3:1 verblasst (WCAG 1.4.3).
   Volle Deckkraft, Text in Grau 5,9:1, Kreis als Umriss – unterscheidet sich vom aktuellen Schritt
   nicht nur durch die Farbe. */
#patris_wrapper lh-patris-webcomponent .p-steps .p-steps-item.p-disabled {
    opacity: 1;
}
#patris_wrapper lh-patris-webcomponent .p-steps .p-steps-item.p-disabled .p-steps-title {
    color: #5b6573;
}
#patris_wrapper lh-patris-webcomponent .p-steps .p-steps-item.p-disabled .p-steps-number {
    background: #fff;
    color: #5b6573;
    border: 2px solid #5b6573;
}

/* ---------- Einstiegs-Karten über dem Portal (Links auf #patris/…) ---------- */
@media (max-width: 639px) {
    a.uk-button[href*="#patris/"] {
        width: 100%;
    }
}
a.uk-button[href*="#patris/"]:focus-visible {
    outline: 3px solid var(--abo-focus, #0066b3);
    outline-offset: 3px;
}
/* Strich unten: hell = andere Ansicht, Markenfarbe = gerade offene Ansicht (aria-current) */
a.uk-button[href*="#patris/"] {
    box-shadow: inset 0 -5px 0 rgba(255, 255, 255, .35);
}
a.uk-button[href*="#patris/"][aria-current="page"] {
    box-shadow: inset 0 -5px 0 var(--abo-active, #4fb848);
}

/* Sichtbarer Tastaturfokus für Knöpfe, Links und Aufklapp-Köpfe im Portal (Test 12.11.2026:
   „Abmelden“ u. a. ohne Fokusrahmen) */
#patris_wrapper lh-patris-webcomponent :is(button, a, [role="button"], [role="link"], th[tabindex], tr[tabindex]):focus-visible {
    outline: 3px solid var(--abo-focus, #0066b3) !important;
    outline-offset: 2px;
}
