/* ═══════════════════════════════════════════════════════════════
   NPROGRESS — FULL OVERLAY  ·  MU RAVE HARD
   Overlay fullscreen para loadings bloqueantes (ex: login, AJAX
   crítico do painel). Inclui backdrop blur, vinheta neon e spinner
   duplo com pulse rave.

   IMPORTANTE: este arquivo SUBSTITUI o nprogress.css quando ambos
   estão na mesma página. Em páginas que precisam apenas da barra do
   topo, importe SOMENTE nprogress.css (já incluso via style.css).
   ═══════════════════════════════════════════════════════════════ */

#nprogress {
  position: fixed;
  inset: 0;
  z-index: 9999;

  /* backdrop translúcido — deixa o site visível ao fundo */
  background:
    radial-gradient(ellipse 60% 50% at 50% 50%, rgba(240, 168, 48, .06), transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 90, 43, .04), transparent 70%),
    rgba(7, 4, 3, .35);

  -webkit-backdrop-filter: blur(3px) saturate(115%);
          backdrop-filter: blur(3px) saturate(115%);

  overflow: hidden;
  pointer-events: auto;

  /* fade-in suave do overlay */
  -webkit-animation: nprogress-fade-in 220ms ease-out;
          animation: nprogress-fade-in 220ms ease-out;
}

@keyframes nprogress-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* scanlines sutis para reforçar a vibe cyberpunk */
#nprogress::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, .06) 2px,
    rgba(0, 0, 0, .06) 4px
  );
  opacity: .35;
}

/* vinheta radial sutil nos cantos */
#nprogress::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(7, 4, 3, .25) 100%
  );
}

/* ─── BARRA NO TOPO (mantém visível mesmo no overlay) ─── */
#nprogress .bar {
  position: fixed;
  top: 0; left: 0;
  z-index: 10001;
  width: 100%;
  height: 3px;

  background: linear-gradient(
    90deg,
    #f0a830 0%,
    #ffd98c 25%,
    #ff8a5c 50%,
    #ff5a2b 75%,
    #f0a830 100%
  );
  background-size: 200% 100%;
  -webkit-animation: nprogress-flow 2.4s linear infinite;
          animation: nprogress-flow 2.4s linear infinite;

  box-shadow:
    0 0 10px rgba(240, 168, 48, .85),
    0 0 22px rgba(240, 168, 48, .45),
    0 0 38px rgba(255, 90, 43, .25);

  border-radius: 0 2px 2px 0;
  transition: width 220ms ease;
}

@keyframes nprogress-flow {
  0%   { background-position:   0% 50%; }
  100% { background-position: 200% 50%; }
}

#nprogress .peg {
  display: block;
  position: absolute;
  right: 0;
  width: 140px;
  height: 100%;
  opacity: 1;

  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(240, 168, 48, .35) 40%,
    rgba(255, 90, 43, .9) 100%
  );
  box-shadow:
    0 0 14px #f0a830,
    0 0 28px rgba(240, 168, 48, .7),
    0 0 50px rgba(255, 90, 43, .4);

  -webkit-transform: rotate(2.5deg) translate(0, -3px);
      -ms-transform: rotate(2.5deg) translate(0, -3px);
          transform: rotate(2.5deg) translate(0, -3px);
}

/* ─── SPINNER CENTRAL (anéis duplos + pulse) ─── */
#nprogress .spinner {
  display: block;
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  z-index: 10001;

  width: 96px;
  height: 96px;
  margin: -48px 0 0 -48px;

  /* aura pulsante por trás dos anéis */
  -webkit-animation: nprogress-pulse 2s ease-in-out infinite;
          animation: nprogress-pulse 2s ease-in-out infinite;
}

#nprogress .spinner::before,
#nprogress .spinner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}
/* halo externo rosa */
#nprogress .spinner::before {
  box-shadow:
    0 0 30px rgba(240, 168, 48, .55),
    0 0 60px rgba(240, 168, 48, .25);
}
/* halo interno cyan */
#nprogress .spinner::after {
  inset: 14px;
  box-shadow:
    inset 0 0 20px rgba(255, 90, 43, .35),
    0 0 18px rgba(255, 90, 43, .25);
}

@keyframes nprogress-pulse {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%      { transform: scale(1.06); opacity: .85; }
}

#nprogress .spinner-icon {
  position: absolute;
  inset: 0;
  width: 96px;
  height: 96px;
  box-sizing: border-box;

  border: solid 3px transparent;
  border-top-color: #f0a830;
  border-right-color: rgba(240, 168, 48, .25);
  border-bottom-color: #ff5a2b;
  border-left-color: rgba(255, 90, 43, .25);
  border-radius: 50%;

  filter:
    drop-shadow(0 0 6px rgba(240, 168, 48, .9))
    drop-shadow(0 0 14px rgba(255, 90, 43, .5));

  -webkit-animation: nprogress-spinner 1.1s cubic-bezier(.5,.1,.5,.9) infinite;
          animation: nprogress-spinner 1.1s cubic-bezier(.5,.1,.5,.9) infinite;
}

/* anel interno contra-rotacionado (criado via outline duplicado) */
#nprogress .spinner-icon::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: solid 2px transparent;
  border-top-color: rgba(255, 90, 43, .9);
  border-left-color: rgba(240, 168, 48, .9);
  border-radius: 50%;
  -webkit-animation: nprogress-spinner-reverse 1.6s cubic-bezier(.5,.1,.5,.9) infinite;
          animation: nprogress-spinner-reverse 1.6s cubic-bezier(.5,.1,.5,.9) infinite;
}

@-webkit-keyframes nprogress-spinner {
  0%   { -webkit-transform: rotate(0deg);   }
  100% { -webkit-transform: rotate(360deg); }
}
@keyframes nprogress-spinner {
  0%   { transform: rotate(0deg);   }
  100% { transform: rotate(360deg); }
}
@-webkit-keyframes nprogress-spinner-reverse {
  0%   { -webkit-transform: rotate(360deg); }
  100% { -webkit-transform: rotate(0deg);   }
}
@keyframes nprogress-spinner-reverse {
  0%   { transform: rotate(360deg); }
  100% { transform: rotate(0deg);   }
}

/* ─── LEGENDA "CARREGANDO" abaixo do spinner ─── */
#nprogress .spinner::before {
  /* já usado acima — não duplicar */
}
/* texto opcional via pseudo no overlay raiz */
#nprogress > .spinner + ::after,
.np-loading-label {
  /* hook utilitário caso queira injetar legenda via JS */
}

/* ─── PAI CUSTOMIZADO ─── */
.nprogress-custom-parent {
  overflow: hidden;
  position: relative;
}
.nprogress-custom-parent #nprogress {
  position: absolute;
}
.nprogress-custom-parent #nprogress .spinner,
.nprogress-custom-parent #nprogress .bar {
  position: absolute;
}

/* ─── REDUÇÃO DE MOVIMENTO ─── */
@media (prefers-reduced-motion: reduce) {
  #nprogress .bar { animation: none; }
  #nprogress .spinner { animation: none; }
  #nprogress .spinner-icon { animation-duration: 2.2s; }
  #nprogress .spinner-icon::before { animation-duration: 3s; }
}
