.login-page {
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Animación de entrada — barrido desde la derecha */
@keyframes sweepIn {
    0% {
        clip-path: inset(0 0 0 100%);
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

/* Animación de salida — barrido hacia la derecha hasta el final de la pantalla */
@keyframes sweepOut {
    0% {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
    30% {
        opacity: 1;
    }
    100% {
        clip-path: inset(0 0 0 100%);
        opacity: 0;
    }
}

.login-form-panel {
    animation: sweepIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.login-form-panel.is-exiting {
    animation: sweepOut 0.35s cubic-bezier(0.55, 0, 1, 0.45) forwards;
    pointer-events: none;
}

/* Stagger — los hijos aparecen escalonados tras el reveal */
.login-form-container > * {
    opacity: 0;
    animation: childFade 0.4s ease forwards;
}

.login-form-container > *:nth-child(1) { animation-delay: 0.15s; }
.login-form-container > *:nth-child(2) { animation-delay: 0.2s; }
.login-form-container > form { animation-delay: 0.25s; }
.login-form-container > .login-links { animation-delay: 0.35s; }


@keyframes childFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Panel izquierdo — branding */
.login-brand {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 12vh 3rem;
    border-radius: 0 24px 24px 0;
}

/* Overlay oscuro + blur encima de la imagen */
.login-brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            rgba(10,25,47,0.88) 0%,
            rgba(26,54,93,0.55) 40%,
            rgba(44,82,130,0.15) 100%
        );
    backdrop-filter: blur(0.5px);
    -webkit-backdrop-filter: blur(0.5px);
    z-index: 1;
}

.login-brand-header {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: -0.8rem;
    flex-shrink: 0;
}

.login-brand-footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    flex-shrink: 0;
}

.login-brand-copyright {
    color: rgba(255,255,255,0.35);
    font-size: 0.75rem;
    margin: 0;
}

.login-brand-logo {
    width: 450px;
    height: auto;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.3));
    display: block;
}

.login-brand-tagline {
    color: rgba(255,255,255,0.65);
    font-size: 1rem;
    margin-top: 0.2rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-style: italic;
}

.login-brand h1 {
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}

.login-brand p {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Panel derecho — formulario */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #f8fafc;
    overflow-y: auto;
    position: relative;
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-form-container h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.3rem;
}

.login-form-container .login-subtitle {
    color: #64748b;
    font-size: 0.88rem;
    margin-bottom: 2rem;
}

/* Inputs modernos */
.login-input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.login-input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.35rem;
    transition: color 0.25s ease, transform 0.25s ease;
}

.login-input-group:focus-within label {
    color: #2c5282;
    transform: translateX(3px);
}

