/* =========================================================
   auth.css – Loginsystem, Registrierung, Kontoverwaltung
   Designsystem: benzinpreis.de-Palette (base.css)
   ========================================================= */

/* -----------------------------------------------------------------------
   Flash-Modal (Erfolg / Fehler / Info)
   ----------------------------------------------------------------------- */
.auth-flash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    cursor: pointer;
}

.auth-flash-modal {
    position: relative;
    min-width: 280px;
    max-width: 420px;
    width: 90vw;
    padding: 22px 24px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    cursor: default;
    font-size: 10pt;
    font-weight: 600;
    line-height: 1.5;
}

.auth-flash-modal--success {
    background: var(--color-bp-green-xlight, #E8F5E4);
    color: var(--color-bp-green-dark, #4A8C3D);
    border-color: var(--color-bp-green-light, #A0D097);
}
.auth-flash-modal--error {
    background: #fff0f0;
    color: #b91c1c;
    border-color: #fca5a5;
}
.auth-flash-modal--info {
    background: var(--color-bp-yellow-bg, #FFFBE0);
    color: var(--color-bp-yellow-dark, #B89A00);
    border-color: var(--color-bp-yellow, #FFE840);
}

.auth-flash-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13pt;
    color: inherit;
    opacity: 0.55;
    line-height: 1;
    padding: 0 2px;
}
.auth-flash-modal__close:hover { opacity: 1; }

.auth-flash-modal__msg {
    margin: 0;
    padding-right: 18px;
}

/* -----------------------------------------------------------------------
   Login-Button im Nav (Header)
   ----------------------------------------------------------------------- */
.auth-nav-btn {
    display: flex;
    align-items: center;
    height: 55px;
    padding: 0 12px;
    font-size: 10.5pt;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    border-left: 2px solid #75ae57;
    margin-left: auto;
    font-family: inherit;
    gap: 5px;
}
.auth-nav-btn:hover {
    background-color: #def3c8;
    text-decoration: none;
    color: #333;
}
.auth-nav-btn--user {
    font-weight: 700;
    color: var(--color-bp-green-dark, #4A8C3D);
}

/* -----------------------------------------------------------------------
   Login-Modal – ergänzende Styles (zusätzlich zu modal.css)
   ----------------------------------------------------------------------- */
.auth-modal-box {
    max-width: 420px !important;
}

.auth-modal__body {
    padding: 20px 24px 24px;
}

@media (max-width: 480px) {
    .auth-modal-box {
        width: 96vw;
        max-width: 96vw;
        max-height: 85vh;
        max-height: 85dvh;
        border-radius: 6px;
        /* Kein Bottom-Sheet: modal bleibt zentriert */
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        margin: auto;
    }
    /* Overlay zurück auf zentriert für Login-Modal */
    #auth-login-modal {
        align-items: center;
    }
    .auth-modal__body {
        padding: 12px 14px 16px;
    }
    .auth-modal__passkey {
        margin-bottom: 4px;
    }
    .auth-modal__register-hint {
        margin-top: 10px;
        padding-top: 10px;
    }
    /* iOS-Zoom beim Tippen verhindern: Input-Schrift mind. 16px */
    .auth-modal-box .auth-form__input {
        font-size: 16px;
    }
}

.auth-modal__register-hint {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e5e7eb;
    font-size: 9pt;
    text-align: center;
    color: var(--color-bp-text-muted, #55566a);
}
.auth-modal__register-hint a {
    color: var(--color-bp-green-dark, #4A8C3D);
    font-weight: 700;
}

/* -----------------------------------------------------------------------
   Auth-Formular (shared – wird im Modal und auf Seiten genutzt)
   ----------------------------------------------------------------------- */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-form--page {
    max-width: 460px;
}

.auth-form--inline {
    max-width: 460px;
    margin-top: 14px;
}

.auth-form__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-form__field--checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

.auth-form__label {
    font-size: 9pt;
    font-weight: 700;
    color: #333;
}

.auth-form__input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--color-bp-border, #d8d9e8);
    border-radius: var(--r-sm, 4px);
    font-family: inherit;
    font-size: 10pt;
    background: #fff;
    transition: border-color .15s;
}
.auth-form__input:focus {
    outline: none;
    border-color: var(--color-bp-green, #62B352);
    box-shadow: 0 0 0 2px rgba(98,179,82,.18);
}
.auth-form__input:invalid:not(:placeholder-shown) {
    border-color: #fca5a5;
}

/* Passwort-Feld mit Toggle-Button */
.auth-form__pw-wrap {
    display: flex;
    gap: 0;
    position: relative;
}
.auth-form__pw-wrap .auth-form__input {
    border-radius: var(--r-sm, 4px) 0 0 var(--r-sm, 4px);
    flex: 1;
}
.auth-form__pw-toggle {
    background: #f4f4f4;
    border: 1px solid var(--color-bp-border, #d8d9e8);
    border-left: none;
    border-radius: 0 var(--r-sm, 4px) var(--r-sm, 4px) 0;
    padding: 0 9px;
    cursor: pointer;
    font-size: 12pt;
    line-height: 1;
    color: #666;
    flex-shrink: 0;
}
.auth-form__pw-toggle:hover { background: #e8e8e8; }

.auth-form__hint {
    font-size: 8pt;
    color: var(--color-bp-text-muted, #55566a);
    margin: 0;
}

/* 2-Spalten-Reihe (Vor- / Nachname) */
.auth-form__row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 480px) {
    .auth-form__row--2col {
        grid-template-columns: 1fr;
    }
}

/* "(optional)" Hinweis neben Label */
.auth-form__optional {
    font-weight: 400;
    font-size: 7.5pt;
    color: var(--color-bp-text-muted, #55566a);
}

.auth-form__checkbox-label {
    font-size: 8.5pt;
    color: #444;
    line-height: 1.5;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    cursor: pointer;
}
.auth-form__checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--color-bp-green, #62B352);
}

.auth-form__remember {
    display: flex;
    align-items: center;
}
.auth-form__check-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 9.5pt;
    color: var(--color-bp-text-muted, #55566a);
    cursor: pointer;
    user-select: none;
}
.auth-form__check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-bp-green, #62B352);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-form__submit {
    padding: 9px 20px;
    background: var(--color-bp-green, #62B352);
    color: #fff;
    border: none;
    border-radius: var(--r-sm, 4px);
    font-family: inherit;
    font-size: 11pt;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    align-self: flex-start;
}
.auth-form__submit:hover { background: var(--color-bp-green-dark, #4A8C3D); }

.auth-form__submit--sm { font-size: 10pt; padding: 6px 16px; }

.auth-form__submit--neutral {
    background: #888;
}
.auth-form__submit--neutral:hover { background: #666; }

.auth-form__submit--danger {
    background: #b91c1c;
}
.auth-form__submit--danger:hover { background: #991b1b; }

.auth-form__links {
    text-align: center;
    font-size: 8.5pt;
}
.auth-form__links a { color: var(--color-bp-text-muted, #55566a); }
.auth-form__links a:hover { color: var(--color-bp-green-dark, #4A8C3D); }

.auth-form__switch {
    font-size: 8.5pt;
    color: var(--color-bp-text-muted, #55566a);
    margin: 0;
}

.auth-req { color: #b91c1c; margin-left: 2px; }

/* -----------------------------------------------------------------------
   Auth-Seiten (Register, Forgot, Reset, Account)
   ----------------------------------------------------------------------- */
.auth-page {
    padding: 16px 0 30px;
    max-width: 600px;
}

.auth-page__sub {
    font-size: 9pt;
    color: var(--color-bp-text-muted, #55566a);
    margin: 0 0 20px;
    border-bottom: 1px solid #E8E8E8;
    padding-bottom: 12px;
}

/* Fehlermeldungen auf Seiten */
.auth-msg {
    padding: 10px 14px;
    border-radius: var(--r-sm, 4px);
    font-size: 9.5pt;
    margin-bottom: 14px;
}
.auth-msg--error {
    background: #fff0f0;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}
.auth-msg--success {
    background: var(--color-bp-green-xlight, #E8F5E4);
    border: 1px solid var(--color-bp-green-light, #A0D097);
    color: var(--color-bp-green-dark, #4A8C3D);
}

/* -----------------------------------------------------------------------
   Konto-Sektionskarten (.acc-card) – lsp-card-Stil für /mein-konto
   ----------------------------------------------------------------------- */
.acc-card {
    background: #fff;
    border: 1px solid #dde3e8;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.acc-card__head {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 11px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    user-select: none;
}
.acc-card__head::-webkit-details-marker { display: none; }
.acc-card__head::after { content: '›'; font-size: 1.1rem; color: #aaa; line-height: 1; transform: rotate(90deg); display: inline-block; transition: transform .15s; }
details[open] > .acc-card__head::after { transform: rotate(-90deg); }
details[open] > .acc-card__head,
.acc-card__head:hover { background-color: #f5f7f9; }

.acc-card--danger { border-color: #dde3e8; }
.acc-card__head--danger { color: #333; }
.acc-card__head--danger::after { color: #aaa; opacity: 1; }
details[open] > .acc-card__head--danger,
.acc-card__head--danger:hover { background-color: #f5f7f9; }

.acc-card__body {
    padding: 11px;
    border-top: 1px solid #eee;
}
.acc-card__body .bp-btn {
    display: block;
    margin-left: auto;
    width: fit-content;
}
.acc-card__row {
    display: flex;
    align-items: baseline;
    padding: 0.45rem 1rem;
    border-bottom: 1px solid #eee;
}
.acc-card__row:last-child { border-bottom: none; }
.acc-card__row-label {
    flex-shrink: 0;
    width: 130px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-bp-text-muted);
}
.acc-card__row-value { font-size: 0.88rem; }

/* -----------------------------------------------------------------------
   DSGVO-Info-Box auf der Registrierungsseite
   ----------------------------------------------------------------------- */
.auth-dsgvo-box {
    margin-top: 24px;
    padding: 14px 16px;
    background: var(--color-bp-yellow-bg, #FFFBE0);
    border: 1px solid var(--color-bp-yellow, #FFE840);
    border-radius: var(--r-md, 8px);
    max-width: 460px;
}

.auth-dsgvo-box__title {
    font-size: 9.5pt;
    font-weight: 700;
    margin: 0 0 8px;
}

.auth-dsgvo-box__list {
    margin: 0;
    padding-left: 18px;
    font-size: 8.5pt;
    color: #555;
    line-height: 1.7;
}

/* -----------------------------------------------------------------------
   Modal-Unterkomponenten (header / body / footer / close-btn)
   – ergänzt modal.css um fehlende Strukturklassen
   ----------------------------------------------------------------------- */
.bp-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--color-bp-border, #d8d9e8);
}

.bp-modal__body {
    padding: 16px 20px;
    font-size: 9.5pt;
    line-height: 1.6;
    color: #333;
    overflow-y: auto;
    max-height: 60vh;
}

.bp-modal__footer {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--color-bp-border, #d8d9e8);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.bp-modal__close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14pt;
    color: #888;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color .15s, background .15s;
}
.bp-modal__close-btn:hover {
    color: #222;
    background: #f0f0f0;
}

/* -----------------------------------------------------------------------
   Datenschutz-Link – Button als Inline-Link
   ----------------------------------------------------------------------- */
.auth-dsgvo-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    color: var(--color-bp-green-dark, #4A8C3D);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.auth-dsgvo-link:hover {
    color: var(--color-bp-green, #62B352);
}

/* Checkbox-Text-Span: inline, fließend */
.auth-form__checkbox-text {
    display: inline;
    line-height: 1.6;
}

/* ============================================================
   Passkey / WebAuthn UI
   ============================================================ */

/* Modal: Passkey-Button oben */
/* Standardmäßig versteckt – passkey.js blendet ein wenn Browser WebAuthn unterstützt */
.auth-modal__passkey,
#section-passkeys {
    display: none;
}
.auth-modal__passkey { margin-bottom: 8px; }

.auth-form__submit--passkey {
    background: #2c3e50;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 2px;
}
.auth-form__submit--passkey:hover { background: #1a252f; }

.auth-modal__divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 4px;
    color: #999;
    font-size: 0.8rem;
}
.auth-modal__divider::before,
.auth-modal__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

/* Status-Meldungen (Reg + Login) */
.passkey-status { min-height: 18px; transition: color 0.2s; }
.passkey-status--ok  { color: #27ae60; }
.passkey-status--err { color: #c0392b; }

/* .passkey-add – sichtbarkeitsgesteuert per passkey.js (setVisible), daher Klasse im Template erhalten */
