/* =============================================================================
   login.css – RTP Login Screen, Welcome and Module Selector

   Aesthetic: White background with particle/node animation
   Brand: RTP – Road to Performance
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* =============================================================================
   Login Screen
   ============================================================================= */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.login-screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
}

/* Particle canvas (background) */
#particlesCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Contenido centrado del login */
.login-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 480px;
    width: 90%;
    padding: 2rem;
}

/* Logo RTP */
.login-logo {
    width: 220px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 4px 12px rgba(26, 37, 71, 0.15));
    animation: logoFloat 3s ease-in-out infinite;
}

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

/* Eslogan */
.login-slogan {
    font-family: 'Inter', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    color: #1a2547;
    line-height: 1.2;
    margin-bottom: 2.5rem;
    letter-spacing: -0.03em;
}

/* Label "ACCESO AUTORIZADO" */
.login-access-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: #64748b;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

/* Campo de email */
.login-input-group {
    width: 100%;
    position: relative;
    margin-bottom: 1.25rem;
}

.login-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: #1e293b;
    outline: none;
    transition: all 0.25s ease;
}

.login-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.login-input:focus {
    border-color: #1a2547;
    box-shadow: 0 0 0 3px rgba(26, 37, 71, 0.08);
    background: #ffffff;
}

.login-input:focus + .login-input-icon,
.login-input:focus ~ .login-input-icon {
    color: #1a2547;
}

/* LOG IN button */
.login-btn {
    width: 100%;
    padding: 14px 24px;
    background: #1a2547;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.login-btn:hover {
    background: #243264;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 37, 71, 0.35);
}

.login-btn:hover::before {
    opacity: 1;
}

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

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

/* Error message */
.login-error {
    width: 100%;
    padding: 10px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 1rem;
    display: none;
    animation: shakeError 0.4s ease;
}

.login-error.visible {
    display: block;
}

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

/* Footer del login */
.login-footer {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    letter-spacing: 0.03em;
    z-index: 1;
}

.login-footer a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #1a2547;
}


/* =============================================================================
   Welcome Screen (Pantalla de Bienvenida)
   ============================================================================= */
.welcome-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b1120 0%, #131d38 50%, #0f172a 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.welcome-screen.active {
    opacity: 1;
    pointer-events: all;
}

.welcome-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.welcome-logo {
    width: 160px;
    height: auto;
    margin-bottom: 2rem;
    animation: welcomePulse 2s ease-in-out infinite;
}

@keyframes welcomePulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

.welcome-text {
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    animation: fadeSlideUp 0.6s ease-out 0.2s both;
}

.welcome-subtext {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 2.5rem;
    animation: fadeSlideUp 0.6s ease-out 0.4s both;
}

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

/* Barra de carga */
.welcome-progress-container {
    width: 320px;
    max-width: 80%;
    animation: fadeSlideUp 0.6s ease-out 0.6s both;
}

.welcome-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.welcome-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    border-radius: 4px;
    transition: width 0.15s linear;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.5);
}

.welcome-progress-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    color: #475569;
    text-align: center;
    margin-top: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}


/* =============================================================================
   Module Selector
   ============================================================================= */
.module-selector {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0b1120 0%, #131d38 50%, #0f172a 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.module-selector.active {
    opacity: 1;
    pointer-events: all;
}

.module-selector.hidden {
    opacity: 0;
    pointer-events: none;
}

.module-selector__header {
    text-align: center;
    margin-bottom: 3rem;
}

.module-selector__logo {
    width: 120px;
    height: auto;
    margin-bottom: 1.5rem;
}

.module-selector__title {
    font-family: 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
}

.module-selector__subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #64748b;
}

/* Module grid */
.module-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 680px;
    width: 90%;
}

.module-card {
    background: rgba(17, 26, 46, 0.8);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.05), rgba(129, 140, 248, 0.05));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.module-card:hover {
    transform: translateY(-6px);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(56, 189, 248, 0.1);
}

.module-card:hover::before {
    opacity: 1;
}

.module-card__icon {
    font-size: 3rem;
    margin-bottom: 1.25rem;
    display: block;
    position: relative;
    z-index: 1;
}

.module-card__title {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.module-card__desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* Logout button in the selector */
.module-selector__logout {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 16px;
    color: #94a3b8;
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.module-selector__logout:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: #f87171;
}


/* =============================================================================
   Responsive
   ============================================================================= */
@media (max-width: 640px) {
    .login-slogan {
        font-size: 1.6rem;
    }

    .login-logo {
        width: 160px;
    }

    .module-cards {
        grid-template-columns: 1fr;
        max-width: 340px;
    }

    .module-card {
        padding: 2rem 1.5rem;
    }

    .welcome-text {
        font-size: 1.2rem;
    }
}
