/* Animação padrão de carregamento nos filtros (ver filtro-carregando.js).
 * Seletores reforçados (html body + classe repetida): o tema escuro força
 * "background: ... !important" em todo input/select e venceria uma regra simples. */

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

@keyframes filtroCarregandoBrilho {
  0%, 100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); }
  50% { box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.45); }
}

html body .filtro-carregando.filtro-carregando.filtro-carregando,
html body .filtro-carregando-campo.filtro-carregando-campo.filtro-carregando-campo {
  cursor: progress !important;
  animation: filtroCarregandoBrilho 1.2s ease-in-out infinite !important;
}

/* Botões e links: anel girando antes do texto, na cor do próprio botão. */
html body .filtro-carregando > .filtro-spinner.filtro-spinner.filtro-spinner {
  display: inline-block !important;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 0.95em;
  height: 0.95em;
  margin: 0 0.45em 0 0;
  padding: 0;
  vertical-align: -0.15em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  background: none;
  opacity: 0.9;
  animation: filtroCarregandoGiro 0.7s linear infinite !important;
}

/* Seletores, datas e buscas: anel girando no canto direito do campo. */
html body .filtro-carregando-campo.filtro-carregando-campo.filtro-carregando-campo {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23818cf8' stroke-width='3' stroke-linecap='round' stroke-dasharray='40 100'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 28px center !important;
  background-size: 14px 14px !important;
}

@media (prefers-reduced-motion: reduce) {
  html body .filtro-carregando.filtro-carregando.filtro-carregando,
  html body .filtro-carregando-campo.filtro-carregando-campo.filtro-carregando-campo {
    animation: none !important;
    outline: 2px solid rgba(129, 140, 248, 0.6);
    outline-offset: 1px;
  }

  html body .filtro-carregando > .filtro-spinner.filtro-spinner.filtro-spinner {
    animation-duration: 1.6s !important;
  }
}
