/* ================== ESTILOS DEL LOGIN MEJORADOS ================== */
/* Archivo: css/login.css */
/* Diseño profesional y organizado para el sistema de login */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #059669;
    --secondary-dark: #047857;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --card-bg-light: #334155;
    --border-color: #475569;
    --border-light: #64748b;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================== PARTÍCULAS DE FONDO ================== */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    opacity: 0.6;
}

.particle {
    position: absolute;
    width: 1px;
    height: 1px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite;
    opacity: 0.4;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) rotate(0deg); 
        opacity: 0.4; 
    }
    50% { 
        transform: translateY(-30px) translateX(10px) rotate(180deg); 
        opacity: 0.8; 
    }
}

/* ================== CONTENEDOR PRINCIPAL ================== */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
}

/* ================== HEADER Y LOGO ================== */
.header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    z-index: 10;
    width: 100%;
    max-width: 700px;
}

.logo {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(37, 99, 235, 0.4));
    display: block;
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% { filter: drop-shadow(0 0 20px rgba(37, 99, 235, 0.3)); }
    100% { filter: drop-shadow(0 0 40px rgba(37, 99, 235, 0.6)); }
}

.brand-name {
    font-size: clamp(1.8rem, 4.5vw, 2.2rem);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.brand-tagline {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--spacing-lg);
    opacity: 0.9;
}

.welcome-message {
    padding: var(--spacing-lg);
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-xl);
    text-align: center;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.welcome-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.welcome-message p {
    margin: var(--spacing-xs) 0;
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.welcome-message p:first-child {
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    font-weight: 700;
    color: var(--primary-color);
}

/* ================== CONTENEDOR DE FORMULARIOS ================== */
.forms-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
    max-width: 900px;
    width: 100%;
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(30px);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: 
        var(--shadow-xl),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

.forms-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.6;
}

/* ================== SECCIONES DE FORMULARIO ================== */
.form-section {
    padding: var(--spacing-xl);
    background: rgba(15, 23, 42, 0.8);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.form-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.1);
}

.form-section:hover::before {
    opacity: 1;
}

.form-title {
    font-size: clamp(1.4rem, 3.5vw, 1.6rem);
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    text-align: center;
    position: relative;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.form-subtitle {
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--spacing-xl);
    font-weight: 400;
}

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

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    transition: color var(--transition-fast);
    position: relative;
}

.form-label i {
    margin-right: var(--spacing-xs);
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.form-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: clamp(0.95rem, 2.5vw, 1rem);
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
    font-weight: 500;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: rgba(15, 23, 42, 0.95);
    transform: translateY(-1px);
}

.form-input:hover {
    border-color: var(--border-light);
}

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

/* ================== BOTONES ================== */
.btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: clamp(0.95rem, 2.5vw, 1rem);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    letter-spacing: 0.025em;
    min-height: 48px;
}

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

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--secondary-dark), var(--secondary-color));
}

/* ================== MENSAJES DE ESTADO ================== */
.message {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border-left: 4px solid;
    animation: slideInRight 0.3s ease-out;
}

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

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--error-color);
    color: #fca5a5;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success-color);
    color: #86efac;
}

.message.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning-color);
    color: #fcd34d;
}

/* ================== ENLACES Y NAVEGACIÓN ================== */
.form-links {
    text-align: center;
    margin-top: var(--spacing-md);
}

.form-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: clamp(0.85rem, 2.2vw, 0.9rem);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
}

.form-links a:hover {
    color: var(--primary-light);
    background: rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* ================== FOOTER ================== */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    margin-top: var(--spacing-2xl);
    padding: var(--spacing-lg);
    max-width: 700px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
    font-weight: 500;
}

.footer a:hover {
    color: var(--primary-light);
}

/* ================== RESPONSIVE DESIGN ================== */
@media (min-width: 768px) {
    .forms-container {
        grid-template-columns: 1fr 1fr;
        max-width: 1000px;
        gap: var(--spacing-2xl);
        padding: var(--spacing-2xl);
    }

    .form-section {
        padding: var(--spacing-2xl);
    }

    .header {
        margin-bottom: var(--spacing-2xl);
    }
}

@media (min-width: 1024px) {
    .forms-container {
        max-width: 1100px;
        padding: var(--spacing-2xl);
    }

    .form-section {
        padding: var(--spacing-2xl);
    }
}

@media (max-width: 767px) {
    .main-container {
        padding: var(--spacing-md);
    }

    .forms-container {
        padding: var(--spacing-lg);
        gap: var(--spacing-lg);
    }

    .form-section {
        padding: var(--spacing-lg);
    }

    .header {
        margin-bottom: var(--spacing-xl);
    }

    .welcome-message {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .main-container {
        padding: var(--spacing-sm);
    }

    .forms-container {
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }

    .form-section {
        padding: var(--spacing-md);
    }

    .header {
        margin-bottom: var(--spacing-lg);
    }

    .welcome-message {
        padding: var(--spacing-sm);
    }
}

/* ================== ANIMACIONES ================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section {
    animation: fadeInUp 0.6s ease-out;
}

.form-section:nth-child(2) {
    animation-delay: 0.2s;
}

/* ================== ESTADOS DE CARGA ================== */
.btn.loading {
    opacity: 0.8;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* ================== MEJORAS DE ACCESIBILIDAD ================== */
.form-input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ================== OPTIMIZACIONES PARA MÓVILES ================== */
@media (max-width: 768px) {
    .form-input {
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .btn {
        min-height: 48px; /* Tamaño mínimo para touch */
    }
}

/* ================== SOPORTE PARA MODO OSCURO ================== */
@media (prefers-color-scheme: dark) {
    :root {
        --dark-bg: #000000;
        --card-bg: #0f0f0f;
    }
}

/* ================== REDUCCIÓN DE MOVIMIENTO ================== */
@media (prefers-reduced-motion: reduce) {
    .particle,
    .form-section,
    .btn,
    .welcome-message::before {
        animation: none;
        transition: none;
    }
}
