/*
 * COLORES: esta hoja NO define colores. Todos los colores de la web (modo
 * claro y modo oscuro) están en /public/css/theme.css y aquí se usan
 * siempre con var(--...). No escribas códigos de color (#fff, rgb(...),
 * white...) en este archivo: añade o reutiliza una variable en theme.css.
 */
/* ======================================================================
   LOGIN PAGE - DISEÑO PROFESIONAL ERP
   ====================================================================== */

.login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-5b5ef6) 0%, var(--bg-4845e4) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
}

.login-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1200px;
    min-height: 700px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px var(--sh-black-a30);
    overflow: hidden;
    margin: var(--space-6);
}

/* === PANEL IZQUIERDO - BRANDING === */
.login-brand-panel {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    /* Texto siempre blanco sobre el morado (var(--white) es un FONDO y en
       modo oscuro pasa a ser oscuro: el texto quedaba casi negro) */
    color: var(--tx-white);
    padding: var(--space-12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--bg-white-a10) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1) rotate(180deg);
        opacity: 0.8;
    }
}

.brand-content {
    position: relative;
    z-index: 1;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    /* Área de respeto del logo Tynapro: >= media altura (64px / 2 = 32px) */
    margin-bottom: 40px;
    line-height: 0;
}

.logo-icon {
    font-size: 48px;
    filter: drop-shadow(0 4px 8px var(--sh-black-a20));
}

.logo-text {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 2px 4px var(--sh-black-a10);
}

.brand-tagline {
    font-size: var(--font-size-lg);
    opacity: 0.95;
    margin-bottom: var(--space-10);
    line-height: var(--line-height-relaxed, 1.625);
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-base);
    background: var(--bg-white-a10);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast);
}

.feature-item:hover {
    background: var(--bg-white-a15);
    transform: translateX(8px);
}

.feature-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.feature-text {
    line-height: 1.4;
}

/* === PANEL DERECHO - FORMULARIO === */
.login-form-panel {
    display: flex;
    flex-direction: column;
    background: var(--white);
}

.login-form-container {
    flex: 1;
    padding: var(--space-12);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-header {
    margin-bottom: var(--space-8);
    text-align: center;
}

.login-form-header h2 {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-2) 0;
}

.login-form-header p {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0;
}

/* === ALERTAS === */
.alert {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-6);
    font-size: var(--font-size-sm);
    animation: slideDown var(--transition-base);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: var(--error-light);
    color: var(--error-red);
    border: 1px solid var(--error-red);
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-message {
    flex: 1;
    font-weight: 500;
}

/* === FORMULARIO === */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.label-icon {
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-focus);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* === BOTÓN LOGIN === */
.btn-login {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: var(--tx-white); /* texto blanco también en modo oscuro */
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    box-shadow: 0 4px 12px var(--sh-1f4fd8-a30);
    margin-top: var(--space-2);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--sh-1f4fd8-a40);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 20px;
    transition: transform var(--transition-fast);
}

.btn-login:hover .btn-icon {
    transform: translateX(4px);
}

/* === DIVISOR === */
.login-divider {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin: var(--space-8) 0 var(--space-6) 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-300);
}

.login-divider span {
    white-space: nowrap;
    font-weight: 500;
}

/* === CREDENCIALES DE PRUEBA === */
.demo-credentials {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}

.credential-card {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    transition: all var(--transition-fast);
}

.credential-card:hover {
    border-color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.credential-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.credential-icon {
    font-size: 16px;
}

.credential-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.credential-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.credential-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
}

.credential-label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 40px;
}

.credential-value {
    background: var(--white);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: var(--font-size-xs);
    color: var(--primary-blue);
    border: 1px solid var(--gray-300);
    user-select: all;
    cursor: pointer;
}

.credential-value:hover {
    border-color: var(--primary-blue);
    background: var(--light-blue-bg);
}

/* === FOOTER === */
.login-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.login-footer p {
    margin: 0;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .login-brand-panel {
        display: none;
    }
    
    .login-form-container {
        padding: var(--space-8);
    }
}

@media (max-width: 768px) {
    .login-wrapper {
        margin: var(--space-4);
        min-height: auto;
    }
    
    .login-form-container {
        padding: var(--space-6);
    }
    
    .login-form-header h2 {
        font-size: var(--font-size-2xl);
    }
    
    .demo-credentials {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: 0;
        background: var(--white);
    }
    
    .login-wrapper {
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }
    
    .login-form-container {
        padding: var(--space-5);
    }
    
    .login-form-header h2 {
        font-size: var(--font-size-xl);
    }
    
    .form-input {
        padding: var(--space-3);
    }
    
    .btn-login {
        padding: var(--space-3) var(--space-5);
    }
}
