  }
                } catch (err) {
                    console.error('Error checking PIN requirement:', err);
                }
            };

            // Verify PIN
            const verifyPin = async (pin) => {
                try {
                    const response = await fetch(`/api/verify-pin`, {
                        method: 'POST',
                        headers: {
                            'Content-Type': 'application/json',
                        },
                        body: JSON.s