<?php
require_once __DIR__ . '/../includes/bootstrap.php';
require_post();
$config = load_config();
$password = trim($_POST['password'] ?? '');
if ($password !== '' && hash_equals((string)($config['adminPassword'] ?? 'cityboyadmin'), $password)) {
    $_SESSION['is_admin'] = true;
    json_response(['ok' => true, 'message' => 'Login successful.']);
}
json_response(['ok' => false, 'message' => 'Invalid password.'], 401);
