<?php
session_start();

$USER = "admin";
$PASS = "femtech123";

if(isset($_POST['login'])){
    if($_POST['username'] === $USER && $_POST['password'] === $PASS){
        $_SESSION['admin'] = true;
        header("Location: admin-dashboard.php");
        exit;
    }
    $error = "Invalid login details";
}
?>

<!DOCTYPE html>
<html>
<head>
<title>Admin Login</title>
<style>
body{font-family:Arial;background:#f5f7fa}
.login-box{max-width:350px;margin:100px auto;background:#fff;padding:30px;border-radius:10px;box-shadow:0 10px 25px rgba(0,0,0,.1)}
input,button{width:100%;padding:12px;margin-top:10px}
button{background:#0d6efd;color:#fff;border:none;border-radius:6px}
.error{color:red}
</style>
</head>
<body>
<div class="login-box">
<h2>Admin Login</h2>
<form method="post">
<input name="username" placeholder="Username" required>
<input type="password" name="password" placeholder="Password" required>
<button name="login">Login</button>
<?php if(isset($error)) echo "<p class='error'>$error</p>"; ?>
</form>
</div>
</body>
</html>
