<?php session_start(); ?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <!-- Main CSS-->
    <link rel="stylesheet" type="text/css" href="css/main.css" />
    <!-- Font-icon css-->
    <link rel="stylesheet" type="text/css"
        href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" />
    <title>Login</title>
</head>

<body>
    <section class="material-half-bg">
        <div class="cover"></div>
    </section>
    <section class="login-content">
        <div class="logo">
            <div style="display: flex; justify-content: center; align-items: center;">
                <img class="rounded-circle user-image" src="images/logo.png" alt="Er.Krunal Gamit"
                    style="min-width: 24px; min-height: 24px; max-width: 128px; max-height: 128px; width: auto; height: auto; object-fit: cover;">
            </div>

            <h2 style="font-family: Arial, sans-serif; font-weight: bold;">IT Expert Tapi</h2>
        </div>
        <div class="login-box">
            <form class="login-form" method="POST" action="login.php">
                <h3 class="login-head"><i class="bi bi-person me-2"></i>SIGN IN</h3>
                <div class="mb-3">
                    <label class="form-label">USERNAME</label>
                    <input class="form-control" type="text" name="email" placeholder="Email" autofocus />
                </div>
                <div class="mb-3">
                    <label class="form-label">PASSWORD</label>
                    <input class="form-control" type="password" name="password" placeholder="Password" />
                </div>
                <div class="mb-3 d-none">
                    <div class="utility">

                        <p class="semibold-text mb-2">
                            <a href="#" data-toggle="flip">Forgot Password ?</a>
                        </p>
                    </div>
                </div>

                <div class="mb-3 btn-container d-grid">
                    <button class="btn btn-primary btn-block" name="submit">
                        <i class="bi bi-box-arrow-in-right me-2 fs-5"></i>SIGN IN
                    </button>
                </div>
            </form>
            <form class="forget-form" action="forgetpassword.php" method="post">
                <h3 class="login-head">
                    <i class="bi bi-person-lock me-2"></i>Forgot Password?
                </h3>
                <div class="mb-3">
                    <label class="form-label">EMAIL</label>
                    <input name="email" class="form-control" type="email" placeholder="Email" required />
                </div>

                <div class="mb-3 btn-container d-grid">
                    <button class="btn btn-primary btn-block" type="submit">
                        <i class="bi bi-unlock me-2 fs-5"></i>RESET
                    </button>
                </div>

                <div class="mb-3 mt-3">
                    <p class="semibold-text mb-0">
                        <a href="#" data-toggle="flip"><i class="bi bi-chevron-left me-1"></i> Back to Login</a>
                    </p>
                </div>
            </form>

        </div>
        <br>
        <footer style="text-align: center; font-size: 14px; padding: 10px; color: #555;">
            <p>
                Powered by <strong>Er. Krunal Gamit</strong> &mdash; For any further inquiries, please contact the
                creator. <br>
                <em>Do not copy. This is an original and uniquely crafted design.</em>
            </p>

        </footer>

    </section>
    <!-- Essential javascripts for application to work-->
    <script src="js/jquery-3.7.0.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/main.js"></script>
    <script type="text/javascript">
    // Login Page Flipbox control
    $('.login-content [data-toggle="flip"]').click(function() {
        $(".login-box").toggleClass("flipped");
        return false;
    });
    </script>
    
    
    <script>
// Disable Right Click
document.addEventListener("contextmenu", e => e.preventDefault());

// Disable Key Shortcuts
document.onkeydown = function(e) {
    if (e.keyCode == 123) return false; // F12
    if (e.ctrlKey && e.shiftKey && e.keyCode == 73) return false; // Ctrl+Shift+I
    if (e.ctrlKey && e.shiftKey && e.keyCode == 74) return false; // Ctrl+Shift+J
    if (e.ctrlKey && e.shiftKey && e.keyCode == 67) return false; // Ctrl+Shift+C
    if (e.ctrlKey && e.keyCode == 85) return false; // Ctrl+U
    if (e.ctrlKey && e.keyCode == 80) return false; // Ctrl+P
    if (e.ctrlKey && e.keyCode == 83) return false; // Ctrl+S
};

// Disable Print Screen (PrtSc)
document.addEventListener('keyup', (e) => {
    if (e.key == "PrintScreen") {
        navigator.clipboard.writeText("");
        alert("Screenshots disabled on this website!");
    }
});

// Disable Text Selection + Copy
document.addEventListener('copy', function(e) {
    e.preventDefault();
    alert("Copying disabled");
});

// DevTools OPEN Detection (advanced)
(function() {
    const devtools = { open: false };

    const element = new Image();
    Object.defineProperty(element, 'id', {
        get: function () {
            devtools.open = true;
            alert("Developer Tools Detected!\nAccess Blocked.");
            window.location.href = "about:blank";
        }
    });

    setInterval(function () {
        devtools.open = false;
        console.log(element);
        if (devtools.open) {
            document.body.innerHTML = "<h1 style='color:red;text-align:center;margin-top:30px;'>⚠ Security Protection Activated</h1>";
        }
    }, 500);
})();

// Break devtools using debugger loop
setInterval(function() {
    debugger;
}, 100);

// Fake error for Inspect Element
window.addEventListener('keydown', function(e){
    if ((e.ctrlKey && e.shiftKey && e.keyCode == 73) || e.keyCode == 123) {
        alert("Access Denied!\nSecurity System Activated.");
        e.preventDefault();
    }
});
</script>

</body>

</html>