/* --- LOADING SYSTEM --- */
.page-loader {
    position: fixed;
    inset: 0;
    background: #050505; /* Mesmo fundo escuro do tema */
    z-index: 999998; /* Abaixo do popup (999999), acima do site (1) */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* Estado escondido (depois de carregar) */
.page-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

/* --- SPINNER TECH (Anéis Concêntricos) --- */
.spinner-box {
    position: relative;
    width: 80px;
    height: 80px;
}

.circle-1, .circle-2, .circle-3 {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #e2e2e2; /* Verde Tech */
}

.circle-1 {
    inset: 0;
    animation: spin 1s linear infinite;
    border-top-color: rgba(255, 255, 255, 0.786);
}

.circle-2 {
    inset: 10px;
    animation: spin 1.5s linear infinite reverse;
    border-top-color: rgb(171, 171, 171);
}

.circle-3 {
    inset: 20px;
    width: 40px;
    height: 40px;
    background: radial-gradient(circle, #adadad 30%, transparent 70%);
    animation: pulse 1s ease-in-out infinite alternate;
    border: none;
    filter: blur(5px);
}

/* --- BARRA DE PROGRESSO & TEXTO --- */
.loader-text {
    text-align: center;
    width: 200px;
}

#loader-status {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: #ffffff;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.progress-bar-bg {
    width: 100%;
    height: 2px;
    background: #222;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #ffffff;
    box-shadow: 0 0 10px #31d094;
    transition: width 0.2s linear;
    animation: loadingProgress 1.5s ease-in-out forwards;
}

/* --- KEYFRAMES --- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* Motion OFF */
body.motion-off .circle-1, 
body.motion-off .circle-2, 
body.motion-off .circle-3,
body.motion-off .progress-fill {
    animation: none !important;
}
body.motion-off .progress-fill { width: 100%; }