.login-input-group input,
.login-input-group select,
.login-input-group textarea {
    height: 48px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease, background 0.3s ease, background-size 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    width: 100%;
    outline: none;

    /* Subrayado animado desde el centro */
    background-color: #fff;
    background-image: linear-gradient(90deg, transparent 0%, #2c5282 15%, #2c5282 85%, transparent 100%);
    background-size: 0% 2.5px;
    background-repeat: no-repeat;
    background-position: center bottom;
}

@keyframes inputGlow {
    0%   { box-shadow: 0 0 0 4px rgba(44,82,130,0.08), 0 4px 12px rgba(44,82,130,0.06); }
    50%  { box-shadow: 0 0 0 7px rgba(44,82,130,0.04), 0 4px 20px rgba(44,82,130,0.10); }
    100% { box-shadow: 0 0 0 4px rgba(44,82,130,0.08), 0 4px 12px rgba(44,82,130,0.06); }
}

.login-input-group input:focus,
.login-input-group select:focus,
.login-input-group textarea:focus {
    border-color: #2c5282;
    box-shadow: 0 0 0 4px rgba(44,82,130,0.08), 0 4px 12px rgba(44,82,130,0.06);
    transform: scale(1.01);
    background-color: #fafcff;
    background-image: linear-gradient(90deg, transparent 0%, #2c5282 15%, #2c5282 85%, transparent 100%);
    background-size: 80% 2.5px;
    animation: inputGlow 2s ease-in-out infinite;
}

.login-input-group input:hover:not(:focus),
.login-input-group select:hover:not(:focus),
.login-input-group textarea:hover:not(:focus) {
    border-color: #94a3b8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}



.login-input-group .form-control-lg,
.login-input-group .form-select-lg {
    height: 48px;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
}

/* Password toggle en el nuevo layout */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 2.75rem !important;
}

.password-input-wrapper .password-toggle-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 5;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-input-wrapper .password-toggle-btn:hover {
    color: #333;
}

.password-input-wrapper .password-toggle-btn .toggle-icon {
    font-size: 1.2rem;
    position: absolute;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.password-input-wrapper .password-toggle-btn .toggle-icon--visible {
    transform: scale(1);
    opacity: 1;
}

.password-input-wrapper .password-toggle-btn .toggle-icon--hidden {
    transform: scale(0.4);
    opacity: 0;
}

/* Checkbox recordar */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.remember-row .form-check-label {
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
}

.remember-row .form-check-input {
    cursor: pointer;
    border-color: #cbd5e0;
}

.remember-row .form-check-input:checked {
    background-color: #2c5282;
    border-color: #2c5282;
}

/* Botón */
.login-btn {
    height: 48px;
    border-radius: 10px;
    background: #2c5282;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(44,82,130,0.25);
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: #1a365d;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44,82,130,0.4);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(44,82,130,0.2);
    transition-duration: 0.05s;
}

.login-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

/* Links */
.login-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.login-links a {
    color: #64748b;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.2s;
}

.login-links a:hover {
    color: #2c5282;
}

.login-links .link-divider {
    color: #cbd5e1;
    margin: 0 0.5rem;
}



/* Error */
.login-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    color: #dc2626;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Modo oscuro ─────────────────────────────────────────────── */
[data-bs-theme="dark"] .login-form-panel { background: #0f172a; }
[data-bs-theme="dark"] .login-form-container h2 { color: #f1f5f9; }
[data-bs-theme="dark"] .login-form-container .login-subtitle { color: #94a3b8; }
[data-bs-theme="dark"] .login-input-group label { color: #94a3b8; }
[data-bs-theme="dark"] .login-input-group input,
[data-bs-theme="dark"] .login-input-group select,
[data-bs-theme="dark"] .login-input-group textarea {
    background-color: #1e293b;
    border-color: rgba(255,255,255,0.15);
    color: #e2e8f0;
}
[data-bs-theme="dark"] .login-input-group input:focus,
[data-bs-theme="dark"] .login-input-group select:focus,
[data-bs-theme="dark"] .login-input-group textarea:focus {
    background-color: #0f172a;
    border-color: #2c5282;
}
[data-bs-theme="dark"] .password-input-wrapper .password-toggle-btn { color: #64748b; }
[data-bs-theme="dark"] .password-input-wrapper .password-toggle-btn:hover { color: #e2e8f0; }
[data-bs-theme="dark"] .remember-row .form-check-label { color: #cbd5e1; }
[data-bs-theme="dark"] .remember-row .form-check-input { border-color: rgba(255,255,255,0.2); background-color: #1e293b; }
[data-bs-theme="dark"] .login-links { border-top-color: rgba(255,255,255,0.1); }
[data-bs-theme="dark"] .login-links a { color: #94a3b8; }
[data-bs-theme="dark"] .login-links .link-divider { color: #475569; }
[data-bs-theme="dark"] .login-error { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.2); }

/* Responsive */
@media (max-width: 768px) {
    .login-brand {
        display: none;
    }
    .login-form-panel {
        padding: 1.5rem;
    }
}

/* ── Theme toggle (auth pages) ─────────────────────────────── */
.auth-theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    z-index: 10;
}

.auth-theme-toggle:hover {
    color: #2c5282;
    border-color: #2c5282;
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(44,82,130,0.15);
}

[data-bs-theme="dark"] .auth-theme-toggle {
    background: #1e293b;
    border-color: rgba(255,255,255,0.15);
    color: #94a3b8;
}

[data-bs-theme="dark"] .auth-theme-toggle:hover {
    color: #facc15;
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 4px 14px rgba(250,204,21,0.15);
}
