<?php
require_once __DIR__ . '/../auth_helper.php';
$error='';
if ($_SERVER['REQUEST_METHOD']==='POST') {
    if (hash_equals((string)ADMIN_PASSWORD, (string)($_POST['password'] ?? ''))) { $_SESSION['admin_ok']=true; redirect('index.php'); }
    $error='Wrong admin password.';
}
?><!DOCTYPE html><html><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><title>Admin Login</title><link rel="stylesheet" href="../assets/index_theme.css"></head><body><div class="install-box"><h1 class="admin-title">Admin Login</h1><?php if($error): ?><div class="msg err"><?= e($error) ?></div><?php endif; ?><form method="post"><div class="form-row"><label>Password</label><input type="password" name="password" required></div><button class="full-btn">Login</button></form><p style="margin-top:15px"><a class="clean-link" href="../index.php">Back to site</a></p></div></body></html>
