/**
 * Talent Scope — Login-Branding (v75)
 * Version: 1.0.4
 *
 * v75-fix3: Glas-Box-Blur-Slider entfernt — der WordPress-Login-Layer
 *   überschreibt unseren backdrop-filter mit eigener Spezifität, wir hatten
 *   keine Hoheit darüber. Wert bleibt fest auf 16px (bewährter Standardwert).
 *   Hintergrundbild-Blur (0-30px) bleibt einstellbar — der funktioniert
 *   sauber, weil er auf einem eigenen Pseudo-Element-Layer liegt.
 *
 * v75: Hintergrundbild-Blur einstellbar — als filter:blur am ::before-Bild-Layer.
 *   Bild liegt jetzt auf einem Pseudo-Element (statt direkt am body),
 *   damit der Inhalt der Seite vom Blur unbeeinflusst bleibt.
 *   ::after dient als dunkler Overlay zwischen Bild und Inhalt für Lesbarkeit.
 *
 * v74-fix2: Glasmorphism-Stil — halbtransparente Login-Box mit
 *   backdrop-filter:blur, dunklem Hintergrund-Overlay für Lesbarkeit.
 *
 * v74-fix1: Logo-Detection sauber via Body-Klassen ts-login-has-logo /
 *   ts-login-no-logo (gesetzt via login_body_class-Filter in PHP).
 *
 * Wird AUSSCHLIESSLICH auf der wp-login.php-Seite geladen (über
 * login_enqueue_scripts).
 */

/* ========== Body / Hintergrund ========== */
/* Default-Gradient direkt am body — greift wenn kein Bild gesetzt ist
   und ist auch sichtbar wenn der ::before-Bild-Layer leer bleibt. */
body.login {
    background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 50%, #1e3a8a 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    min-height: 100vh;
    position: relative;
    background-color: transparent;
}

/* v75: Hintergrundbild-Layer (::before).
   Liegt unter dem Inhalt, kann unabhängig vom Inhalt geblurrt werden.
   Das background-image und der filter:blur-Wert kommen via wp_add_inline_style
   aus PHP. Hier nur die Layout-Eigenschaften. */
body.login::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    /* filter: blur(...) wird via Inline-CSS gesetzt
       Kleines Vergrößern (-2vw) verhindert weiße Ränder beim Blur. */
    transform: scale(1.05);
    transform-origin: center center;
}

/* v75: Dunkler Overlay-Layer (::after), liegt ÜBER dem Bild aber UNTER dem Inhalt.
   Macht die Login-Box besser lesbar. */
body.login::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 0;
    pointer-events: none;
}

/* Damit der Inhalt über Bild + Overlay liegt */
body.login > * {
    position: relative;
    z-index: 1;
}

/* ========== Logo ========== */
/* Standard-Größe, gilt für beide Modi (mit/ohne Logo) */
#login h1 a {
    width: auto !important;
    max-width: 320px !important;
    height: 80px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    margin: 0 auto 8px auto !important;
    text-indent: 0 !important;
}

/* Modus 1: Logo gesetzt — WP-Default-Text wird unsichtbar gemacht.
   Body-Klasse wird via login_body_class-Filter in PHP gesetzt. */
body.login.ts-login-has-logo h1 a {
    font-size: 0;       /* WP-Default-Text "Powered by WordPress" verstecken */
    color: transparent; /* Sicherheit: falls font-size:0 ignoriert wird */
}

/* Modus 2: Kein Logo gesetzt → Schriftzug "Talent Scope" als Fallback.
   Wir verstecken den Default-WP-Text und blenden stattdessen unseren ::before ein. */
