/* ============================================================
   reCAPTCHA placement fixes (shared by every channel layout)

   Kentico form builder renders Google reCAPTCHA v3 (floating
   badge, Badge=bottomright/bottomleft, or Badge=inline) and v2
   (304px checkbox + image challenge popup). Out of the box these
   collide with the other fixed-position third-party widgets:

   - Google parks the v3 badge at `right: -186px` (only 70px
     visible) with no z-index, so page content and the accessiBe
     trigger (fixed bottom-right, 20px offset) cover what is left.
   - The v2 challenge popup uses z-index 2000000000, below the
     OneTrust banner (2147483645), so the banner hides it.
   - The 304px v2 checkbox overflows narrow mobile viewports.

   Z-index ladder used here:
     page content / sticky bars (<= 1040)
       < reCAPTCHA v3 badge (1045)
       < Bootstrap modals (1050+)
       < OneTrust banner / preference center (2147483645)
       < reCAPTCHA v2 challenge (2147483647)
   ============================================================ */

/* --- v3 floating badge ---------------------------------------- */
.grecaptcha-badge[data-style="bottomright"],
.grecaptcha-badge[data-style="bottomleft"] {
    /* Lift above the accessiBe trigger (bottom offset 20px + ~50px icon). */
    bottom: 90px !important;
    z-index: 1045 !important;
    /* Keep it fully inside the viewport: collapse to the 70px logo and
       expand on hover/focus instead of sliding in from off-screen. */
    width: 70px !important;
    transition: width 0.3s ease !important;
}

.grecaptcha-badge[data-style="bottomright"] {
    right: 0 !important;
    left: auto !important;
}

.grecaptcha-badge[data-style="bottomleft"] {
    left: 0 !important;
    right: auto !important;
}

.grecaptcha-badge[data-style="bottomright"]:hover,
.grecaptcha-badge[data-style="bottomright"]:focus-within,
.grecaptcha-badge[data-style="bottomleft"]:hover,
.grecaptcha-badge[data-style="bottomleft"]:focus-within {
    width: 256px !important;
}

/* --- v3 inline badge ------------------------------------------ */
.grecaptcha-badge[data-style="inline"] {
    max-width: 100%;
}

/* --- v2 checkbox on narrow screens ---------------------------- */
@media (max-width: 380px) {
    div[style*="width: 304px"]:has(> div > iframe[src*="recaptcha"][src*="anchor"]) {
        transform: scale(0.85);
        transform-origin: 0 0;
        margin-bottom: -12px;
    }
}

/* --- v2 image challenge above OneTrust banner ------------------ */
body > div:has(iframe[src*="recaptcha"][src*="bframe"]) > div {
    z-index: 2147483647 !important;
}

body > div:has(iframe[src*="recaptcha"][src*="bframe"]) iframe[src*="bframe"] {
    max-width: 100vw;
}
