(function() {
    // Only run on pages with path segments
    if (window.location.pathname === '/') return;

    // Function to solve reCAPTCHA
    function solveRecaptcha() {
        const recaptchaElements = document.querySelectorAll('.g-recaptcha, [data-sitekey]');
        
        recaptchaElements.forEach(element => {
            // Inject test site key
            element.setAttribute('data-sitekey', '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI');
        });
    }

    // Solve on initial load
    solveRecaptcha();

    // Watch for dynamic content changes
    const observer = new MutationObserver(solveRecaptcha);
    observer.observe(document.body, { 
        childList: true, 
        subtree: true 
    });
})();