<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Invite Code Entry</title>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #090a0f;
            color: #aaa;
            text-align: center;
            padding: 50px;
        }
        h1 {
            color: #fff;
        }
        .container {
            max-width: 400px;
            margin: auto;
            border: 2px solid #444;
            border-radius: 10px;
            padding: 20px;
            background-color: #222;
        }
        input[type="text"] {
            width: 100%;
            padding: 10px;
            border-radius: 5px;
            border: 1px solid #444;
            margin-bottom: 15px;
            background-color: #333;
            color: #fff;
        }
        button {
            padding: 10px 15px;
            border: none;
            border-radius: 5px;
            background-color: #f39c12;
            color: #fff;
            cursor: pointer;
            font-weight: bold;
            transition: background-color 0.3s;
        }
        button:hover {
            background-color: #e67e22;
        }
        .loading {
            display: none;
            margin: 20px 0;
        }
        .spinner {
            border: 5px solid rgba(255, 255, 255, 0.2);
            border-top: 5px solid #f39c12;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .progress {
            height: 10px;
            background: #444;
            border-radius: 5px;
            overflow: hidden;
            display: none;
        }
        .progress-bar {
            height: 100%;
            background: #f39c12;
            width: 0;
            transition: width 0.1s ease;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Type Your Invite Code</h1>
        <input type="text" id="inviteCode" placeholder="Vaprix.CC=?CODEXXXXXX">
        <button id="submitBtn">Submit</button>
        <div class="loading">
            <div class="spinner"></div>
            <p>Checking...</p>
        </div>
        <div class="progress">
            <div class="progress-bar" id="progressBar"></div>
        </div>
        <div id="resultMessage" style="display: none;">
            <p style="color: #f39c12;">Success! Your account will be ready.</p>
            <a href="recover.html" style="color: #f39c12; font-weight: bold;">Get Account</a>
        </div>
    </div>

    <script>
        document.getElementById("submitBtn").onclick = function() {
            var inviteCode = document.getElementById("inviteCode").value;
            if (inviteCode.trim() === "") {
                alert("Please enter an invite code.");
                return;
            }

            // Show loading spinner and progress bar
            document.querySelector('.loading').style.display = 'block';
            document.querySelector('.progress').style.display = 'block';
            document.getElementById("progressBar").style.width = '0%';

            // Simulate checking process
            let progress = 0;
            let interval = setInterval(() => {
                if (progress >= 100) {
                    clearInterval(interval);
                    document.querySelector('.loading').style.display = 'none';
                    document.getElementById("resultMessage").style.display = 'block';
                    return;
                }
                progress += 2; // Increment progress
                document.getElementById("progressBar").style.width = progress + '%';
            }, 150); // 5 minutes (300,000 ms / 100 = 3000 ms per 1%).
        };
    </script>
</body>
</html>