/**
 * Global request loader — shown during fetch/AJAX/form submissions.
 */
.global-request-loader {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.global-request-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.global-request-loader__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    animation: grlBackdropIn 0.35s ease;
}

.global-request-loader__panel {
    position: relative;
    z-index: 1;
    min-width: 168px;
    padding: 22px 28px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow:
        0 24px 48px rgba(15, 23, 42, 0.16),
        0 0 0 1px rgba(15, 118, 110, 0.08);
    text-align: center;
    transform: translateY(8px) scale(0.96);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.global-request-loader.is-visible .global-request-loader__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.global-request-loader__rings {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
}

.global-request-loader__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: grlSpin 1.1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

.global-request-loader__ring:nth-child(1) {
    border-top-color: #059669;
    border-right-color: rgba(5, 150, 105, 0.25);
    animation-duration: 0.95s;
}

.global-request-loader__ring:nth-child(2) {
    inset: 7px;
    border-bottom-color: #0d9488;
    border-left-color: rgba(13, 148, 136, 0.2);
    animation-duration: 1.25s;
    animation-direction: reverse;
}

.global-request-loader__ring:nth-child(3) {
    inset: 14px;
    border-top-color: #34d399;
    animation-duration: 0.75s;
}

.global-request-loader__dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #059669, #0d9488);
    animation: grlPulse 1.2s ease-in-out infinite;
}

.global-request-loader__label {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #0f172a;
}

.global-request-loader__bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 99991;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.global-request-loader__bar.is-active {
    opacity: 1;
}

.global-request-loader__bar::before {
    content: '';
    display: block;
    height: 100%;
    width: 36%;
    background: linear-gradient(90deg, transparent, #059669, #34d399, transparent);
    animation: grlBarSlide 1.05s ease-in-out infinite;
}

@keyframes grlSpin {
    to { transform: rotate(360deg); }
}

@keyframes grlPulse {
    0%, 100% { transform: scale(0.85); opacity: 0.65; }
    50% { transform: scale(1.15); opacity: 1; }
}

@keyframes grlBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes grlBarSlide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
    .global-request-loader__ring,
    .global-request-loader__dot,
    .global-request-loader__bar::before {
        animation: none;
    }

    .global-request-loader__ring:nth-child(1) {
        border-color: rgba(5, 150, 105, 0.35);
        border-top-color: #059669;
    }
}
