/* ==========================================================================
   Variables de Color Estilo Premium Dark-Mode / High-Tech
   ========================================================================== */
:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary-glow: #3b82f6;
    --secondary-glow: #8b5cf6;
    --accent-color: #6366f1;
    --error-color: #f43f5e;
}

/* ==========================================================================
   Contenedor Principal con Fondo Dinámico "Aurora"
   ========================================================================== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    /* Dos esferas de gradiente animadas en el fondo */
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* Animación sutil flotante para simular movimiento en el fondo */
.auth-container::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--primary-glow);
    filter: blur(120px);
    top: 20%;
    left: 25%;
    border-radius: 50%;
    opacity: 0.12;
    animation: floatAurora 12s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes floatAurora {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.2); }
}

/* ==========================================================================
   Tarjeta Glassmorphism Futurista
   ========================================================================== */
.auth-box {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 45px 40px;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    /* Entrada animada suave al cargar la página */
    animation: fadeInCard 0.6s cubic-bezier(0.16, 1, 0.3, 1) ease-out;
}

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



/* ==========================================================================
   Formularios e Inputs Interactivos
   ========================================================================== */
.auth-form .form-group {
    margin-bottom: 22px;
    display: flex;
    flex-direction: column;
}

.auth-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
}

/* Input Modernizado */
.auth-form input[type="text"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: rgba(15, 23, 42, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    outline: none;
}

/* Efecto de Foco con Brillo Neon */
.auth-form .form-group:focus-within label {
    color: var(--primary-glow);
}

.auth-form input:focus {
    background-color: rgba(15, 23, 42, 0.6);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15),
                0 0 20px rgba(99, 102, 241, 0.1);
}

/* Contenedor del Boton del Ojo */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-wrapper input {
    padding-right: 50px !important;
}

.toggle-password-btn {
    position: absolute;
    right: 6px;
    height: calc(100% - 12px);
    width: 40px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.toggle-password-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   Botón con Gradiente Líquido
   ========================================================================== */
.btn-primary.btn-block {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-glow), var(--secondary-glow));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.25);
    position: relative;
    overflow: hidden;
}

/* Capa brillante en el hover */
.btn-primary.btn-block::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: all 0.6s ease;
}

.btn-primary.btn-block:hover::before {
    left: 100%;
}

.btn-primary.btn-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
    filter: brightness(1.05);
}

.btn-primary.btn-block:active {
    transform: translateY(0) scale(0.98);
}

/* Spinner de Carga Avanzado */
.auth-form.loading .btn-primary {
    pointer-events: none;
    color: transparent;
}

.auth-form.loading .btn-primary::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    border: 3px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-spinner 0.6s linear infinite;
}

@keyframes button-spinner {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Alerta de Error Animada (Vibración)
   ========================================================================== */
.auth-error {
    color: #ff859b;
    background-color: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.2);
    padding: 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    text-align: center;
    margin-top: 20px;
    font-weight: 500;
    display: none;
    animation: shakeError 0.4s ease-in-out;
}

.auth-error:not(:empty) {
    display: block;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

/* ============================================
   AUTH LOGIN - BRANDING ÉPICO EN GRANDE
   ============================================ */

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    cursor: default;
}

/* Control del tamaño del nuevo logo PNG en grande */
.auth-big-logo {
    height: 150px; /* Tamaño ideal: imponente pero sin romper el diseño */
    width: auto;  /* Mantiene la proporción perfecta */
    object-fit: contain;
    margin-bottom: 1rem;
    
    /* Animación sutil de entrada para que se vea más pro */
    animation: floatingLogo 4s ease-in-out infinite;
}

/* Efecto interactivo al pasar el mouse sobre la caja de login */
.auth-box:hover .auth-big-logo {
    filter: drop-shadow(0 4px 12px rgba(59, 130, 246, 0.5));
    transform: scale(1.03);
    transition: all 0.3s ease;
}

.auth-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
    text-align: center;
    font-style: italic;
}

/* --- Efecto Flotante Sutil para el Logo --- */
@keyframes floatingLogo {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-6px); /* El logo flota suavemente arriba y abajo */
    }
    100% {
        transform: translateY(0px);
    }
}