/**
 * Shared Google reCAPTCHA v2 layout (login / register / forgot / etc.)
 */

.ashunt-recaptcha-field {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 18px 0 24px !important;
    padding: 0 !important;
    min-height: 78px !important;
    overflow: visible !important;
    position: relative;
    z-index: 3;
    gap: 0 !important;
    text-align: center !important;
}

.ashunt-recaptcha-wrap {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 100%;
    margin: 0 auto !important;
    padding: 0 !important;
    overflow: hidden !important; /* clip Google's empty sibling iframe */
    line-height: normal !important;
    text-align: center !important;
}

.ashunt-recaptcha-wrap > .g-recaptcha {
    display: inline-block !important;
    width: 304px !important;
    max-width: 100%;
    height: 78px !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    transform: none !important;
    text-align: left;
    position: relative;
}

/* Google sometimes injects an empty iframe sibling that stacks under the
   widget and paints over the submit button — hide it. */
.g-recaptcha > iframe:not([src]),
.g-recaptcha > iframe[src=""],
.ashunt-recaptcha-wrap .g-recaptcha > iframe:not([title]) {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Undo global iframe max-width / height:auto that collapses the box */
.ashunt-recaptcha-wrap iframe[title="reCAPTCHA"],
.ashunt-recaptcha-field iframe[title="reCAPTCHA"],
.g-recaptcha iframe[title="reCAPTCHA"] {
    display: block !important;
    margin: 0 !important;
    max-width: none !important;
    width: 304px !important;
    height: 78px !important;
}

/* Keep submit buttons clear of the widget */
.ashunt-login-form .ashunt-login-submit,
.ashunt-register-form .ashunt-register-submit,
form .ashunt-login-submit,
form .ashunt-register-submit {
    position: relative;
    z-index: 1;
    margin-top: 8px !important;
    clear: both;
}

@media (max-width: 360px) {
    .ashunt-recaptcha-field {
        min-height: 72px !important;
        margin: 14px 0 26px !important;
    }

    .ashunt-recaptcha-wrap {
        transform: scale(0.92);
        transform-origin: center center;
        width: 304px;
        max-width: 100%;
        height: 78px;
        margin-bottom: 6px !important;
    }
}
