/* Global page / request loader. Colours come from the shared theme tokens in theme.css. */

.rf-loader {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgb(7 18 48 / 45%);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.rf-loader[hidden] {
    display: none;
}

.rf-loader.is-visible {
    opacity: 1;
}

.rf-loader__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    min-width: 190px;
    max-width: 320px;
    padding: 1.5rem 2rem 1.25rem;
    border-radius: var(--rf-radius-lg, 18px);
    background: var(--rf-surface, #fff);
    box-shadow: var(--rf-shadow-lg, 0 22px 48px rgb(23 33 61 / 18%));
    text-align: center;
    transform: translateY(8px) scale(0.97);
    transition: transform 0.2s ease;
}

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

.rf-loader__spinner {
    position: relative;
    width: 72px;
    height: 72px;
}

.rf-loader__ring {
    position: absolute;
    inset: 0;
    border: 4px solid var(--rf-teal-soft, rgb(22 215 170 / 14%));
    border-top-color: var(--rf-teal, #16d7aa);
    border-right-color: var(--rf-blue, #0a84ff);
    border-radius: 50%;
    animation: rf-loader-spin 0.9s linear infinite;
}

.rf-loader__logo {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: url("../images/logo.png") center / contain no-repeat;
    animation: rf-loader-pulse 1.6s ease-in-out infinite;
}

.rf-loader__text {
    margin: 0;
    font-family: var(--rf-font, "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--rf-navy, #17213d);
}

body.rf-loader-active,
body.rf-loader-active * {
    cursor: progress;
}

@keyframes rf-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes rf-loader-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(0.88);
        opacity: 0.75;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rf-loader,
    .rf-loader__panel {
        transition: none;
    }

    .rf-loader__ring {
        animation-duration: 2.4s;
    }

    .rf-loader__logo {
        animation: none;
    }
}