/* Shared submit-button spinner + page overlay used across patient entry forms (LP, sticker, combined, PUF upload). */

@keyframes hivespin { to { transform: rotate(360deg); } }

.hive-spinner {
    display: inline-block;
    box-sizing: border-box;
    width: 1.2em;
    height: 1.2em;
    margin-right: 0.5em;
    vertical-align: -0.2em;
    border-radius: 50%;
    border: 0.15em solid;
    border-color: currentColor currentColor currentColor transparent;
    animation: hivespin 0.7s linear infinite;
    pointer-events: none;
}

/* Input elements (type=submit / type=button) can't contain child markup, so the spinner
   renders as an absolutely-positioned sibling instead of a prepended child. */
.hive-spinner-input-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}
.hive-spinner-input-wrap .hive-spinner {
    position: absolute;
    left: 0.75em;
    top: 50%;
    margin: -0.6em 0.5em 0 0;
    z-index: 2;
}
/* !important is required, not preferred. This declaration has to beat the per-client
   `padding: 20px 40px !important` written onto the same button (secondaryFlow.php:729), and an
   !important declaration cannot be outranked by specificity alone. Without it no gap was ever
   reserved, so the label stayed centred underneath the spinner. */
.hive-spinner-input-wrap input.hive-spinner-btn.is-submitting {
    padding-left: 2.6em !important;
}

/* The wrapper is width:100% so a full-width submit button keeps its width. But `left` on the
   spinner is measured from the WRAPPER, and on the secondary-flow PUF the button is
   `width:auto; margin:0 auto` (secondaryFlow.php:729) -- so a wrapper spanning the whole row put
   the spinner nowhere near the button's own left edge. Hug the button there and `left` becomes
   relative to the button itself. Safe to shrink-wrap here because that button is auto-width; the
   full-width case is restored for .puf-standalone-redesign below. */
.insurance_card_details .hive-spinner-input-wrap {
    width: auto;
    max-width: 100%;
}

/* The shrink-wrap above is only correct while that button is auto-width. The redesign made the
   secondary-flow PUF submit `width:100% !important` (secondaryFlow.php's CTA block), and the
   wrapper is injected by JS ONLY at submit time -- so the button rendered full width until it was
   clicked, then collapsed to a small pill the instant it got wrapped, with the spinner landing on
   the centred label. Restoring a 100% wrapper here keeps the width stable across that transition;
   the spinner then uses the generic `left:0.75em` rule above, which sits inside the padding gap
   reserved by `.hive-spinner-input-wrap input.hive-spinner-btn.is-submitting`. Deliberately NOT
   the 9.5em offset below -- that value was measured against the standalone PUF only.

   The second arm is the sticker and two-column widgets. They inject the SAME PUF but their host
   element carries no `.secondary-flow-redesign` class -- which is why every other redesign rule for
   this fragment needs a matching `#conversion_sticker #initial_with_secondary` arm -- so the
   shrink-wrap above stayed in force there and the CTA collapsed to a small pill the moment Submit
   was pressed, with the spinner sitting on top of the label. One arm covers both widgets: they
   share `#conversion_sticker`, and `#initial_with_secondary` is the injected PUF container. */
.secondary-flow-redesign .insurance_card_details .hive-spinner-input-wrap,
#conversion_sticker #initial_with_secondary .insurance_card_details .hive-spinner-input-wrap {
    width: 100%;
    max-width: none;
}

/* upload_insurance_card_template.php -- the ONLY page the 9.5em below was ever measured against,
   identified by .puf-standalone-redesign (absent from secondaryFlow.php). Keeps its 100% wrapper
   so that offset still resolves exactly as it does today.

   This block previously matched bare `.insurance_card_details`, which is also on the secondary-flow
   PUF form (secondaryFlow.php:1796). There the button is auto-width and centred, so 9.5em from the
   row's left edge landed the spinner directly on top of the centred "Submit" label -- the reported
   bug. That page now falls through to the generic `left:0.75em` rule above, which with the hugging
   wrapper sits inside the padding gap reserved by the rule at the top of this block. */
.puf-standalone-redesign .insurance_card_details .hive-spinner-input-wrap {
    width: 100%;
    max-width: none;
}
.puf-standalone-redesign .insurance_card_details .hive-spinner-input-wrap .hive-spinner {
    width: 2em;
    height: 2em;
    margin: -1.2em 0.5em 0 0;
    left: 9.5em;
}

.hive-spinner-btn[disabled],
.hive-spinner-btn.is-submitting {
    cursor: not-allowed;
    opacity: 0.7;
}

.hive-submit-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.01);
    z-index: 99999;
    cursor: wait;
}
.hive-submit-overlay.is-active {
    display: block;
}

/*
 * These forms already toggle a `.trasparentPart` class on `.submit-row` during
 * submission (pre-existing behavior), which several stylesheets pair with an
 * image-based `:before` spinner. Suppress that legacy spinner wherever it would
 * otherwise render alongside the one above, so only one spinner ever shows.
 * !important is required to win regardless of stylesheet load order.
 */
#form-container2 .submit-row.trasparentPart:before,
.conversion_layout .submit-row.trasparentPart:before {
    content: none !important;
    display: none !important;
}
