/* ===========================================================================
   Gemeinsames, gebrandetes Login-Design
   ---------------------------------------------------------------------------
   Wird von der Startseite (templates/index.html), der Stempeluhr-Login-Seite
   (/timeclock/login, inkl. 429-Variante) und dem Mobil-Login
   (/timeclock/mobile) gemeinsam genutzt, damit alle Anmelde-Oberflächen
   identisch aussehen. Setzt auf die Theme-Variablen aus theme.css auf und ist
   damit automatisch Light/Dark-aware.
   =========================================================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Auf Seiten mit globaler Navbar (Startseite) bleibt unter der Leiste Platz. */
.login-container--with-nav {
    min-height: calc(100vh - 62px);
}

/* Dezenter Auto-Silhouetten-Hintergrund hinter der Login-Karte.
   Das Bild ist eine helle Auto-Silhouette auf schwarzer Fläche.
   Über theme-abhängige Blend-Modi wird die schwarze Fläche "weggerechnet",
   sodass nur die Silhouette dezent durchscheint:
   - Hell: invertiert + multiply -> zartes graues Auto auf hellem Grund.
   - Dunkel: screen -> ruhiges helles Auto auf dunklem Grund. */
.login-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('/static/images/car-silhouette.png');
    background-repeat: no-repeat;
    background-position: center bottom 6%;
    background-size: min(900px, 102%) auto;
    opacity: var(--login-bg-opacity, 0.45);
    filter: var(--login-bg-filter, invert(1) grayscale(100%));
    mix-blend-mode: var(--login-bg-blend, multiply);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    animation: login-bg-float 7s ease-in-out infinite;
}

@keyframes login-bg-float {
    0%   { transform: translateY(0) scale(1); }
    50%  { transform: translateY(-14px) scale(1.015); }
    100% { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .login-container::before {
        animation: none;
    }
}

.login-card {
    position: relative;
    z-index: 1;
    max-width: 420px;
    width: 100%;
    padding: 2.5rem;
    border-radius: 16px;
    background: var(--bg-card);
    background: color-mix(in srgb, var(--bg-card) 75%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.login-card h3 {
    font-weight: 600;
    color: var(--text-primary) !important;
    margin-bottom: 0.25rem;
}

.login-card .subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.login-logo {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    margin: 0 auto 1rem;
}

/* Dezenter Hinweis für Externe: erklärt, dass dies ein interner Bereich ist. */
.login-hint {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: center;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0.4rem;
}

.login-hint i {
    flex: 0 0 auto;
    margin-top: 0.05rem;
}

.btn-login {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-login:hover {
    background: var(--primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(41, 128, 185, 0.3);
}

.btn-login:disabled {
    background: var(--text-muted);
    color: #ffffff;
    transform: none;
    box-shadow: none;
}

/* Lade-/Auto-Login-Spinner (Stempeluhr + Mobil) im gleichen Look. */
.login-loading {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.login-loading p {
    color: var(--text-muted);
}

/* Schmale (mobile) Viewports: Karte und Hintergrund kompakter. */
@media (max-width: 575.98px) {
    .login-container {
        padding: 1rem;
    }
    .login-container::before {
        background-size: 165% auto;
        background-position: center bottom 3%;
    }
    .login-card {
        padding: 1.75rem 1.35rem;
    }
}
