/**
 * Estilos específicos para la página de Login - Versión Mejorada
 * Flyflops - Sistema de Gestión
 * Autor: Sistema de Gestión Flyflops
 * Fecha: Octubre 2025
 */

/* ===== VARIABLES CSS ===== */
:root {
    --primary-gradient: linear-gradient(135deg, #5B9CB8 0%, #4A8BA5 100%);
    --card-gradient: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    --success-gradient: linear-gradient(135deg, #28a745, #20c997);
    --error-gradient: linear-gradient(135deg, #dc3545, #fd7e14);
    --primary-color: #5B9CB8;
    --primary-hover: #5a6fd8;
    --text-color: #2d3748;
    --text-light: #718096;
    --border-radius: 12px;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== ESTILOS GENERALES DEL LOGIN ===== */
body.login-page {
    background: var(--primary-gradient);
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* Efectos de fondo animado */
body.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 119, 198, 0.2) 0%, transparent 50%);
    animation: backgroundMove 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundMove {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(1deg); }
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.login-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* ===== TARJETA DE LOGIN MEJORADA ===== */
.login-card {
    background: var(--card-gradient);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    padding: 48px 40px;
    width: 100%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    animation: cardSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    border-radius: 24px 24px 0 0;
}

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

/* ===== HEADER DEL LOGIN MEJORADO ===== */
.login-logo {
    font-size: 4em;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    animation: logoFloat 3s ease-in-out infinite;
}

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

.login-title {
    font-size: 2em;
    color: var(--text-color);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.login-subtitle {
    color: var(--text-light);
    margin-bottom: 32px;
    font-size: 1rem;
    font-weight: 400;
}

/* ===== FORMULARIO MEJORADO ===== */
.form-group {
    margin-bottom: 24px;
    text-align: left;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
    box-sizing: border-box;
    font-weight: 500;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.form-group input::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

/* ===== TOGGLE DE CONTRASEÑA MEJORADO ===== */
.password-toggle {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.1em;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-50%) scale(1.05);
}

/* ===== CHECKBOX MEJORADO ===== */
.remember-me {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
}

.remember-me:hover {
    background: rgba(102, 126, 234, 0.05);
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.remember-me span {
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

/* ===== BOTONES MEJORADOS ===== */
.login-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--success-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin: 24px 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.login-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.login-btn:hover:not(:disabled)::before {
    left: 100%;
}

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

.login-btn:disabled {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* ===== MENSAJES MEJORADOS ===== */
.error-message {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    display: none;
    font-size: 0.9rem;
    font-weight: 500;
    animation: messageSlideIn 0.3s ease;
    position: relative;
    border-left: 4px solid #dc2626;
}

.success-message {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    display: none;
    font-size: 0.9rem;
    font-weight: 500;
    animation: messageSlideIn 0.3s ease;
    position: relative;
    border-left: 4px solid #10b981;
}

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

/* ===== DIVIDER MEJORADO ===== */
.divider {
    margin: 32px 0;
    text-align: center;
    position: relative;
    color: var(--text-light);
    font-size: 0.875rem;
    font-weight: 500;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, #e2e8f0, transparent);
}

.divider span {
    background: var(--card-gradient);
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ===== BOTONES SOCIALES MEJORADOS ===== */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.social-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    transition: width 0.3s ease;
    z-index: -1;
}

.social-btn:hover {
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.social-btn:hover::before {
    width: 100%;
}

/* ===== ENLACES MEJORADOS ===== */
.back-home {
    text-align: center;
    margin-top: 24px;
}

.back-home a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 16px;
    border-radius: 8px;
    display: inline-block;
}

.back-home a:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* ===== RESPONSIVE MEJORADO ===== */
@media (max-width: 576px) {
    .login-container {
        padding: 16px;
    }

    .login-card {
        padding: 32px 24px;
        border-radius: 20px;
        margin: 16px 0;
    }

    .login-logo {
        font-size: 3em;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .form-group input {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .login-btn {
        padding: 14px 20px;
        font-size: 1rem;
    }
}

@media (max-width: 320px) {
    .login-card {
        padding: 24px 16px;
        border-radius: 16px;
    }
    
    .login-logo {
        font-size: 2.5em;
    }
    
    .login-title {
        font-size: 1.5rem;
    }
}

/* ===== MODO OSCURO MEJORADO ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --card-gradient: linear-gradient(145deg, #1a202c 0%, #2d3748 100%);
        --text-color: #f7fafc;
        --text-light: #a0aec0;
    }
    
    .login-card {
        background: var(--card-gradient);
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .form-group input {
        background: rgba(45, 55, 72, 0.8);
        border-color: #4a5568;
        color: white;
    }
    
    .form-group input:focus {
        background: #2d3748;
        border-color: var(--primary-color);
    }
    
    .divider span {
        background: var(--card-gradient);
    }
    
    .social-btn {
        background: rgba(45, 55, 72, 0.8);
        border-color: #4a5568;
        color: white;
    }
}

/* ===== ANIMACIONES ADICIONALES ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading .login-btn {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ===== UTILIDADES MEJORADAS ===== */
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none !important; }
.loading { pointer-events: none; }

/* ===== EFECTOS DE FOCUS MEJORADOS ===== */
.form-group:focus-within label {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ===== MICRO-INTERACCIONES ===== */
.login-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.form-group input:not(:placeholder-shown) + .floating-label {
    transform: translateY(-12px) scale(0.8);
    color: var(--primary-color);
}