<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Popup Form</title>
</head>

<body>
    <div class="popup-form" id="popupForm">
        <div class="form-content">
            <span id="closePopup"><i class="fa-solid fa-xmark"></i></span>
            <h2>Contact Form</h2>
            <form class="formFields">
                <input type="text" placeholder="Your Name" required />
                <input type="email" placeholder="Your Email" required />
                <input type="tel" placeholder="Enter Phone Number">
                <textarea placeholder="Your Message" rows="5" required></textarea>
                <button class="button" type="submit">Send</button>
            </form>
        </div>
    </div>


    <script>
        const openButtons = document.querySelectorAll(".openPopupBtn");
        const popup = document.getElementById("popupForm");
        const closeBtn = document.getElementById("closePopup");

        openButtons.forEach(button => {
            button.addEventListener("click", () => {
                popup.classList.add("show");
            });
        });

        closeBtn.addEventListener("click", () => {
            popup.classList.remove("show");
        });

        // Optional: click outside to close
        popup.addEventListener("click", (e) => {
            if (e.target === popup) {
                popup.classList.remove("show");
            }
        });
    </script>
</body>

</html>