/* ========================================
   RESET Y VARIABLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    
    /* Colores neutros */
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --input-bg: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    /* Transiciones */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   ESTILOS GENERALES
   ======================================== */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ========================================
   FONDO ANIMADO
   ======================================== */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 15s ease-in-out infinite;
}

.glow-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -250px;
    right: -250px;
    animation-delay: 0s;
}

.glow-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    bottom: -200px;
    left: -200px;
    animation-delay: 5s;
}

.glow-3 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ========================================
   CONTENEDOR PRINCIPAL
   ======================================== */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

/* ========================================
   TARJETA DE LOGIN
   ======================================== */
.login-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   HEADER DEL FORMULARIO
   ======================================== */
.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.icon-wrapper {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: var(--gradient-primary);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.lock-icon {
    width: 32px;
    height: 32px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
}

/* ========================================
   FORMULARIO
   ======================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-icon {
    width: 18px;
    height: 18px;
    color: var(--primary-color);
}

/* ========================================
   INPUTS
   ======================================== */
.input-box {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all var(--transition-normal);
}

.input-box::placeholder {
    color: var(--text-secondary);
}

.input-box:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(51, 65, 85, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-box.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    min-height: 18px;
    margin-top: -4px;
}

/* ========================================
   PASSWORD WRAPPER
   ======================================== */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper .input-box {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: var(--primary-light);
}

.eye-icon {
    width: 20px;
    height: 20px;
}

/* ========================================
   OPCIONES DEL FORMULARIO
   ======================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
}

/* Checkbox personalizado */
.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: var(--input-bg);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    transition: all var(--transition-fast);
    position: relative;
}

.checkbox-container input[type="checkbox"]:checked ~ .checkmark {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
}

.checkbox-container input[type="checkbox"]:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.forgot-password {
    font-size: 14px;
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ========================================
   BOTÓN DE LOGIN
   ======================================== */
.btn-login {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-login::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;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-login:active {
    transform: translateY(0);
}

.arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.btn-login:hover .arrow-icon {
    transform: translateX(4px);
}

/* ========================================
   FOOTER DEL CARD
   ======================================== */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.login-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* ========================================
   INFORMACIÓN ADICIONAL
   ======================================== */
.login-info {
    margin-top: 24px;
    text-align: center;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.6);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.secure-badge svg {
    width: 16px;
    height: 16px;
    color: #10b981;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .icon-wrapper {
        width: 56px;
        height: 56px;
    }
    
    .lock-icon {
        width: 28px;
        height: 28px;
    }
}

/* ========================================
   UTILIDADES DE ACCESIBILIDAD
   ======================================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
