<?php
session_start();

$error = "";

if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $username = trim($_POST['username'] ?? '');
    $password = trim($_POST['password'] ?? '');

    // 🔐 HARD-CODED CREDENTIALS
    if ($username === 'admin' && $password === 'Femtech@2025') {
        $_SESSION['admin_logged_in'] = true;
        header("Location: admin-dashboard");
        exit;
    } else {
        $error = "Invalid login details.";
    }
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Admin Login | Femtech Waves</title>
<meta name="robots" content="noindex, nofollow">
<style>
body{font-family:Arial;background:#f4f6f8;display:flex;justify-content:center;align-items:center;height:100vh;}
form{background:#fff;padding:30px;border-radius:6px;box-shadow:0 10px 30px rgba(0,0,0,.1);width:320px;}
input,button{width:100%;padding:12px;margin-top:12px;}
button{background:#004aad;color:#fff;border:none;cursor:pointer;}
.error{color:red;margin-top:10px;}
</style>
</head>
<body>

<form method="POST">
<h2>Admin Login</h2>
<?php if($error): ?><div class="error"><?= $error ?></div><?php endif; ?>
<input type="text" name="username" placeholder="Username" required>
<input type="password" name="password" placeholder="Password" required>
<button type="submit">Login</button>
</form>

</body>
</html>
