/* Fondo general de la pantalla de carga */
/* --- CSS LOADER MEJORADO --- */

.pace {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(
        ellipse at center,
        rgba(20, 20, 30, 0.7) 0%,
        rgba(10, 10, 15, 0.85) 100%
    );
    background: radial-gradient(
        ellipse at center,
        rgba(20, 20, 30, 0.6) 0%,
        rgba(10, 10, 15, 0.75) 100%
    );
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.3s ease-in-out,
        visibility 0.3s ease-in-out;
}

/* Solo se muestra si tiene esta clase específica */
.pace.pace-active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

/* --- Elementos internos --- */
.pace .pace-activity {
    position: relative;
    width: 140px;
    height: 140px;
    background-image: url("/assets/images/login.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 70%;
    z-index: 10;
    animation: pace-logo-pulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(7, 7, 90, 0.4));
}

@keyframes pace-logo-pulse {
    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(7, 7, 90, 0.4));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 30px rgba(7, 7, 90, 0.6));
    }
}

.pace .pace-activity::before {
    content: "";
    position: absolute;
    inset: -20px;
    border: 5px solid transparent;
    border-top: 5px solid #07075a;
    border-right: 5px solid rgba(7, 7, 90, 0.3);
    border-radius: 50%;
    z-index: -1;
    animation: pace-spin-fast 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55)
        infinite;
}

.pace .pace-activity::after {
    content: "";
    position: absolute;
    inset: -10px;
    border: 3px solid transparent;
    border-bottom: 3px solid rgba(255, 255, 255, 0.4);
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    z-index: -2;
    animation: pace-spin-medium 2s linear infinite reverse;
}

.pace::after {
    content: "CARGANDO";
    color: rgba(255, 255, 255, 0.9);
    font-family:
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 6px;
    margin-top: 60px;
    animation: pace-text-glow 2s ease-in-out infinite;
}

@keyframes pace-spin-fast {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pace-spin-medium {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pace-text-glow {
    0%,
    100% {
        opacity: 0.6;
        letter-spacing: 6px;
    }
    50% {
        opacity: 1;
        letter-spacing: 7px;
        text-shadow: 0 0 20px rgba(7, 7, 90, 0.5);
    }
}

/* Responsivo */
@media (max-width: 768px) {
    .pace .pace-activity {
        width: 100px;
        height: 100px;
    }
    .pace .pace-activity::before {
        inset: -15px;
    }
}
