/* ==========================================================================
   Anmeldeseiten (login.php, forgot_password.php, reset_password.php)
   Karte: Foto links (Schriftzug + Zitat), Formular rechts.
   Seitenhintergrund = normaler CRM-Hintergrund (kein Foto).
   Wird NACH dem <style> der Seite geladen und überschreibt deren Rahmen.
   ========================================================================== */

body.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: var(--rc-background, var(--color-background));
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 1040px;
    min-height: 640px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    background: var(--rc-surface, var(--color-surface, #fff));
    border-radius: 22px;
}

/* ---------- Bildseite ---------- */
.auth-aside {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 36px 40px 40px;
    color: #fff;
    background: #2a241c;
}

.auth-photo {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 40% 50%;
}

/* Verlauf oben (Schriftzug) und unten (Zitat) für Lesbarkeit */
.auth-aside::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0) 22%),
        linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 38%, rgba(0, 0, 0, 0) 62%);
}

.auth-wordmark {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.3;
    text-transform: uppercase;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
    overflow-wrap: anywhere;
}

.auth-quote {
    margin: 0;
    max-width: 400px;
}

.auth-quote blockquote {
    margin: 0;
    font-size: clamp(26px, 2.7vw, 36px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.auth-quote figcaption {
    margin-top: 14px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
}

/* ---------- Formularseite ---------- */
.auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    min-width: 0;
}

/* Bisherige Einzelkarten der Seiten werden zum schlichten Inhaltsblock */
body.auth-page .auth-main .login-wrap,
body.auth-page .auth-main .login-container,
body.auth-page .auth-main > .container {
    width: 100%;
    max-width: 380px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

body.auth-page .auth-main .logo-section {
    text-align: left;
    margin-bottom: 32px;
}

body.auth-page .auth-main .logo-section h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

/* „Angemeldet bleiben“ links, „Passwort vergessen?“ rechts in einer Zeile */
body.auth-page .auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 20px;
}

body.auth-page .auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
}

body.auth-page .auth-options .forgot-link {
    padding: 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--rc-text, var(--color-title));
}

body.auth-page .footer-text {
    margin-top: 32px;
}

/* ---------- Mobil: Bild als Kopfband, Zitat entfällt ---------- */
@media (max-width: 860px) {
    body.auth-page {
        padding: 16px;
        align-items: flex-start;
    }

    .auth-card {
        grid-template-columns: 1fr;
        min-height: 0;
        max-width: 480px;
        border-radius: 20px;
    }

    .auth-aside {
        min-height: 150px;
        padding: 22px 24px;
        justify-content: flex-end;
        border-radius: 13px;
    }

    .auth-aside::after {
        background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.1) 70%);
    }

    .auth-quote {
        display: none;
    }

    .auth-main {
        padding: 28px 20px 20px;
    }

    body.auth-page .auth-main .logo-section {
        margin-bottom: 24px;
    }

    body.auth-page .auth-main .logo-section h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    body.auth-page {
        padding: 10px;
    }

    .auth-main {
        padding: 24px 14px 16px;
    }
}

body.auth-page .auth-main .logo-section .brand-coop {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Knöpfe auf allen drei Seiten gleich hoch und gleich kräftig wie „Anmelden“ */
body.auth-page .btn-submit {
    padding: 14px;
    font-weight: 600;
}

/* ---------- Meldungen: Symbol links, zarte Fläche, kein Balken; Fehler wackelt kurz ---------- */
body.auth-page :is(.error-message, .success-message, .passkey-error) {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--auth-msg) 22%, transparent);
    border-radius: 12px;
    background: var(--auth-msg-bg);
    color: var(--auth-msg-text);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

body.auth-page :is(.error-message, .passkey-error) {
    --auth-msg: var(--rc-error, #DC5555);
    --auth-msg-bg: var(--rc-error-bg, #FCEDED);
    --auth-msg-text: var(--rc-error-text, #B33A3A);
    animation: auth-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

body.auth-page .success-message {
    --auth-msg: var(--rc-success, #16A36A);
    --auth-msg-bg: var(--rc-success-bg, #EAF7F0);
    --auth-msg-text: var(--rc-success-text, #0E7A4E);
    animation: auth-rise 0.3s ease-out both;
}

/* Symbol: Ausrufezeichen im Kreis bzw. Haken im Kreis, weiß auf Meldungsfarbe */
body.auth-page :is(.error-message, .success-message, .passkey-error)::before {
    content: "";
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: -1px;
    border-radius: 50%;
    background: var(--auth-msg) center / 12px 12px no-repeat;
}

body.auth-page :is(.error-message, .passkey-error)::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 3v3.6'/%3E%3Cpath d='M6 9h.01'/%3E%3C/svg%3E");
}

body.auth-page .success-message::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6.2l2 2 4-4.4'/%3E%3C/svg%3E");
}

body.auth-page .passkey-error {
    margin: 12px 0 0;
}


@keyframes auth-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    body.auth-page :is(.error-message, .success-message, .passkey-error) {
        animation: none;
    }
}

/* Lange Zitate kleiner, damit sie nicht das halbe Foto füllen */
.auth-quote--long blockquote {
    font-size: clamp(21px, 2vw, 26px);
    line-height: 1.2;
}

.auth-quote figcaption {
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ---------- Volle Breite: Foto füllt die linke Hälfte, Formular die rechte (User 04.12.) ---------- */
body.auth-page {
    padding: 0;
    align-items: stretch;
    background: var(--rc-surface, var(--color-surface, #fff));
}

.auth-card {
    max-width: none;
    min-height: 100vh;
    min-height: 100dvh;
    gap: 0;
    padding: 0;
    border-radius: 0;
}

.auth-aside {
    border-radius: 0;
    padding: 48px 56px 56px;
}

.auth-quote {
    max-width: 520px;
}

@media (max-width: 860px) {
    body.auth-page {
        padding: 0;
    }

    .auth-card {
        max-width: none;
        min-height: 100dvh;
        grid-template-rows: auto 1fr;
        border-radius: 0;
    }

    .auth-aside {
        min-height: 180px;
        padding: 22px 24px;
        border-radius: 0;
    }

    .auth-main {
        align-items: flex-start;
        padding: 28px 24px 24px;
    }
}

@media (max-width: 480px) {
    body.auth-page {
        padding: 0;
    }

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

/* Foto mit Abstand zum Rand und runden Ecken; Zitat in dünnerer Schrift (User 04.12.) */
.auth-card {
    padding: 20px;
}

.auth-aside {
    border-radius: 20px;
}

.auth-quote blockquote {
    font-weight: 300;
    letter-spacing: -0.005em;
}

.auth-quote figcaption {
    font-weight: 400;
}

@media (max-width: 860px) {
    .auth-card {
        padding: 14px 14px 0;
    }

    .auth-aside {
        border-radius: 14px;
    }
}
