/**
 * reCAPTCHA Badge Customizations - Hide Badges + Custom Disclosure
 * 
 * This file completely hides all reCAPTCHA badges and replaces them with
 * Google-compliant disclosure text while keeping functionality intact.
 */

/* =============================================================================
   SELECTIVE BADGE HIDING - Hide Only v3 Badges, Keep v2 Widget Visible
   ============================================================================= */

/* Hide v3 badges (blue "protégé par reCAPTCHA" badges) but NOT v2 widgets */
html body .grecaptcha-badge:not([data-style]):not(.grecaptcha-badge-visible),
html body div.grecaptcha-badge:not([data-style]):not(.grecaptcha-badge-visible),
html body .grecaptcha-badge[data-style="none"],
html body .grecaptcha-badge[data-style=""],
html body .wamia-recaptcha-container .grecaptcha-badge:not(.grecaptcha-badge-visible),
html body div[data-action] .grecaptcha-badge:not(.grecaptcha-badge-visible) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

/* Hide v3 badge privacy/terms links (the blue area) but not v2 widget */
html body .rc-anchor-pt:not(.rc-anchor-checkbox-label) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Keep v2 checkbox widget visible and properly styled */
html body .g-recaptcha,
html body .g-recaptcha .rc-anchor,
html body .g-recaptcha .rc-anchor-content,
html body .g-recaptcha .rc-anchor-normal,
html body .g-recaptcha .rc-anchor-compact,
html body .g-recaptcha .rc-anchor-checkbox,
html body .g-recaptcha .rc-anchor-checkbox-label,
html body div[data-sitekey] .rc-anchor,
html body div[data-sitekey] .rc-anchor-content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    pointer-events: auto !important;
    z-index: auto !important;
}

/* Ensure v2 iframe challenges are visible */
html body iframe[src*="recaptcha/api2/bframe"],
html body iframe[title*="challenge"],
html body iframe[title*="puzzle"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
}

/* Ensure v2 widgets in hybrid containers are always visible when container is shown */
html body .recaptcha-widget .g-recaptcha,
html body .recaptcha-widget div[data-sitekey],
html body .recaptcha-widget .rc-anchor,
html body .recaptcha-widget .rc-anchor-content,
html body .recaptcha-widget .rc-anchor-normal,
html body .recaptcha-widget .rc-anchor-compact,
html body .recaptcha-widget .rc-anchor-checkbox,
html body .recaptcha-widget .rc-anchor-checkbox-label,
html body .recaptcha-widget iframe[src*="recaptcha"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    pointer-events: auto !important;
    z-index: auto !important;
}

/* Allow JavaScript to control container visibility */
html body .recaptcha-widget[style*="display: block"],
html body .recaptcha-widget[style*="display:block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* =============================================================================
   Custom reCAPTCHA Disclosure Text - Google Compliant
   ============================================================================= */

.wamia-recaptcha-disclosure {
    font-size: 11px;
    color: #666666;
    margin: 15px 0 10px 0;
    text-align: center;
    line-height: 1.4;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wamia-recaptcha-disclosure a {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.wamia-recaptcha-disclosure a:hover {
    color: #1565c0;
    text-decoration: underline;
}

.wamia-recaptcha-disclosure a:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Alternative minimal style */
.wamia-recaptcha-disclosure.minimal {
    background: transparent;
    border: none;
    padding: 5px 0;
    margin: 10px 0;
    font-size: 10px;
    color: #888;
}

/* =============================================================================
   Mobile Responsive
   ============================================================================= */

@media screen and (max-width: 480px) {
    .wamia-recaptcha-disclosure {
        font-size: 10px;
        margin: 10px 0 8px 0;
        padding: 6px 8px;
    }
}

/* =============================================================================
   Dark Mode Support
   ============================================================================= */

@media (prefers-color-scheme: dark) {
    .wamia-recaptcha-disclosure {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .wamia-recaptcha-disclosure a {
        color: #63b3ed;
    }
    
    .wamia-recaptcha-disclosure a:hover {
        color: #90cdf4;
    }
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
    .grecaptcha-badge,
    .wamia-recaptcha-disclosure {
        display: none !important;
    }
} 