/**
 * SALCFITECMA v3.3
 * Login Styles - Partículas + Glass Text Mejorado
 * @author Dr. Daniel Olegario León Ruiz
 * @date 27 de Octubre de 2025
 */

 body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

/* ============================================
   CANVAS DE PARTÍCULAS
============================================ */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ============================================
   WRAPPER Y CONTAINER
============================================ */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.login-container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-xl);
    box-shadow: 
        var(--shadow-2xl),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 60px rgba(30, 63, 139, 0.15);
    overflow: hidden;
    transition: var(--transition-slow);
}

.login-container:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        0 0 80px rgba(30, 63, 139, 0.25);
}

/* ============================================
   HEADER
============================================ */
.login-header {
    background: var(--gradient-primary);
    padding: var(--spacing-2xl) var(--spacing-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    animation: headerShine 3s ease-in-out infinite;
}

@keyframes headerShine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* ============================================
   LOGO
============================================ */
.login-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--white);
    padding: var(--spacing-md);
    margin: 0 auto var(--spacing-md);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--transition-normal);
    animation: logoFloat 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

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

.login-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.login-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================
   TEXTO CON EFECTO NEÓN ENFOCADO
============================================ */
.login-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0;
    letter-spacing: 4px;
    position: relative;
    z-index: 1;
    
    /* TEXTO BLANCO NÍTIDO CON NEÓN CONTROLADO */
    color: #ffffff;
    
    /* STROKE PARA BORDES DEFINIDOS */
    -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.9);
    paint-order: stroke fill;
    
    /* SOMBRAS NEÓN OPTIMIZADAS (menos blur, más definición) */
    text-shadow: 
        0 0 2px #fff,
        0 0 5px #fff,
        0 0 10px #00d4ff,
        0 0 20px #00d4ff,
        0 0 35px #00d4ff,
        0 0 50px #00d4ff,
        0 2px 8px rgba(0, 0, 0, 0.4);
    
    /* FONDO GLASS SEMI-TRANSPARENTE */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.7rem 2rem;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 8px 32px rgba(0, 212, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        0 0 40px rgba(0, 212, 255, 0.3);
    display: inline-block;
    
    animation: neonPulse 2.5s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    0% {
        text-shadow: 
            0 0 2px #fff,
            0 0 5px #fff,
            0 0 10px #00d4ff,
            0 0 20px #00d4ff,
            0 0 35px #00d4ff,
            0 2px 8px rgba(0, 0, 0, 0.4);
    }
    100% {
        text-shadow: 
            0 0 3px #fff,
            0 0 7px #fff,
            0 0 15px #00d4ff,
            0 0 30px #00d4ff,
            0 0 50px #00d4ff,
            0 0 70px #00d4ff,
            0 2px 8px rgba(0, 0, 0, 0.4);
    }
}

.login-subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 1);
    margin: var(--spacing-md) 0 0;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    text-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(255, 255, 255, 0.4);
}

/* ============================================
   BODY
============================================ */
.login-body {
    padding: var(--spacing-2xl) var(--spacing-xl);
}

/* ============================================
   ALERTAS
============================================ */
.alert {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    animation: alertSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.alert-success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(129, 199, 132, 0.15));
    border: 2px solid rgba(76, 175, 80, 0.4);
    color: #2E7D32;
}

.alert-error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.15), rgba(239, 83, 80, 0.15));
    border: 2px solid rgba(244, 67, 54, 0.4);
    color: #C62828;
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.15), rgba(255, 183, 77, 0.15));
    border: 2px solid rgba(255, 152, 0, 0.4);
    color: #E65100;
}

.alert i {
    font-size: 1.2rem;
}

/* ============================================
   FORMULARIO
============================================ */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--primary);
    font-size: 1.1rem;
    transition: var(--transition-fast);
    pointer-events: none;
    z-index: 2;
}

/* BOTÓN TOGGLE PASSWORD */
.toggle-password {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 2;
    background: none;
    border: none;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.toggle-password:hover {
    color: var(--secondary);
}

.toggle-password:hover i {
    transform: scale(1.15);
}

.toggle-password:active i {
    transform: scale(0.95);
}

.input-wrapper.focused i:not(.toggle-password) {
    color: var(--secondary);
    transform: scale(1.2);
}

.form-control {
    font-family: 'Poppins', sans-serif;
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid rgba(30, 63, 139, 0.2);
    border-radius: var(--radius-md);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    transition: var(--transition-normal);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.input-wrapper.password-field .form-control {
    padding-right: 3rem;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    background: var(--white);
    box-shadow: 
        0 0 0 4px rgba(197, 165, 114, 0.15),
        inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.form-control::placeholder {
    color: var(--gray);
    opacity: 0.6;
    font-style: italic;
}

/* ============================================
   BOTÓN LOGIN
============================================ */
.btn-login {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 
        0 10px 25px rgba(30, 63, 139, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-login:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 15px 35px rgba(30, 63, 139, 0.6),
        0 0 40px rgba(70, 130, 180, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-login:hover::before {
    width: 400px;
    height: 400px;
}

.btn-login:active {
    transform: translateY(-2px) scale(1.01);
}

/* ============================================
   FOOTER
============================================ */
.login-footer {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: rgba(245, 245, 245, 0.5);
    backdrop-filter: blur(10px);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    color: var(--gray-dark);
    border-top: 1px solid rgba(30, 63, 139, 0.1);
}

.login-footer p {
    margin: 0.25rem 0;
}

.login-footer .copyright {
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: var(--spacing-sm);
}

/* ============================================
   RESPONSIVE
============================================ */
@media (max-width: 480px) {
    body {
        padding: var(--spacing-md);
    }
    
    .login-wrapper {
        max-width: 100%;
    }
    
    .login-header {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .login-logo {
        width: 90px;
        height: 90px;
    }
    
    .login-title {
        font-size: 1.6rem;
        letter-spacing: 3px;
        padding: 0.6rem 1.5rem;
    }
    
    .login-subtitle {
        font-size: 0.85rem;
    }
    
    .login-body {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .login-footer {
        padding: var(--spacing-md);
    }
}

/* ============================================
   ACCESIBILIDAD
============================================ */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}