/* Shared affordance and loading feedback for interactive actions. */
:where(
        button,
        input[type="button"],
        input[type="submit"],
        input[type="reset"],
        input[type="image"],
        [role="button"],
        a[href],
        summary,
        label[for],
        [data-bs-toggle],
        [data-toggle],
        [onclick]
    ):not(:disabled):not([disabled]):not([aria-disabled="true"]) {
    cursor: pointer !important;
}

input[type="file"]::file-selector-button {
    cursor: pointer;
}

:where(
        button,
        input[type="button"],
        input[type="submit"],
        input[type="reset"],
        input[type="image"],
        [role="button"],
        a[href],
        label[for],
        [data-bs-toggle],
        [data-toggle],
        [onclick]
    ):is(:disabled, [disabled], [aria-disabled="true"]) {
    cursor: not-allowed !important;
}

[data-action-button-loading="true"] {
    cursor: wait !important;
    pointer-events: none !important;
}

[data-action-button-loading="true"]:not(input) {
    color: transparent !important;
}

[data-action-button-loading="true"]:not(input) > * {
    opacity: 0 !important;
}

[data-action-button-loading="true"]:not(input)::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1em;
    height: 1em;
    box-sizing: border-box;
    border: 2px solid var(--action-button-ux-spinner-color, #ffffff);
    border-right-color: transparent;
    border-radius: 9999px;
    content: "";
    transform: translate(-50%, -50%);
    animation: action-button-ux-spin 0.7s linear infinite;
}

@keyframes action-button-ux-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    [data-action-button-loading="true"]:not(input)::after {
        animation-duration: 1.4s;
    }
}
