const punchlines = [
    'Biometric Precision, Flawless Compliance.',
    'Simplifying Payroll, Amplifying Growth.',
    'Synchronizing Shifts, Empowering Teams.',
    'Enterprise Operations, Elevated Daily.',
];

let currentIndex = 0;
const punchlineElement = document.getElementById('changing-punchline');

if (punchlineElement) {
    setInterval(() => {
        punchlineElement.classList.add('text-fade-out');

        setTimeout(() => {
            currentIndex = (currentIndex + 1) % punchlines.length;
            punchlineElement.textContent = punchlines[currentIndex];
            punchlineElement.classList.remove('text-fade-out');
        }, 500);
    }, 4000);
}

const loginForm = document.getElementById('login-form');

if (loginForm) {
    loginForm.addEventListener('submit', event => {
        event.preventDefault();
    });
}

const passwordInput = document.getElementById('login-password');
const passwordToggle = document.getElementById('password-toggle');

if (passwordInput && passwordToggle) {
    passwordToggle.addEventListener('click', () => {
        const isPassword = passwordInput.type === 'password';
        passwordInput.type = isPassword ? 'text' : 'password';
        passwordToggle.innerHTML = isPassword
            ? '<i class="fa-regular fa-eye-slash text-sm"></i>'
            : '<i class="fa-regular fa-eye text-sm"></i>';
    });
}
