document.addEventListener('DOMContentLoaded', function() {
    const inputs = document.querySelectorAll('.aurora-lite-comment-form input[placeholder], .aurora-lite-comment-form textarea[placeholder]');

    inputs.forEach(input => {
        const labelAsterisk = input.closest('p').querySelector('label .required');
        if (!labelAsterisk) return;

        const toggleAsterisk = () => {
            labelAsterisk.style.display = input.value ? 'none' : 'inline';
        };

        toggleAsterisk();

        input.addEventListener('input', toggleAsterisk);
    });
});