<!doctype html>
<html lang="ko">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>PLAI Chain Admin Login</title>
    <link rel="stylesheet" href="/css/admin.css">
  </head>
  <body>
    <main class="shell">
      <header class="topbar">
        <div>
          <p class="eyebrow">Protected Admin</p>
          <h1>PLAI Chain Admin</h1>
        </div>
        <div class="top-actions">
          <a class="nav-button subtle" href="/explorer">Explorer</a>
          <a class="nav-button subtle" href="https://aisfor.kr/chain-wallet?next=/wallet">Wallet</a>
        </div>
      </header>

      <section class="panel" style="max-width: 520px; margin: 48px auto;">
        <div class="panel-title">
          <h2>Admin Login</h2>
          <span>ellia</span>
        </div>
        <% if (error) { %>
          <div class="item">
            <strong>Login failed</strong>
            <span><%= error %></span>
          </div>
        <% } %>
        <% if (loggedOut) { %>
          <div class="item">
            <strong>Logged out</strong>
            <span>관리자 세션이 종료되었습니다. 다시 로그인할 수 있습니다.</span>
          </div>
        <% } %>
        <form class="inline-form" method="post" action="/admin/login">
          <input type="hidden" name="next" value="<%= nextPath %>">
          <input name="username" autocomplete="username" placeholder="Admin ID" value="ellia">
          <input name="password" type="password" autocomplete="current-password" placeholder="Password" autofocus>
          <button type="submit">Login</button>
        </form>
      </section>
    </main>
  </body>
</html>
