<?php
require __DIR__.'/lib.php';
session_start();
if(!empty($_SESSION['qq_event_admin'])){header('Location:index.php');exit;}
$err='';
if($_SERVER['REQUEST_METHOD']==='POST'){
 $p=(string)($_POST['password']??'');
 if(password_verify($p,adminPasswordHash())){
   session_regenerate_id(true);$_SESSION['qq_event_admin']=true;$_SESSION['csrf']=bin2hex(random_bytes(24));
   header('Location:index.php');exit;
 }
 $err='Password salah.';
}
?><!doctype html><html lang="id"><head>
<link rel="icon" href="/event/favicon.ico" sizes="any">
<link rel="icon" type="image/png" sizes="32x32" href="/event/assets/favicon-32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/event/assets/favicon-16.png">
<link rel="apple-touch-icon" sizes="180x180" href="/event/assets/apple-touch-icon.png">
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>QQMILAN Winner Admin</title>
<style>
*{box-sizing:border-box}body{margin:0;min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 20% 10%,#65100d,#120403 55%,#050202);font-family:Arial;color:#fff}
.box{width:min(430px,calc(100% - 30px));padding:28px;border-radius:18px;background:linear-gradient(180deg,#2a0806,#0d0504);border:1px solid #b46b18;box-shadow:0 25px 70px #0008}
h1{color:#ffd15a;margin-top:0}p{color:#cdbfb6}input{width:100%;padding:13px;border-radius:10px;border:1px solid #5e421c;background:#0a0705;color:#fff;margin:10px 0}button{width:100%;padding:13px;border:0;border-radius:10px;background:linear-gradient(#f22b1f,#b70b07);color:#fff;font-weight:900;cursor:pointer}.err{color:#ff8791}
</style></head><body><form class="box" method="post"><h1>QQMILAN Winner Admin</h1><p>Satu panel untuk seluruh daftar pemenang.</p><?php if($err):?><div class="err"><?=ah($err)?></div><?php endif;?><input type="password" name="password" placeholder="Password Admin" required autofocus><button>LOGIN ADMIN</button></form></body></html>