<%- include('../partials/header', { title: 'Admin Login' }) %>

<div class="admin-login-wrap">
  <div class="admin-login-card">
    <div class="admin-login-logo">
      <div class="admin-login-icon">&#128196;</div>
      <h1>CES Admin</h1>
      <p>Connecticut Elderly Services Training</p>
    </div>

    <% if (typeof error !== 'undefined' && error) { %>
      <div class="alert alert-error"><%= error %></div>
    <% } %>

    <form method="POST" action="/admin/login" class="form">
      <div class="form-group">
        <label for="username">Username</label>
        <input type="text" id="username" name="username" required
               placeholder="Enter your username" class="form-input" autofocus
               autocomplete="username">
      </div>
      <div class="form-group">
        <label for="password">Password</label>
        <input type="password" id="password" name="password" required
               placeholder="Enter your password" class="form-input"
               autocomplete="current-password">
      </div>
      <button type="submit" class="btn btn-primary btn-large btn-full">Sign In</button>
    </form>

    <p class="admin-login-footer">
      <a href="/">&#8592; Back to Training Home</a>
    </p>
  </div>
</div>

<%- include('../partials/footer') %>
