<?php
declare(strict_types=1);
session_start();
if (isset($_SESSION['user_id'])) { header("Location: dashboard.php"); exit; }
?>
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title>Login</title>
  <style>
    body { font-family: Arial, sans-serif; margin: 24px; }
    .card { max-width: 420px; padding: 18px; border: 1px solid #ddd; border-radius: 10px; }
    input { width: 100%; padding: 10px; margin-top: 6px; box-sizing: border-box; }
    button { padding: 10px 14px; margin-top: 14px; }
    .hint { color: #666; font-size: 13px; margin-top: 10px; }
  </style>
</head>
<body>
  <div class="card">
    <h2>Sign in</h2>
    <form method="post" action="auth_login.php" autocomplete="off">
      <div>
        <label>Email</label>
        <input type="email" name="email" required>
      </div>

      <div style="margin-top:12px;">
        <label>Password</label>
        <input type="password" name="password" required>
      </div>

      <button type="submit">Login</button>
    </form>

    <div class="hint">
      Tip: create users by inserting rows into <code>userdb</code> (see README).
    </div>
  </div>
</body>
</html>
