       submitPin();
                }
            };

            const submitPin = () => {
                const pin = Array.from(pinDigits).map(digit => digit.value).join('');
                if (pin.length === pinLength) {
                    verifyPin(pin);
                }
            };

            // Clear PIN inputs
            const clearPinInputs = () => {
                pinDigits.forEach(digit => {
                    digit.value = '';
                    digit.classList.remove('filled');
    