/* Loading feedback: a top progress bar for page loads and a spinner inside the pressed button. */
.nm-loader-bar {
    position: fixed; z-index: 1090; inset: 0 0 auto; height: 3px; pointer-events: none;
    opacity: 0; transition: opacity .25s;
}
.nm-loader-bar::before {
    content: ""; display: block; height: 100%; width: 100%;
    background: linear-gradient(90deg, var(--arena-teal, #5cc8c0), var(--arena-gold, #ffc000));
    box-shadow: 0 0 10px var(--arena-gold-line, #ffc00059);
    transform-origin: 0 50%; transform: scaleX(0);
}
[dir="rtl"] .nm-loader-bar::before { transform-origin: 100% 50%; background: linear-gradient(270deg, var(--arena-teal, #5cc8c0), var(--arena-gold, #ffc000)); }
.nm-loader-bar.is-active { opacity: 1; }
/* Quick start, then a slow crawl that never reaches the end until the next page arrives. */
.nm-loader-bar.is-active::before { animation: nm-loader-crawl 12s cubic-bezier(.08, .7, .2, 1) forwards; }

@keyframes nm-loader-crawl {
    0% { transform: scaleX(0); }
    8% { transform: scaleX(.35); }
    30% { transform: scaleX(.65); }
    100% { transform: scaleX(.94); }
}

/* The label stays in place (no layout shift); only its ink is hidden behind the spinner. */
.is-loading:not(input) {
    position: relative; pointer-events: none; cursor: progress;
    -webkit-text-fill-color: transparent;
}
.is-loading:not(input) > * { opacity: 0; }
.is-loading:not(input)::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 1.05em; height: 1.05em; margin: -.525em 0 0 -.525em;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    animation: nm-loader-spin .7s linear infinite;
}
input.is-loading { pointer-events: none; cursor: progress; opacity: .65; }

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

@media (prefers-reduced-motion: reduce) {
    .nm-loader-bar.is-active::before { animation: none; transform: scaleX(.6); }
    .is-loading:not(input)::after { animation-duration: 1.6s; }
}
