/* =================================
   CSS INDEPENDIENTE PARA LOGIN
   No afecta otros estilos del sistema
   ================================= */

/* Variables específicas del login */
:root {
    --login-primary: #667eea;
    --login-secondary: #764ba2;
    --login-accent: #f093fb;
    --login-success: #4facfe;
    --login-danger: #ff6b6b;
    --login-warning: #feca57;
    
    --login-text-dark: #2c3e50;
    --login-text-light: #ffffff;
    --login-text-muted: #ffffff;
    
    --login-shadow-light: 0 10px 30px rgba(0, 0, 0, 0.1);
    --login-shadow-medium: 0 20px 60px rgba(0, 0, 0, 0.15);
    --login-shadow-heavy: 0 30px 80px rgba(0, 0, 0, 0.2);
    
    --login-border-radius: 16px;
    --login-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --login-transition-fast: all 0.15s ease;
}

/* Reset específico para la página de login */
.login-container * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Contenedor principal del login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

/* Fondo animado */
.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

/* Formas geométricas animadas */
.geometric-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    animation: float 6s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
    animation-duration: 8s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 2s;
    animation-duration: 10s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 20%;
    left: 10%;
    animation-delay: 4s;
    animation-duration: 12s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    bottom: 30%;
    right: 15%;
    animation-delay: 6s;
    animation-duration: 14s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(10px) rotate(-3deg); }
}

/* Partículas flotantes */
.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: particle-float 15s infinite linear;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 25%; animation-delay: 3s; }
.particle:nth-child(3) { left: 50%; animation-delay: 6s; }
.particle:nth-child(4) { left: 75%; animation-delay: 9s; }
.particle:nth-child(5) { left: 90%; animation-delay: 12s; }

@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Tarjeta principal de login */
.login-card {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-radius: var(--login-border-radius);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    margin: 2rem;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header del login */
.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-container {
    margin-bottom: 1rem;
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--login-shadow-medium);
    border: 4px solid rgba(255, 255, 255, 0.8);
    animation: logoRotate 3s ease-in-out infinite;
}

@keyframes logoRotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(5deg) scale(1.05); }
}

.login-title {
    color: white !important;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Mensaje de error */
.error-message {
    background: linear-gradient(135deg, #fee, #fdd);
    color: var(--login-danger);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid rgba(255, 107, 107, 0.2);
    animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-message i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Formulario */
.login-form {
    margin-bottom: 1.2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 0.9rem 0.9rem 0.9rem 3rem; /* Reducido de 1.2rem */
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 12px;
    font-size: 0.95rem; /* Ligeramente más pequeño */
    font-weight: 500;
    color: white !important;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(10px);
    transition: var(--login-transition);
    position: relative;
    z-index: 1;
    height: 44px; /* Altura fija más baja */
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 400;
}

.input-icon {
    position: absolute;
    left: 1rem; /* Reducido de 1.2rem */
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 1rem; /* Reducido de 1.1rem */
    z-index: 2;
    transition: var(--login-transition);
    top: 50%;
    transform: translateY(-50%); /* Para centrarlo verticalmente */
}




.form-input:focus {
    outline: none;
    border-color: var(--login-primary);
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-input:focus + .input-focus-border {
    transform: scaleX(1);
}

.input-wrapper.focused .input-icon {
    color: var(--login-primary);
    transform: scale(1.1);
}

.input-focus-border {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--login-primary), var(--login-accent));
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

/* Botón de login */
.login-button {
    width: 70%; /* Más angosto, era 100% */
    padding: 0.5rem 1rem; /* Menos alto, era 1.2rem 2rem */
    background: linear-gradient(135deg, var(--login-primary) 0%, var(--login-secondary) 100%);
    color: var(--login-text-light);
    border: none;
    border-radius: 12px;
    font-size: 1rem; /* Reducido de 1.1rem */
    font-weight: 600;
    cursor: pointer;
    transition: var(--login-transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--login-shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px; /* Reducido de 56px */
    margin: 0 auto; /* Para centrarlo al ser más angosto */
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--login-shadow-medium);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
}

.login-button:active {
    transform: translateY(0);
    box-shadow: var(--login-shadow-light);
}

.login-button:disabled {
    cursor: not-allowed;
    transform: none;
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
}

.button-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.button-loader {
    display: none;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer del login */
.login-footer {
    text-align: center;
    margin-top: 1rem;
}

.back-link {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--login-transition);
}

.back-link:hover {
    color: rgba(255, 255, 255, 1);
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-3px);
    text-decoration: none;
}
/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        margin: 1rem;
        padding: 2rem;
        max-width: 100%;
    }
    
    .login-title {
        font-size: 1.75rem;
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .shape-1, .shape-2 {
        display: none;
    }
    
    .shape-3 {
        width: 100px;
        height: 100px;
    }
    
    .shape-4 {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.5rem;
        margin: 0.5rem;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
    
    .form-input {
        padding: 1rem 1rem 1rem 3rem;
        font-size: 0.95rem;
    }
    
    .login-button {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .geometric-shape {
        opacity: 0.5;
    }
}

/* Modo oscuro */
@media (prefers-color-scheme: dark) {
    .login-card {
        background: rgba(44, 62, 80, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .login-title {
        color: var(--login-text-light);
    }
    
    .form-input {
        background: rgba(52, 73, 94, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--login-text-light);
    }
    
    .form-input:focus {
        background: rgba(52, 73, 94, 1);
    }
    
    .error-message {
        background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(192, 57, 43, 0.1));
        border-color: rgba(231, 76, 60, 0.3);
    }
}

/* Animaciones adicionales */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(102, 126, 234, 0.6);
    }
}

.login-button:focus {
    animation: pulseGlow 2s infinite;
}

/* Mejoras de accesibilidad */
.login-button:focus-visible,
.form-input:focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: 2px;
}

/* Soporte para animaciones reducidas */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .login-card {
        animation: none;
    }
    
    .geometric-shape {
        animation: none;
    }
    
    .particle {
        animation: none;
    }
}

/* Estados de carga específicos */
.login-form.loading .form-input {
    pointer-events: none;
    opacity: 0.7;
}

.login-form.loading .input-icon {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
