/**
 * Login-Page — Split-Hero Design
 * Quelle: weventi-design-system/project/ui_kits/backend_desktop/Login_d.jsx (Variant A)
 *
 * Layout: 2-Spalten-Grid, links lila/blau Hero, rechts weiße Form-Spalte.
 * Mobile (< 900px): Hero einklappen, nur Form anzeigen.
 */

/* ============================================================================
 * Base
 * ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 400;
    background: #fff;
    color: #232323;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============================================================================
 * Layout
 * ============================================================================ */
.login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    width: 100%;
    background: #fff;
}

/* ============================================================================
 * Linke Hero-Seite
 * ============================================================================ */
.login-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, var(--color-accent, #8FC2D3) 0%, var(--color-primary, #733168) 75%, var(--color-primary-soft, #5C2753) 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Dekorative Blobs */
.login-hero::before,
.login-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
}
.login-hero::before {
    top: -100px;
    right: -120px;
    width: 340px;
    height: 340px;
    background: rgba(255, 255, 255, 0.08);
}
.login-hero::after {
    bottom: -140px;
    left: -80px;
    width: 300px;
    height: 300px;
    background: rgba(235, 187, 195, 0.18);
}
.login-hero-blob {
    position: absolute;
    top: 30%;
    right: 8%;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(143, 194, 211, 0.3);
    filter: blur(24px);
    z-index: 1;
    pointer-events: none;
}

.login-hero > * {
    position: relative;
    z-index: 2;
}

