<?php declare(strict_types=1);
$bp = Auth::basePath();
$ab = assets_base();
?>
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Login — <?= h(cfg('app_name')) ?></title>
  <script>
    (function () {
      var t = localStorage.getItem('crash_console_theme');
      if (t === 'light' || t === 'dark') document.documentElement.setAttribute('data-theme', t);
    })();
  </script>
  <link rel="stylesheet" href="<?= h($ab) ?>/assets/css/app.css">
</head>
<body class="login-page" data-base-path="<?= h($ab) ?>">
  <form class="login-card" method="post" action="<?= h($bp) ?>/login">
    <h1><?= h(cfg('app_name')) ?></h1>
    <p class="muted">Sign in (same credentials as Crashes / Tickets)</p>
    <?php if (!empty($loginError)): ?>
      <div class="alert"><?= h($loginError) ?></div>
    <?php endif; ?>
    <label><span>Username</span><input name="username" autocomplete="username" required></label>
    <label><span>Password</span><input name="password" type="password" autocomplete="current-password" required></label>
    <button type="submit">Sign in</button>
  </form>
  <?php platform_render_footer(); ?>
</body>
</html>
