<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Ecolist — Login</title>
  <link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;1,400&display=swap" rel="stylesheet">
  <style>
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    :root {
      --bg:       #f9f6f0;
      --bg-card:  #ffffff;
      --border:   rgba(0,0,0,0.08);
      --text:     #1a1612;
      --text-dim: rgba(26,22,18,0.65);
      --emerald:  #16a34a;
      --emerald-d:#15803d;
      --red:      #ef4444;
      --ff-body:  'Outfit', system-ui, sans-serif;
      --ff-disp:  'Playfair Display', Georgia, serif;
    }
    body { background: var(--bg); font-family: var(--ff-body); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
    .wrap { width: 100%; max-width: 380px; padding: 24px 16px; }
    .logo { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 32px; color: var(--text); text-decoration: none; }
    .logo svg { flex-shrink: 0; }
    .logo span { font-family: var(--ff-disp); font-size: 22px; letter-spacing: -0.02em; }
    .logo span em { color: var(--emerald); font-style: normal; }
    .card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 36px 32px; box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
    h1 { font-family: var(--ff-disp); font-size: 26px; font-weight: 400; color: var(--text); margin-bottom: 6px; text-align: center; }
    .sub { font-size: 14px; color: var(--text-dim); text-align: center; margin-bottom: 28px; }
    .error-box { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 18px; }
    .field { margin-bottom: 16px; }
    label { display: block; font-size: 13px; font-weight: 500; color: var(--text-dim); margin-bottom: 6px; }
    input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--ff-body); font-size: 15px; color: var(--text); background: var(--bg); outline: none; transition: border-color .15s; }
    input:focus { border-color: var(--emerald); }
    .btn { width: 100%; padding: 12px; background: var(--emerald); color: #fff; border: none; border-radius: 8px; font-family: var(--ff-body); font-size: 15px; font-weight: 500; cursor: pointer; transition: background .15s; margin-top: 8px; }
    .btn:hover { background: var(--emerald-d); }
  </style>
</head>
<body>
  <div class="wrap">
    <a class="logo" href="/">
      <svg width="28" height="28" viewBox="0 0 26 26" fill="none">
        <circle cx="13" cy="13" r="12" stroke="#1a1612" stroke-width="1"/>
        <path d="M7 13C7 9.686 9.686 7 13 7s6 2.686 6 6-2.686 6-6 6" stroke="#16a34a" stroke-width="1.5" stroke-linecap="round"/>
        <circle cx="13" cy="13" r="2" fill="#16a34a"/>
      </svg>
      <span>eco<em>list</em></span>
    </a>
    <div class="card">
      <h1>Team Checklist</h1>
      <p class="sub">Internal access only</p>
      <% if (error) { %>
        <div class="error-box"><%= error %></div>
      <% } %>
      <form method="POST" action="/ecolist/login">
        <div class="field">
          <label>Login</label>
          <input type="text" name="user" autocomplete="username" required>
        </div>
        <div class="field">
          <label>Password</label>
          <input type="password" name="pass" autocomplete="current-password" required>
        </div>
        <button type="submit" class="btn">Enter →</button>
      </form>
    </div>
  </div>
</body>
</html>
