/* === SISTEMA DE DISEÑO MODERNO === */
:root {
    /* Paleta de colores contemporánea */
    --bg-primary: linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 100%);
    --bg-secondary: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
    --bg-tertiary: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
    --bg-surface: rgba(30, 30, 30, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    
    /* Gradientes de acento modernos */
    --accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-gradient-hover: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --danger-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    
    /* Colores sólidos para textos y elementos */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --text-accent: #667eea;
    
    /* Bordes y sombras */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-focus: rgba(102, 126, 234, 0.5);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    
    /* Espaciado basado en sistema 8px */
    --space-1: 0.25rem;  /* 4px */
    --space-2: 0.5rem;   /* 8px */
    --space-3: 0.75rem;  /* 12px */
    --space-4: 1rem;     /* 16px */
    --space-5: 1.25rem;  /* 20px */
    --space-6: 1.5rem;   /* 24px */
    --space-8: 2rem;     /* 32px */
    --space-10: 2.5rem;  /* 40px */
    --space-12: 3rem;    /* 48px */
    --space-16: 4rem;    /* 64px */
    
    /* Radios modernos */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    
    /* Tipografía mejorada */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}



/* === RESET Y BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    background: 
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(79, 172, 254, 0.05) 0%, transparent 50%),
        linear-gradient(135deg, #0c0c0c 0%, #1a1a1a 50%, #0c0c0c 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="0.5" fill="rgba(255,255,255,0.02)"/><circle cx="80" cy="80" r="0.3" fill="rgba(255,255,255,0.01)"/><circle cx="60" cy="30" r="0.4" fill="rgba(255,255,255,0.015)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
    pointer-events: none;
    z-index: -1;
}



/* === CONTAINER PRINCIPAL === */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    position: relative;
}

.login-card {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: var(--space-12);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
    
    /* Glassmorphism avanzado */
    background-image: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* Eliminamos hover effects innecesarios */

/* === HEADER === */
.header-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    letter-spacing: -0.025em;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-hover));
    border-radius: 1px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
    font-family: var(--font-primary);
    line-height: 1.5;
}

/* === FORMULARIO === */
.login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    height: 48px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 16px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-size: 15px;
}

/* === CHECKBOX === */
.form-options {
    margin-bottom: 32px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    background: var(--input-bg);
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-input:checked + .checkbox-custom::after {
    opacity: 1;
}

.checkbox-wrapper:hover .checkbox-custom {
    border-color: var(--accent-primary);
}

/* === BOTÓN === */
.login-button {
    width: 100%;
    height: 56px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    letter-spacing: 0.025em;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-6);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
}

.login-button::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 ease;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    transform: translateY(-2px);
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

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

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* === FOOTER === */
.form-footer {
    text-align: center;
    margin-top: 24px;
}

.link {
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.divider {
    margin: 0 12px;
    color: var(--text-muted);
    font-size: 14px;
}

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

.login-card {
    animation: fadeInUp 0.6s ease-out;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .login-container {
        padding: 16px;
    }
    
    .login-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    
    .logo-title {
        font-size: 24px;
    }
    
    .form-input {
        height: 44px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .login-button {
        height: 44px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 20px;
    }
    
    .logo-title {
        font-size: 22px;
    }
    
    .form-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .divider {
        display: none;
    }
    
    .link {
        display: block;
        margin: 4px 0;
    }
}

/* Efectos simplificados ya incluidos arriba */



/* === TRANSICIONES SUAVES === */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* === TRANSICIONES PARA FORMULARIO LOGIN/REGISTRO === */
.form-group {
    transition: all 0.3s ease;
}

.subtitle {
    transition: all 0.3s ease;
}

#submitText {
    transition: all 0.3s ease;
}

.form-footer .link {
    transition: all 0.3s ease;
}

/* Efecto hover mejorado para toggle link */
#toggleFormLink:hover {
    color: var(--accent-primary);
    text-decoration: underline;
}

/* === MENSAJES DE DJANGO === */
.messages-container {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    transition: all 0.3s ease;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color, #10b981);
    border-left: 4px solid var(--success-color, #10b981);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color, #ef4444);
    border-left: 4px solid var(--error-color, #ef4444);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color, #f59e0b);
    border-left: 4px solid var(--warning-color, #f59e0b);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
    border-left: 4px solid var(--accent-primary);
}

/* Animación de aparición para mensajes */
.alert {
    animation: slideInDown 0.4s ease-out;
}

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

/* Animación suave para campos que aparecen */
#confirmPasswordGroup {
    opacity: 1;
    max-height: 100px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

#confirmPasswordGroup[style*="display: none"] {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

/* === MEJORAS DE ACCESIBILIDAD === */
.form-input:focus,
.login-button:focus,
.theme-button:focus,
.checkbox-wrapper:focus-within {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
} 