/*
 * From Uiverse.io by abrahamcalsin - https://uiverse.io/abrahamcalsin/serious-turkey-52
 * MIT License, Copyright (c) abrahamcalsin (Abraham Calsin)
 */

[data-action-pending][aria-disabled="true"] { cursor: progress; }

.action-spinner {
    --action-spinner-speed: .9s;
    position: relative;
    display: inline-block;
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    margin-inline-end: .4em;
    vertical-align: -.19em;
}

.action-spinner > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    transform: rotate(calc(var(--action-spinner-index, 8) * 45deg));
}

.action-spinner > span::before {
    content: "";
    width: 20%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: currentColor;
}

.action-spinner > :nth-child(2) { --action-spinner-index: 1; }
.action-spinner > :nth-child(3) { --action-spinner-index: 2; }
.action-spinner > :nth-child(4) { --action-spinner-index: 3; }
.action-spinner > :nth-child(5) { --action-spinner-index: 4; }
.action-spinner > :nth-child(6) { --action-spinner-index: 5; }
.action-spinner > :nth-child(7) { --action-spinner-index: 6; }
.action-spinner > :nth-child(8) { --action-spinner-index: 7; }

[data-action-spinner-host] { position: relative; }
[data-action-spinner-host] > .action-spinner {
    position: absolute;
    inset-block-start: .15rem;
    inset-inline-end: .15rem;
    width: .75rem;
    height: .75rem;
    margin: 0;
}

.advice-continue > .action-spinner { margin: 0; }

@media (prefers-reduced-motion: no-preference) {
    .action-spinner > span::before {
        animation: action-spinner-pulse calc(var(--action-spinner-speed) * 1.111) ease-in-out infinite;
        animation-delay: calc((var(--action-spinner-index, 8) - 8) * .125 * var(--action-spinner-speed));
    }
}

@keyframes action-spinner-pulse {
    0%, 100% { transform: scale(0); opacity: .5; }
    50% { transform: scale(1); opacity: 1; }
}
