/* =============================================================
   Nómina Inteligente — Página de Login
   Pantalla dividida: branding izquierda + form derecha
   ============================================================= */

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

/* --- Panel izquierdo: Branding --- */
.login-brand {
    display: none;
    flex: 1;
    background: var(--gradient-brand);
    color: var(--color-text-on-primary);
    padding: var(--space-3xl);
    position: relative;
    overflow: hidden;
    align-items: center;
    justify-content: center;
}

.login-brand__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    height: 100%;
}

.login-brand__logo {
    width: 240px;
    margin-top: var(--space-2xl);
    flex-shrink: 0;
    animation: loginLogoIn 1.6s cubic-bezier(0.22, 1, 0.36, 1) both,
               loginLogoFloat 3s 2.2s ease-in-out infinite;
}

@keyframes loginLogoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --- Tagline profesional (reemplaza la ilustración) --- */
.login-brand__tagline {
    margin: auto 0;
    text-align: center;
    animation: loginTaglineIn 1.2s 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand__tagline h2 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    letter-spacing: -0.01em;
    /* Gradiente IA: colores de marca + púrpura de inteligencia artificial.
       El gradiente se desplaza lentamente para dar vida al texto. */
    background: linear-gradient(
        90deg,
        #FFFFFF,
        #00B3E3,
        #A78BFA,
        #00B3E3,
        #FFFFFF
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation:
        loginTaglineIn 1.2s 0.8s cubic-bezier(0.22, 1, 0.36, 1) both,
        loginGradientShift 8s 3s ease-in-out infinite;
}

.login-brand__tagline-line {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    margin: var(--space-lg) auto 0;
    border-radius: 1px;
}

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

@keyframes loginGradientShift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.login-brand__illustration {
    width: 100%;
    max-width: 720px;
    margin-bottom: var(--space-md);
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15)) hue-rotate(-30deg) saturate(1.2);
    animation: loginIllustrationIn 1.8s 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand__illustration--no-filter {
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.15));
}

/* --- Reset Password SVG: tamaño y centrado --- */
.reset-svg {
    max-width: 720px;
    margin-top: auto;
    margin-bottom: 15%;
}

/* --- Reset Password: Typing Animation --- */
.reset-typing-text {
    clip-path: inset(0 100% 0 0);
    animation: resetTyping 2.5s 1.8s steps(13) forwards;
}

.reset-cursor {
    opacity: 0;
    animation: resetCursorAppear 0.01s 1.8s forwards,
               resetCursorMove 2.5s 1.8s steps(13) forwards,
               resetCursorBlink 0.6s 4.3s ease-in-out infinite;
}

.reset-focus-ring {
    opacity: 0;
    animation: resetFocusIn 0.6s 1.4s ease forwards;
}

.reset-envelope {
    animation: resetEnvelopeFloat 4s 2s ease-in-out infinite;
}

.reset-envelope-2 {
    animation: resetEnvelopeFloat 5s 3s ease-in-out infinite;
}

@keyframes resetTyping {
    to { clip-path: inset(0 0 0 0); }
}

@keyframes resetCursorAppear {
    to { opacity: 1; }
}

@keyframes resetCursorMove {
    from { transform: translateX(0); }
    to { transform: translateX(113px); }
}

@keyframes resetCursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes resetFocusIn {
    from { opacity: 0; transform: scale(1.03); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes resetEnvelopeFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

/* --- Animaciones de entrada --- */
@keyframes loginLogoIn {
    0% {
        opacity: 0;
        transform: translateY(-40px) scale(0.85);
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes loginIllustrationIn {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.88);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Decoración geométrica de fondo */
.login-brand::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    top: -150px;
    right: -100px;
    animation: loginCircleTop 1.2s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both,
               loginCirclePulse 6s 2s ease-in-out infinite;
}

.login-brand::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    bottom: -80px;
    left: -60px;
    animation: loginCircleBottom 1.4s 0.5s cubic-bezier(0.22, 1, 0.36, 1) both,
               loginCircleDrift 8s 2.5s ease-in-out infinite;
}

@keyframes loginCircleTop {
    from {
        opacity: 0;
        transform: scale(0.6) translate(60px, -60px);
    }
    to {
        opacity: 1;
        transform: scale(1) translate(0, 0);
    }
}

@keyframes loginCircleBottom {
    from {
        opacity: 0;
        transform: scale(0.5) translate(-40px, 40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translate(0, 0);
    }
}

@keyframes loginCirclePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes loginCircleDrift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(12px, -8px); }
}

/* --- Panel derecho: Formulario --- */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
    background-color: var(--color-bg-card);
}

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

.login-form__logo-mobile {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-2xl);
}

.login-form__logo-mobile img {
    height: 150px;
    width: auto;
}

.login-form__header {
    margin-bottom: var(--space-2xl);
}

.login-form__title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    margin-bottom: var(--space-xs);
}

.login-form__subtitle {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.login-form__error {
    margin-bottom: var(--space-lg);
}

.login-form__actions {
    margin-top: var(--space-xl);
}

.login-form__submit {
    height: 48px;
    font-size: var(--text-base);
}

.login-form__footer {
    margin-top: var(--space-xl);
    text-align: center;
}

.login-form__link {
    font-size: var(--text-sm);
    color: var(--color-text-link);
    font-weight: var(--font-weight-medium);
}

.login-form__link:hover {
    color: var(--color-text-link-hover);
}

/* Password toggle */
.login-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 10px;
    color: var(--color-text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.login-password-toggle:hover {
    color: var(--color-text-primary);
}

/* --- Copyright --- */
.login-copyright {
    margin-top: var(--space-3xl);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    text-align: center;
}

/* --- Empresa padre: badge 'Una empresa de GMA' --- */

/* Desktop — dentro del panel de branding (fondo gradiente azul, texto blanco) */
.login-brand__parent {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-size: var(--text-xs);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    flex-shrink: 0;
    animation: loginParentIn 1.5s 1.5s ease both;
}
.login-brand__parent img {
    height: 56px;
    width: auto;
    filter: brightness(0) invert(1);
}
@keyframes loginParentIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile — dentro del panel del formulario (fondo blanco, texto gris) */
.login-parent-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-md);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    letter-spacing: 0.03em;
}
.login-parent-mobile img {
    height: 20px;
    width: auto;
    opacity: 0.6;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

/* Tablet: mostrar panel de branding */
@media (min-width: 1024px) {
    .login-brand {
        display: flex;
    }

    .login-form__logo-mobile {
        display: none;
    }

    /* En desktop el badge mobile se oculta (el del panel de branding ya está) */
    .login-parent-mobile {
        display: none;
    }

    .login-form-panel {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (min-width: 1280px) {
    .login-form-panel {
        flex: 0 0 45%;
        max-width: 45%;
    }

    .login-brand__illustration {
        max-width: 780px;
    }
}

/* =============================================================
   DARK MODE — Panel de branding con contraste adecuado
   ============================================================= */

[data-theme="dark"] .login-brand {
    background: linear-gradient(135deg, #0A0F1A 0%, #1E2A42 100%);
}

[data-theme="dark"] .login-brand__tagline h2 {
    background: linear-gradient(
        90deg,
        #E4E7EC,
        #4D8FE8,
        #A78BFA,
        #4D8FE8,
        #E4E7EC
    );
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .login-brand__tagline-line {
    background: rgba(255, 255, 255, 0.25);
}
