/**
 * MediSys SaaS - Estilos Modulares: Pantalla de Login
 * Archivo: assets/css/modules/login.css
 * 
 * Contiene el diseño visual, efectos de glassmorphism,
 * micro-animaciones y estilos de controles de acceso.
 */

/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================================================== */
:root {
    --msblue: #0ea5e9;
    --msblue-dark: #0369a1;
    --ms-glass: rgba(255, 255, 255, 0.85);
}

body {
    background: #f0f9ff;
    background-image: 
        radial-gradient(at 0% 0%, rgba(14, 165, 233, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.1) 0px, transparent 50%),
        url('https://www.transparenttextures.com/patterns/cubes.png');
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow-x: hidden;
}

/* ==========================================================================
   2. ELEMENTOS DECORATIVOS DE FONDO (GLOW AMBIENTAL)
   ========================================================================== */
.glow-circle {
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, transparent 70%);
    z-index: -1;
    filter: blur(60px);
    animation: pulse-glow 8s infinite alternate;
}

@keyframes pulse-glow {
    from {
        transform: scale(1);
        opacity: 0.5;
    }
    to {
        transform: scale(1.3);
        opacity: 0.8;
    }
}

/* ==========================================================================
   3. TARJETA PRINCIPAL (GLASSMORPHISM CARD)
   ========================================================================== */
.login-card {
    background: var(--ms-glass);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 3rem;
    width: 100%;
    max-width: 460px;
    padding: 4rem;
    box-shadow: 
        0 30px 60px -12px rgba(14, 165, 233, 0.15),
        0 18px 36px -18px rgba(0, 0, 0, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 10;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #0ea5e9, transparent, #0ea5e9);
    border-radius: 3rem;
    z-index: -1;
    opacity: 0.1;
}

/* ==========================================================================
   4. CAMPOS DE ENTRADA Y FORMULARIOS FLOTANTES
   ========================================================================== */
.form-control {
    background: rgba(241, 245, 249, 0.8);
    border: 2px solid transparent;
    color: #0f172a;
    height: 4rem;
    border-radius: 1.5rem;
    padding: 0 1.5rem;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
    background: #ffffff;
    border-color: #0ea5e9;
    box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.15);
    transform: translateY(-2px);
}

.floating-group label {
    color: #64748b;
    left: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    pointer-events: none;
}

.floating-group input:focus + label,
.floating-group input:not(:placeholder-shown) + label {
    color: #0ea5e9;
    transform: translateY(-1.75rem) scale(0.9);
    font-weight: 900;
}

/* ==========================================================================
   5. BOTÓN DE ACCESO PRINCIPAL
   ========================================================================== */
.btn-login {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    height: 4rem;
    border-radius: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.85rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 15px 30px -5px rgba(14, 165, 233, 0.4);
    border: none;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-login:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px -5px rgba(14, 165, 233, 0.5);
    filter: brightness(1.1);
}

.btn-login:active {
    transform: translateY(-1px) scale(0.98);
}

/* ==========================================================================
   6. LOGO FLOTANTE Y ANIMACIONES DE TRANSICIÓN
   ========================================================================== */
.logo-box {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #0ea5e9;
    box-shadow: 0 20px 40px -10px rgba(14, 165, 233, 0.2);
    border: 1px solid rgba(14, 165, 233, 0.1);
    margin-bottom: 2rem;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-stagger > * {
    animation: slide-up 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* Animación de sacudida para errores de autenticación */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}