body.login.ts-login-no-logo h1 a {
    font-size: 0;
    color: transparent;
}
body.login.ts-login-no-logo h1 a::before {
    content: "Talent Scope";
    display: block;
    font-size: 28px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    text-indent: 0;
    line-height: 80px; /* Höhe des h1 a-Containers, damit Text vertikal mittig sitzt */
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ========== Title-/Subtitle-Block über der Login-Box ========== */
.ts-login-titleblock {
    text-align: center;
    margin-bottom: 16px;
    padding: 0 8px;
}
.ts-login-title {
    font-size: 20px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.ts-login-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
/* Inhalt des Subtitles kommt über ::before aus dem Inline-CSS,
   damit eine DB-Option dynamisch eingespielt werden kann (siehe ts_login_enqueue_assets). */
.ts-login-subtitle::before {
    content: "";  /* Default: leer; wird per Inline-CSS überschrieben */
}

/* ========== Login-Box (Glasmorphism — Wahl S2) ========== */
/* v75-fix3: backdrop-filter wieder fest hier — Slider wurde entfernt, weil
   das WordPress-Login-Plugin den Wert überschrieben hat und wir keine
   Hoheit darüber hatten. 16px ist ein bewährter Standardwert. */
#loginform,
#registerform,
#lostpasswordform {
    background: rgba(255, 255, 255, 0.78) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 14px !important;
    padding: 32px 28px !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(16px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(16px) saturate(180%) !important;
}

/* ========== Eingabefelder ========== */
.login form .input,
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
    border: 1px solid rgba(203, 213, 225, 0.8) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.85) !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    color: #0f172a !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease !important;
}
.login form .input:focus,
.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
    border-color: #0284c7 !important;
    background: white !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18) !important;
    outline: none !important;
}

/* ========== Labels ========== */
.login label {
    color: #1e293b !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}

/* ========== Submit-Button ========== */
.wp-core-ui .button-primary,
#wp-submit {
    background: #1e3a8a !important;
    border-color: #1e3a8a !important;
    color: white !important;
    text-shadow: none !important;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.25) !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    padding: 8px 18px !important;
    height: auto !important;
    transition: all 0.15s ease !important;
}
.wp-core-ui .button-primary:hover,
.wp-core-ui .button-primary:focus,
#wp-submit:hover,
#wp-submit:focus {
    background: #1e40af !important;
    border-color: #1e40af !important;
    box-shadow: 0 2px 6px rgba(30, 58, 138, 0.4) !important;
    transform: translateY(-1px);
}
.wp-core-ui .button-primary:active,
#wp-submit:active {
    transform: translateY(0);
}

/* ========== Links unter der Login-Box ========== */
#nav,
#backtoblog {
    text-align: center !important;
    padding: 0 8px !important;
    margin: 16px 0 0 0 !important;
}
#nav a,
#backtoblog a {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    font-size: 13px !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
    transition: color 0.15s ease !important;
}
#nav a:hover,
#backtoblog a:hover {
    color: #ffffff !important;
    text-decoration: underline !important;
}

/* ========== "Erinnere dich an mich" Checkbox ========== */
.forgetmenot label {
    color: #475569 !important;
    font-size: 13px !important;
}

/* ========== Fehler- / Erfolgs-Meldungen ========== */
.login .message,
.login .notice,
.login #login_error {
    border-radius: 6px !important;
    border-left-width: 4px !important;
    box-shadow: none !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
}
.login #login_error {
    background: #fef2f2 !important;
    border-left-color: #dc2626 !important;
    color: #991b1b !important;
}
.login .message,
.login .notice-success {
    background: #f0fdf4 !important;
    border-left-color: #16a34a !important;
    color: #166534 !important;
}

/* ========== Sprachauswahl (sofern WP sie zeigt) ========== */
.language-switcher {
    text-align: center;
    margin-top: 18px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
}
.language-switcher select {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(203, 213, 225, 0.8) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-size: 13px !important;
    color: #0f172a !important;
}
.language-switcher .button {
    background: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    color: #1e3a8a !important;
    border-radius: 6px !important;
    padding: 4px 12px !important;
    font-size: 13px !important;
}

/* ========== 2FA-Form (Two Factor-Plugin) ========== */
/* Das Two-Factor-Plugin nutzt dasselbe loginform-Markup, also greifen
   unsere Styles automatisch. Hier nur kleine Optik-Verbesserung für
   den Code-Eingabe-Hint. */
.two-factor-prompt {
    color: #475569 !important;
    font-size: 14px !important;
    margin-bottom: 12px !important;
}

/* ========== Mobile ========== */
@media (max-width: 480px) {
    #loginform,
    #registerform,
    #lostpasswordform {
        padding: 20px 16px !important;
    }
    .ts-login-title {
        font-size: 16px;
    }
    .ts-login-subtitle {
        font-size: 12px;
    }
    #login h1 a {
        height: 60px !important;
        max-width: 240px !important;
    }
}
