/* reCAPTCHA Z-Index Fix and Positioning */

/* Ensure reCAPTCHA appears above virtual assistant */
.grecaptcha-badge {
    z-index: 99999 !important;
    bottom: 80px !important; /* Move above typical chat widget position */
    right: 20px !important;
}

/* For modal/popup reCAPTCHA challenges */
.rc-anchor-container {
    z-index: 100000 !important;
}

/* reCAPTCHA challenge iframe */
div[style*="z-index: 2000000000"] {
    z-index: 100001 !important;
}

/* Virtual Assistant/Chat Widget adjustment */
.chat-widget,
.virtual-assistant,
[class*="intercom"],
[class*="drift"],
[class*="crisp"],
[id*="chat"],
[id*="assistant"] {
    z-index: 9999 !important; /* Lower than reCAPTCHA */
    bottom: 20px !important;
    right: 20px !important;
}

/* Login modal should be above everything except reCAPTCHA challenge */
.login-modal,
.auth-modal,
.modal-overlay {
    z-index: 99998 !important;
}

/* Alternative: Hide reCAPTCHA badge on most pages, show only on forms */
body:not(.show-recaptcha) .grecaptcha-badge {
    visibility: hidden !important;
    opacity: 0 !important;
}

body.show-recaptcha .grecaptcha-badge {
    visibility: visible !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .grecaptcha-badge {
        bottom: 70px !important;
        right: 10px !important;
        transform: scale(0.9);
    }

    .chat-widget,
    .virtual-assistant {
        bottom: 10px !important;
        right: 10px !important;
    }
}