/*
 * Feedback de ação (17/10/2026), único para /admin, /app, contas e páginas públicas
 * (shared/components/feedback-acao/README.md):
 * - cursor de clique em tudo que é clicável e de proibido no que está desabilitado;
 * - leve escurecimento ao passar o mouse e ao pressionar (camada de estado do Material 3);
 * - botão "processando" (círculo girando) e barra de progresso no topo durante o envio ou a troca de página.
 * Todas as regras de cursor e estado usam :where() (especificidade zero): o CSS de cada tela continua prevalecendo.
 */

/* Clicável: mãozinha. */
:where(button:not(:disabled):not([aria-disabled="true"]), [role="button"]:not([aria-disabled="true"]), summary, a[href],
    select:not(:disabled), input:is([type="checkbox"], [type="radio"], [type="file"], [type="submit"], [type="button"], [type="reset"], [type="color"]):not(:disabled),
    label:has(> input:is([type="checkbox"], [type="radio"]):not(:disabled)), label[for]:has(+ input[type="file"]),
    .button:not([aria-disabled="true"]):not(.is-disabled)) {
    cursor: pointer;
}
:where(input[type="file"]:not(:disabled))::file-selector-button { cursor: pointer; }

/* Desabilitado: proibido. */
:where(button:disabled, button[aria-disabled="true"], input:disabled, select:disabled, textarea:disabled, .button[aria-disabled="true"], .button.is-disabled) {
    cursor: not-allowed;
}

/* Camada de estado (hover e pressionado) dos botões, sem mudar cor ou forma de cada tema. */
:where(button, .button, input[type="submit"]):where(:not(:disabled):not([aria-disabled="true"])) { transition: filter .12s ease; }
:where(button, .button, input[type="submit"]):where(:not(:disabled):not([aria-disabled="true"])):hover { filter: brightness(.96); }
:where(button, .button, input[type="submit"]):where(:not(:disabled):not([aria-disabled="true"])):active { filter: brightness(.9); }

/* Processando: o botão clicado mostra o círculo; os outros do formulário ficam bloqueados. */
.fa-ocupado { cursor: progress !important; pointer-events: none; }
.fa-bloqueado { cursor: not-allowed !important; opacity: .6; pointer-events: none; }
.fa-spinner {
    display: inline-block; flex: 0 0 auto; width: 1em; height: 1em; box-sizing: border-box;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
    vertical-align: -.15em; animation: fa-girar .7s linear infinite;
}
.fa-spinner-sozinho { margin-inline-end: .45em; }
.fa-icone-oculto { display: none !important; }
input.fa-ocupado { opacity: .75; }
@keyframes fa-girar { to { transform: rotate(360deg); } }

/* Barra no topo: aparece se a próxima página demora; indeterminada. */
.fa-barra {
    position: fixed; inset: 0 0 auto 0; z-index: 2147483000; height: 3px; overflow: hidden;
    background: color-mix(in srgb, var(--ivip-primaria, #44691A) 18%, transparent); pointer-events: none;
}
.fa-barra::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 35%;
    background: var(--ivip-primaria, #44691A); animation: fa-barra 1.1s ease-in-out infinite;
}
.fa-barra[hidden] { display: none; }
@keyframes fa-barra { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* Só para leitor de tela. */
.fa-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Menos movimento: círculo parado e barra cheia, sem animação. */
@media (prefers-reduced-motion: reduce) {
    .fa-spinner { animation: none; border-right-color: currentColor; border-style: dotted; }
    .fa-barra::before { animation: none; width: 100%; }
    :where(button, .button, input[type="submit"]) { transition: none; }
}
