/* Variables CSS */
:root {
    --primary-blue: #1e3a8a;
    --secondary-blue: #3b82f6;
    --logo-bg: #1e40af;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.95);
    --text-muted: rgba(255, 255, 255, 0.9);
    --shadow-light: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 12px 40px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.2);
}

/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

/* Video de fondo */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(30, 58, 138, 0.8) 0%, 
        rgba(59, 130, 246, 0.6) 50%,
        rgba(30, 58, 138, 0.8) 100%);
    z-index: -1;
}

/* Contenedor principal del login */
#login-container {
    opacity: 0;
    transform: translateY(30px);
    transition: none;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

input {
  color-scheme: dark;
}

/* Clase para activar animación del contenedor completo */
#login-container.animate {
    animation: fadeInUp 0.8s ease forwards;
}

/* Tarjeta de login con glassmorphism */
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent);
}

/* Sección del logo con contenedor azul para contraste */
.logo-section {
    text-align: center;
    margin-bottom: 2.5rem;
    background: var(--logo-bg);
    margin: -3rem -2.5rem 2.5rem -2.5rem;
    padding: 2rem;
    border-radius: 24px 24px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    height: 70px;
    width: auto;
    filter: brightness(1.1);
    /* Eliminadas todas las animaciones y transiciones */
}

/* Sección del encabezado */
.header-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Formulario */
.login-form {
    margin-bottom: 2rem;
    /* Remover estados iniciales de animación */
    opacity: 1;
    transform: translateY(0);
}

/* Clase para activar animación del formulario completo */
.login-form.animate {
    animation: fadeInUp 0.8s ease forwards;
}

/* Estados normales para los elementos del formulario */
.input-group {
    margin-bottom: 2rem;
    /* Remover estados iniciales de animación */
    opacity: 1;
    transform: translateY(0);
}

/* Remover animaciones individuales de elementos */
.input-group.animate {
    /* Remover esta regla ya que ahora animamos todo el formulario */
}

.input-group.animate:nth-child(1) { 
    /* Remover esta regla */
}

.input-group.animate:nth-child(2) { 
    /* Remover esta regla */
}

.input-wrapper {
    position: relative;
}

/* Configuración específica para Font Awesome 6 */
@font-face {
    font-family: "Font Awesome 6 Free";
    font-style: normal;
    font-weight: 900;
    src: url("../../fontawesome/webfonts/fa-solid-900.woff2") format("woff2"),
         url("../../fontawesome/webfonts/fa-solid-900.ttf") format("truetype");
}

/* Asegurar que Font Awesome funcione correctamente */
.fas, .fa-solid {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-style: normal;
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
}

/* Iconos con efectos mejorados y visibles */
.input-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 1;
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-style: normal;
    display: inline-block;
}

/* Efecto hover en el contenedor del input */
.input-wrapper:hover .input-icon {
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Animación cuando el input está en foco */
.form-input:focus ~ .input-icon {
    color: #ffffff;
    transform: translateY(-50%) scale(1.15);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
    animation: iconGlow 2s ease-in-out infinite alternate;
}

/* Inputs con mejor contraste */
.form-input {
    width: 100%;
    padding: 1.2rem 1.5rem 1.2rem 3.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-light);
    outline: none;
    min-height: 56px;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    transition: opacity 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.form-input:focus {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 3px rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.form-input:focus::placeholder {
    opacity: 0;
}

/* Labels flotantes */
.input-label {
    position: absolute;
    left: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-input:focus ~ .input-label,
.form-input:not(:placeholder-shown) ~ .input-label {
    opacity: 1;
    transform: translateY(-3rem) scale(0.85);
    left: 0.5rem;
    color: var(--text-primary);
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Botón de envío con animaciones mejoradas */
.submit-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 14px;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 1;
    transform: translateY(0);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    min-height: 56px;
    animation: buttonPulse 2s ease-in-out infinite;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    transition: left 0.6s ease;
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.submit-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 5px 15px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, 
        rgba(30, 58, 138, 0.9), 
        rgba(59, 130, 246, 0.9));
    border-color: rgba(255, 255, 255, 0.6);
    animation: none;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover::after {
    width: 300px;
    height: 300px;
}

.submit-btn:active {
    transform: translateY(-2px) scale(0.98);
    transition: all 0.1s ease;
}

.btn-icon {
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.submit-btn:hover .btn-icon {
    transform: translateX(6px) rotate(10deg) scale(1.1);
    color: rgba(255, 255, 255, 0.95);
}

.btn-text {
    transition: all 0.3s ease;
}

.submit-btn:hover .btn-text {
    letter-spacing: 0.5px;
}

/* Animación de pulso sutil */
@keyframes buttonPulse {
    0%, 100% {
        box-shadow: var(--shadow-light), 0 0 0 0 rgba(59, 130, 246, 0.4);
    }
    50% {
        box-shadow: var(--shadow-light), 0 0 0 8px rgba(59, 130, 246, 0.1);
    }
}

/* Animación de entrada del botón */
@keyframes buttonSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Aplicar animación de entrada */
.submit-btn.animate-in {
    animation: buttonSlideIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Sección del footer con mejor contraste */
.footer-section {
    text-align: center;
    animation: fadeInUp 0.6s ease 0.4s forwards;
    opacity: 0;
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.footer-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.footer-link:hover {
    border-bottom-color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Animaciones */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .logo-section {
        margin: -2rem -1.5rem 2rem -1.5rem;
        padding: 1.5rem;
        border-radius: 20px 20px 0 0;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .logo {
        height: 60px;
    }
    
    .form-input {
        padding: 1rem 1rem 1rem 3rem;
        font-size: 1rem;
        min-height: 52px;
    }
    
    .input-icon {
        left: 1rem;
        font-size: 1.1rem;
    }
    
    .input-label {
        left: 3rem;
        font-size: 1rem;
    }
}

@media (max-height: 700px) {
    .login-card {
        padding: 2rem;
    }
    
    .header-section {
        margin-bottom: 2rem;
    }
    
    .logo-section {
        margin: -2rem -2rem 2rem -2rem;
        padding: 1.5rem;
    }
    
    .input-group {
        margin-bottom: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}