/* Page transition progress and submit feedback. Flat, theme-aware, no layout shift. */
.nx-progress {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  z-index: 3000;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
}
.nx-progress[hidden] { display: none !important; }
.nx-progress-bar {
  display: block;
  width: 40%;
  height: 100%;
  background: var(--nx-accent, #2f63d8);
  opacity: 0;
  transform: translateX(-110%);
}
.nx-progress.is-active .nx-progress-bar {
  animation:
    nx-progress-reveal 0s linear 200ms forwards,
    nx-progress-slide 1.1s cubic-bezier(.4, 0, .2, 1) 200ms infinite;
}
@keyframes nx-progress-reveal { to { opacity: 1; } }
@keyframes nx-progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(350%); }
}

.nx-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* The first submit is left untouched so its name/value still posts. */
.nx-submitting { cursor: progress; }
.button.nx-busy,
button.nx-busy {
  position: relative !important;
  color: transparent !important;
  cursor: progress !important;
}
.nx-busy > * { visibility: hidden !important; }
.nx-busy::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  margin: -7.5px 0 0 -7.5px;
  border: 2px solid var(--nx-accent, #2f63d8);
  border-right-color: transparent;
  border-radius: 50%;
  visibility: visible;
  animation: nx-spin .7s linear infinite;
}
.button-primary.nx-busy::after { border-color: #fff; border-right-color: transparent; }
.button-danger.nx-busy::after { border-color: var(--nx-red, #cf1f1f); border-right-color: transparent; }
.nx-busy-input {
  opacity: .6 !important;
  cursor: progress !important;
}
@keyframes nx-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .nx-progress.is-active .nx-progress-bar {
    width: 100%;
    animation: nx-progress-reveal 0s linear 200ms forwards;
  }
  .nx-busy::after { animation-duration: 1.8s; }
}