/* Hintergrundbild aus dem Branding statt Farbverlauf (dunkler Schleier für lesbaren Text) */
.login-hero--image {
    background:
        linear-gradient(180deg, rgba(18, 12, 28, 0.35) 0%, rgba(18, 12, 28, 0.7) 100%),
        var(--login-hero-image) center / cover no-repeat,
        var(--color-primary, #733168);
}
.login-hero--image::before,
.login-hero--image::after,
.login-hero--image .login-hero-blob {
    display: none;
}

/* Logo */
.login-hero-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.login-hero-logo-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
.login-hero-logo-text {
    display: flex;
    align-items: baseline;
}
.login-hero-logo-text span:first-child {
    font-weight: 600;
    font-size: 22px;
    color: #fff;
    letter-spacing: -0.02em;
}
.login-hero-logo-dot {
    width: 5px;
    height: 5px;
    background: #EBBBC3;
    border-radius: 3px;
    margin-left: 3px;
    margin-bottom: 2px;
}

/* Hero-Content (Mitte) */
.login-hero-content {
    max-width: 480px;
}
.login-hero-eyebrow {
    font-weight: 500;
    font-size: 13px;
    opacity: 0.8;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}
.login-hero-headline {
    font-weight: 600;
    font-size: 42px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 18px 0;
}
.login-hero-text {
    font-weight: 400;
    font-size: 15px;
    opacity: 0.85;
    max-width: 440px;
    margin: 0;
    line-height: 1.5;
}

/* Stats-Strip */
.login-hero-stats {
    margin-top: 36px;
    display: flex;
    gap: 36px;
}
.login-hero-stat-value {
    font-weight: 600;
    font-size: 24px;
}
.login-hero-stat-label {
    font-weight: 400;
    font-size: 12px;
    opacity: 0.75;
    margin-top: 2px;
}

/* Trust-Strip (unten) */
.login-hero-trust {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    font-size: 12px;
    opacity: 0.75;
}
.login-hero-avatars {
    display: flex;
}
.login-hero-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 11px;
    margin-left: -8px;
}
.login-hero-avatar:first-child { margin-left: 0; }
.login-hero-avatar-1 { background: linear-gradient(135deg, #EBBBC3, var(--color-primary, #733168)); }
.login-hero-avatar-2 { background: linear-gradient(135deg, var(--color-accent, #8FC2D3), #3D7E95); }
.login-hero-avatar-3 { background: linear-gradient(135deg, #D8A6CD, var(--color-primary, #733168)); }
.login-hero-avatar-4 { background: linear-gradient(135deg, #B5D8E4, #5FA4BC); }

/* ============================================================================
 * Rechte Form-Seite
 * ============================================================================ */
.login-form-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 48px 112px;
    overflow: auto;
    position: relative;
}

.login-form-inner {
    width: 100%;
    max-width: 420px;
    flex: 0 0 auto;
}

.login-form-eyebrow {
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 13px;
    color: var(--color-primary, #733168);
    letter-spacing: 0.04em;
}
.login-form-headline {
    font-weight: 600;
    font-size: 34px;
    color: #1C282D;
    letter-spacing: -0.02em;
    margin: 0 0 28px 0;
}
.login-form-subline {
    font-weight: 400;
    font-size: 14px;
    color: #7B7B7B;
    margin: 0 0 32px 0;
}
.login-form-subline a {
    color: var(--color-primary, #733168);
    font-weight: 500;
    cursor: pointer;
}
.login-form-subline a:hover { text-decoration: underline; }

/* Fehler-Box */
.login-error {
    background: #FFF4F4;
    border: 1px solid #FFD9D9;
    color: #B22A2A;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 13.5px;
    font-weight: 500;
}

/* Input-Field */
.login-field {
    display: block;
    margin-bottom: 16px;
}
.login-field--last {
    margin-bottom: 40px;
}
.login-field-label {
    font-weight: 500;
    font-size: 13px;
    color: #1C282D;
    margin-bottom: 7px;
    display: block;
}
.login-field-input-wrap {
    position: relative;
}
.login-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #7B7B7B;
    transition: color 160ms;
    pointer-events: none;
    display: flex;
}
.login-field-input {
    width: 100%;
    height: 48px;
    border: 1px solid #E3ECF1;
    border-radius: 12px;
    padding: 0 14px 0 42px;
    font: 400 14px 'Poppins', sans-serif;
    background: #fff;
    color: #1C282D;
    outline: none;
    transition: border-color 160ms, box-shadow 160ms;
}
.login-field-input:focus {
    border-color: var(--color-primary, #733168);
    box-shadow: 0 0 0 4px rgba(115, 49, 104, 0.08);
}
.login-field-input:focus ~ .login-field-icon,
.login-field-input-wrap:focus-within .login-field-icon {
    color: var(--color-primary, #733168);
}
.login-field-input.has-error {
    border-color: #C8443C;
}

/* Remember + Forgot Row */
.login-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 28px 0;
}
.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.login-remember input[type="checkbox"] {
    accent-color: var(--color-primary, #733168);
    width: 16px;
    height: 16px;
    cursor: pointer;
}
.login-remember-text {
    font-weight: 400;
    font-size: 13px;
    color: #4A5458;
}
.login-forgot-link {
    font-weight: 500;
    font-size: 13px;
    color: var(--color-primary, #733168);
    cursor: pointer;
}
.login-forgot-link:hover { text-decoration: underline; }

/* Primary Button */
.login-btn-primary {
    width: 100%;
    height: 52px;
    padding: 0 28px;
    font: 600 15px 'Poppins', sans-serif;
    border-radius: 12px;
    border: 0;
    cursor: pointer;
    background: var(--color-primary, #733168);
    color: #fff;
    box-shadow: 0 2px 8px rgba(115, 49, 104, 0.22);
    transition: background 180ms, transform 120ms, box-shadow 180ms;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.login-btn-primary:hover:not(:disabled) {
    background: var(--color-primary-soft, #5C2753);
}
.login-btn-primary:disabled {
    background: #E3ECF1;
    color: #B4B4B4;
    box-shadow: none;
    cursor: not-allowed;
}

/* Divider */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0;
}
.login-divider hr {
    flex: 1;
    height: 1px;
    background: #E3ECF1;
    border: 0;
    margin: 0;
}
.login-divider-text {
    font-weight: 400;
    font-size: 12px;
    color: #7B7B7B;
}

/* Social Buttons */
.login-social-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.login-btn-social {
    height: 48px;
    border-radius: 12px;
    border: 1px solid #E3ECF1;
    background: #fff;
    font-weight: 500;
    font-size: 13.5px;
    color: #1C282D;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 160ms;
}
.login-btn-social:hover { background: #F7FBFD; }

/* Legal-Text */
.login-legal {
    margin-top: 40px;
    font-weight: 400;
    font-size: 11.5px;
    color: #B4B4B4;
    text-align: center;
    line-height: 1.5;
}
.login-legal a {
    color: #7B7B7B;
    text-decoration: underline;
}
.login-legal a:hover { color: var(--color-primary, #733168); }

/* Register-Card (prominenter Call-to-Action am Ende) */
.login-register-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    padding: 16px 20px;
    background: #FAF7F9;
    border: 1px solid #EFE4ED;
    border-radius: 12px;
    text-decoration: none;
    transition: background 160ms, border-color 160ms, transform 120ms;
}
.login-register-card:hover {
    background: #F3EAF1;
    border-color: #E5D2E2;
}
.login-register-card:active {
    transform: scale(0.99);
}
.login-register-card-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.login-register-card-prefix {
    font-weight: 400;
    font-size: 14px;
    color: #4A5458;
}
.login-register-card-link {
    font-weight: 600;
    font-size: 14px;
    color: var(--color-primary, #733168);
}

/* 2-spaltige Form-Row (z.B. Vorname/Nachname auf Register-Page) */
.login-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.login-field-row .login-field {
    margin-bottom: 16px;
}
@media (max-width: 480px) {
    .login-field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Success-State (großer Check-Block statt Form) */
.login-success {
    text-align: center;
    padding: 16px 0;
}
.login-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #A8E6CF 0%, #2E9F6B 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(46, 159, 107, 0.22);
}
.login-success-headline {
    font-weight: 600;
    font-size: 26px;
    color: #1C282D;
    margin: 0 0 12px 0;
    letter-spacing: -0.01em;
}
.login-success-text {
    font-weight: 400;
    font-size: 14.5px;
    color: #4A5458;
    margin: 0 auto 28px;
    max-width: 360px;
    line-height: 1.55;
}
.login-success .login-btn-primary {
    margin-top: 0;
}

/* Back-Link am Anfang einer Page (z.B. "← Zurück zur Anmeldung") */
.login-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #7B7B7B;
    font: 500 13px 'Poppins', sans-serif;
    text-decoration: none;
    margin-bottom: 18px;
    transition: color 160ms;
}
.login-back-link:hover {
    color: var(--color-primary, #733168);
}

/* ============================================================================
 * 2FA-Step
 * ============================================================================ */
.login-2fa-back {
    background: none;
    border: 0;
    color: #7B7B7B;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 0;
}
.login-2fa-back:hover { color: var(--color-primary, #733168); }

.login-2fa-input {
    text-align: center;
    font-size: 22px;
    letter-spacing: 0.4em;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    padding-left: 14px;  /* kein Icon */
}

/* ============================================================================
 * Footer (Sprachauswahl + Copyright)
 * ============================================================================ */
.login-footer {
    position: absolute;
    bottom: 24px;
    left: 48px;
    right: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 400;
    font-size: 12px;
    color: #B4B4B4;
    gap: 16px;
    flex-wrap: wrap;
    row-gap: 8px;
}
.login-footer .legal-links {
    order: -1;
    flex-basis: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 16px;
}
.login-footer .legal-links a {
    color: #7B7B7B;
    text-decoration: none;
}
.login-footer .legal-links a:hover {
    color: var(--color-primary, #733168);
    text-decoration: underline;
}

.login-lang-wrap {
    position: relative;
}
.login-lang-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    color: #7B7B7B;
    font: 500 12.5px 'Poppins', sans-serif;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 160ms;
}
.login-lang-btn:hover {
    background: #F7FBFD;
    color: var(--color-primary, #733168);
}
.login-lang-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: #fff;
    border: 1px solid #E3ECF1;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(28, 40, 45, 0.12);
    padding: 6px;
    min-width: 160px;
    display: none;
    z-index: 10;
}
.login-lang-menu.is-open { display: block; }
.login-lang-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 9px 12px;
    border-radius: 8px;
    font: 500 13px 'Poppins', sans-serif;
    color: #1C282D;
    cursor: pointer;
    transition: background 120ms;
}
.login-lang-item:hover {
    background: #F3EAF1;
    color: var(--color-primary, #733168);
}
.login-lang-item.is-active {
    background: #F3EAF1;
    color: var(--color-primary, #733168);
}

/* ============================================================================
 * Toast (für "Coming Soon" Social etc.)
 * ============================================================================ */
.login-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: #1C282D;
    color: #fff;
    padding: 12px 22px;
    border-radius: 12px;
    font: 500 13.5px 'Poppins', sans-serif;
    box-shadow: 0 12px 40px rgba(28, 40, 45, 0.25);
    opacity: 0;
    transition: transform 240ms cubic-bezier(.2,.6,.2,1), opacity 200ms;
    z-index: 100;
    max-width: 90%;
    text-align: center;
}
.login-toast[aria-hidden="false"] {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================================================
 * Responsive: < 900px → nur Form
 * ============================================================================ */
@media (max-width: 900px) {
    .login-page {
        grid-template-columns: 1fr;
    }
    .login-hero {
        display: none;  /* Mobile: Hero ausblenden, sonst zu viel Scrollen */
    }
    .login-form-wrap {
        padding: 32px 24px 150px;
        min-height: 100vh;
    }
    .login-footer {
        left: 24px;
        right: 24px;
    }
}

@media (max-width: 480px) {
    .login-form-headline { font-size: 28px; }
    .login-form-subline { margin-bottom: 24px; }
}

/* Konto in 30-Tage-Löschfrist: Wiederherstellen anbieten */
.login-error.login-restore { background: #F7F4F7; border-color: #E6DCE5; color: #232323; }

/* Nach mehreren Fehlversuchen: Passwort per E-Mail zurücksetzen */
.login-success-icon--mail { background: linear-gradient(135deg, #B5D8E4 0%, #5FA4BC 100%); box-shadow: 0 8px 24px rgba(95, 164, 188, 0.25); }
.login-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(28, 40, 45, 0.45);
    animation: loginModalFade 180ms ease-out;
}
.login-modal-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 20px;
    padding: 32px 24px 20px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(28, 40, 45, 0.25);
}
.login-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #7B7B7B;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.login-modal-close:hover { background: #F2F2F2; color: #1C282D; }
.login-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary, #733168);
    background: color-mix(in srgb, var(--color-primary, #733168) 12%, #fff);
}
.login-modal-title { font: 600 20px 'Poppins', sans-serif; color: #1C282D; margin: 0 0 8px; }
.login-modal-text { font: 400 14px/1.55 'Poppins', sans-serif; color: #4A5458; margin: 0 0 12px; }
.login-modal-email {
    font: 500 14px 'Poppins', sans-serif;
    color: #1C282D;
    background: #F7F4F7;
    border-radius: 10px;
    padding: 8px 12px;
    margin: 0 0 20px;
    word-break: break-all;
}
.login-modal-secondary {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 0;
    background: none;
    font: 500 14px 'Poppins', sans-serif;
    color: var(--color-primary, #733168);
    text-decoration: none;
    cursor: pointer;
    border-radius: 12px;
}
.login-modal-secondary:hover { background: color-mix(in srgb, var(--color-primary, #733168) 8%, #fff); }
@keyframes loginModalFade { from { opacity: 0; } to { opacity: 1; } }
.login-2fa-backup-toggle { display: inline-block; margin-top: 8px; background: none; border: 0; padding: 0; cursor: pointer; font-family: inherit; }
.login-2fa-backup-toggle[hidden] { display: none; }

/* N01: Pflicht-Checkbox bei der Registrierung (AGB / Datenschutz / mind. 18) */
.login-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 20px;
    font-size: 13px;
    line-height: 1.5;
    color: #4A4A4A;
    cursor: pointer;
    text-align: left;
}
.login-consent input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--color-primary, #733168);
    cursor: pointer;
}
.login-consent a { color: var(--color-primary, #733168); font-weight: 600; text-decoration: underline; }
.login-field--last + .login-consent { margin-top: -16px; }
