/* ─────────────────────────────────────────────
 * Módulo Login — Dark Glassmorphism
 * ───────────────────────────────────────────── */

/* ── Pantalla completa ── */
.login-screen {
    flex: 1;
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(79, 70, 229, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.14) 0%, transparent 55%),
        linear-gradient(160deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
}

/* ── Orbes decorativos ── */
.login-bg-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.login-bg-orb--one {
    width: 500px;
    height: 500px;
    top: -120px;
    left: -160px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.25) 0%, transparent 70%);
    filter: blur(40px);
}

.login-bg-orb--two {
    width: 600px;
    height: 600px;
    bottom: -180px;
    right: -200px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    filter: blur(50px);
}

/* ── Tarjeta glassmorphism ── */
.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 460px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 44px 40px 36px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

/* ── Marca / brand ── */
.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
    gap: 10px;
}

.login-brand-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), var(--primary));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(72, 147, 198, 0.45);
}

.login-brand-icon svg {
    width: 28px;
    height: 28px;
    stroke: #ffffff;
}

.login-logo {
    font-size: 2.25rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    text-align: center;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 30%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    margin: 0;
    letter-spacing: 0.01em;
}

/* ── Alerta de error ── */
.login-alert {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.8125rem;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ── Alerta de aviso (sesión expirada, etc.) ── */
.login-alert--warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
}

/* ── Campo ── */
.login-field {
    margin-bottom: 18px;
}

.login-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.login-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 0.9rem;
    font-family: var(--font-primary, sans-serif);
    color: #ffffff;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    box-sizing: border-box;
    caret-color: #a5b4fc;
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.login-input:focus {
    border-color: rgba(72, 147, 198, 0.7);
    box-shadow: 0 0 0 3px rgba(72, 147, 198, 0.15);
    background: rgba(255, 255, 255, 0.11);
}

/* Fix autofill background en Chrome/Edge */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(30, 27, 75, 0.95) inset;
    -webkit-text-fill-color: #ffffff;
    transition: background-color 5000s ease-in-out 0s;
}

/* ── Botón principal ── */
.login-btn {
    width: 100%;
    height: 46px;
    margin-top: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-primary, sans-serif);
    cursor: pointer;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(72, 147, 198, 0.4);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(72, 147, 198, 0.55);
}

.login-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(72, 147, 198, 0.4);
}

.login-btn:disabled {
    opacity: 0.55;
    cursor: default;
    transform: none;
}

/* ── Nota de seguridad ── */
.login-secure-note {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    margin: 20px 0 0;
    letter-spacing: 0.01em;
}

.login-secure-note::before {
    content: '🔒 ';
    font-size: 0.7rem;
}

/* ── Versión de la aplicación ── */
.login-version {
    text-align: center;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.18);
    margin: 6px 0 0;
    letter-spacing: 0.04em;
}

/* ── Zona de usuario en topbar ── */
.topbar-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-username {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text, var(--text-primary));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.btn-logout {
    height: 30px;
    padding: 0 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: var(--font-primary, sans-serif);
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius, 6px);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: var(--background-secondary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px 28px;
        border-radius: 16px;
    }

    .login-logo {
        font-size: 1.875rem;
    }

    .login-brand-icon {
        width: 48px;
        height: 48px;
        border-radius: 13px;
    }

    .login-brand-icon svg {
        width: 24px;
        height: 24px;
    }

    .topbar-username {
        display: none;
    }
}
