/* Keep WPForms' native submit and next-page controls together on the first page. */
.bns-download-early-submit .bns-download-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

/* WPForms' clearfix pseudo-elements must not become empty flex items. */
.bns-download-early-submit .bns-download-actions::before,
.bns-download-early-submit .bns-download-actions::after {
    content: none;
}

/* Keep the live status accessible outside the busy form without affecting its layout. */
.bns-download-loading-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* Activated by the head script only; without JavaScript the form stays visible. */
form.wpforms-form.bns-download-loading {
    position: relative;
    min-block-size: 12rem;
    visibility: hidden;
}

form.wpforms-form.bns-download-loading * {
    visibility: hidden !important;
}

form.wpforms-form.bns-download-loading::before {
    content: '';
    position: absolute;
    inset-block-start: 4rem;
    inset-inline-start: calc(50% - 1.5rem);
    box-sizing: border-box;
    width: 3rem;
    height: 3rem;
    border: 3px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    color: var(--wpforms-button-background-color, var(--e-global-color-accent, #bfd400));
    visibility: visible;
    animation: bns-download-spin 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
    form.wpforms-form.bns-download-loading::before {
        animation: none;
    }
}

/* Keep the optional guidance visible alongside the existing B&S form styles. */
.bns-download-early-submit .wpforms-page-2 .wpforms-field > .wpforms-field-description {
    display: block !important;
}
