/* ==========================================================================
   GREA newsletter form (shortcode [popup_newsletter])
   ========================================================================== */

/* reCAPTCHA v2 checkbox: reserve its height so the form doesn't jump when it loads */
.grea-nl-recaptcha {
    min-height: 78px;
}

.grea-nl-message:not(:empty) {
    margin-top: 12px;
}

/* --------------------------------------------------------------------------
   Popup layout:
   [ Nom ] [ Prénom ]
   [ Adresse e-mail (full width) ]
   [ reCAPTCHA ]   [ S'INSCRIRE ]
          message (centered)
   -------------------------------------------------------------------------- */
.grea-nl-popup .grea-nl-form .row {
    align-items: center;
}

/* Email field takes the full row */
.grea-nl-popup .grea-nl-form .mc-field-group:has(input[type="email"]) {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
}

/* reCAPTCHA on the left (it comes after the button in the markup) */
.grea-nl-popup .grea-nl-form .col-12:has(.grea-nl-recaptcha) {
    order: 1;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
}

/* Submit button on the right, filling the remaining space */
.grea-nl-popup .grea-nl-form .clear {
    order: 2;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
}

.grea-nl-popup .grea-nl-form .clear button.button {
    margin-bottom: 0 !important;
}

.grea-nl-popup .grea-nl-message {
    text-align: center;
}

/* Small screens: stack the reCAPTCHA above a full-width button */
@media (max-width: 575.98px) {
    .grea-nl-popup .grea-nl-form .col-12:has(.grea-nl-recaptcha),
    .grea-nl-popup .grea-nl-form .clear {
        flex: 0 0 100%;
        width: 100%;
    }

    .grea-nl-popup .grea-nl-recaptcha {
        display: flex;
        justify-content: center;
    }
}

/* Very narrow screens: the reCAPTCHA widget is a fixed 304px wide, so scale it down */
@media (max-width: 360px) {
    .grea-nl-recaptcha {
        transform: scale(0.85);
        transform-origin: 0 0;
    }

    .grea-nl-popup .grea-nl-recaptcha {
        transform-origin: center top;
    }
}
