/* Interações compartilhadas — MUSINTER 2027 */

body {
    animation: musinter-page-enter 220ms ease-out both;
    transition: opacity 150ms ease;
}

body.is-page-leaving {
    animation: none;
    opacity: 0;
    pointer-events: none;
}

.button.is-loading,
.button.is-loading:disabled,
.button.is-loading:disabled:hover {
    color: #fff;
    border-color: var(--green, #315f4b);
    background: var(--green, #315f4b);
    cursor: wait;
    opacity: 0.9;
    transform: none;
}

.button.is-loading::before,
.musinter-progress-spinner {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.48);
    border-top-color: #fff;
    border-radius: 50%;
    content: "";
    animation: musinter-spin 700ms linear infinite;
}

.button.is-loading::before {
    margin-right: 0.55rem;
}

.musinter-progress {
    position: fixed;
    z-index: 9999;
    top: 1rem;
    left: 50%;
    min-width: min(360px, calc(100% - 2rem));
    max-width: calc(100% - 2rem);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.05rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #fff;
    background: rgba(24, 33, 29, 0.94);
    box-shadow: 0 14px 36px rgba(24, 33, 29, 0.22);
    font: 700 0.9rem/1.35 Inter, ui-sans-serif, system-ui, -apple-system,
        BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
    transform: translateX(-50%);
    animation: musinter-progress-enter 160ms ease-out both;
}

.musinter-progress[hidden] {
    display: none;
}

.musinter-progress-spinner {
    width: 1.1rem;
    height: 1.1rem;
}

form[aria-busy="true"] {
    cursor: wait;
}

@keyframes musinter-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes musinter-page-enter {
    from {
        opacity: 0.45;
    }
    to {
        opacity: 1;
    }
}

@keyframes musinter-progress-enter {
    from {
        opacity: 0;
        transform: translate(-50%, -8px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@media (max-width: 600px) {
    .musinter-progress {
        top: 0.65rem;
        min-width: calc(100% - 1.2rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    body,
    body.is-page-leaving,
    .musinter-progress {
        animation: none;
        transition: none;
    }

    .button.is-loading::before,
    .musinter-progress-spinner {
        animation-duration: 1.4s;
    }
}
