<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reset Password</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    <link href="styles.css" rel="stylesheet">
    <style>
        body {
            background: linear-gradient(270deg, #89288f, #89278d);
            font-family: 'Arial', sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            overflow: hidden;
        }

        .container {
            background: white;
            padding: 2rem;
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
            text-align: center;
            max-width: 400px;
        }

        .logo {
            display: flex;
            justify-content: center;
            align-items: center;
            margin-bottom: 1rem;
        }

        .logo img {
            margin-right: 10px;
            height: 50px;
        }

        h3 {
            margin-bottom: 1rem;
            color: #89288f;
            font-weight: bold;
        }

        input {
            width: 100%;
            padding: 0.5rem;
            margin-bottom: 1rem;
            border: 1px solid #ccc;
            border-radius: 5px;
        }

        .btn {
            width: 100%;
            margin-bottom: 1rem;
        }

        #toggle_type {
            background: none;
            border: none;
            color: #89288f;
            cursor: pointer;
            padding: 0;
            margin-bottom: 1rem;
        }

        #response {
            color: red;
        }

        footer {
            position: absolute;
            bottom: 0;
            width: 100%;
            text-align: center;
            background: linear-gradient(270deg, #89288f, #89278d);
            color: white;
            padding: 1rem 0;
        }

        .pulse {
            display: inline-block;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: yellow;
            animation: pulse 1.5s ease-out infinite;
        }

        @keyframes pulse {
            0% {
                transform: scale(0.8);
            }
            50% {
                transform: scale(1.2);
            }
            100% {
                transform: scale(0.8);
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="logo">
            <a href="https://iitdh.ac.in"><img src="https://election.iitdh.ac.in/static/media/logog.084b1a7a95f4bcd9fccd.png" alt="Logo"></a>
        </div>
        <h3>Enter Code</h3>
        <form action="/code" method="post">
            <input class="mb-2" placeholder="Code" type="text" name="code" autofocus autocomplete="off" required>
            <button class="btn btn-success" type="submit">Enter</button>
        </form>
        <% if(locals.response){ %>
        <h5 id="response"><%= response %></h5>
        <% } %>
    </div>
    <footer id="footer">
        <div class="pulse"></div>
    </footer>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
    <script>
        const pass_button=document.getElementById("toggle_type");
        const pass_inp=document.getElementById("password_inp");
        pass_button.addEventListener('click',function(){
            if(pass_inp.getAttribute("type")=="password")
            {
                pass_inp.setAttribute("type","text");
                pass_button.innerHTML="Hide Password";
            }
            else if(pass_inp.getAttribute("type")=="text")
            {
                pass_inp.setAttribute("type","password");
                pass_button.innerHTML="Show Password";
            }
        });
    </script>
</body>
</html>
