/**
 * Guard Dog CAPTCHA Login JavaScript
 * 
 * JavaScript for CAPTCHA integration on the login page
 */

(function() {
    'use strict';

    /**
     * Initialize CAPTCHA functionality on login page
     */
    function initCaptchaLogin() {
        const loginContainer = document.getElementById('login');
        if (!loginContainer) {
            return;
        }

        // Get the provider class from localized script data
        if (typeof guard_dog_captcha !== 'undefined' && guard_dog_captcha.providerClass) {
            loginContainer.classList.add('captcha-enabled', guard_dog_captcha.providerClass);
        }
    }

    // Initialize when DOM is ready
    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', initCaptchaLogin);
    } else {
        initCaptchaLogin();
    }
})();
