<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Sign in · Terra-View</title>
  <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-slate-900 text-slate-100 min-h-screen flex items-center justify-center">
  <div class="w-full max-w-sm p-8 bg-slate-800 rounded-xl shadow-lg">
    <h1 class="text-xl font-semibold mb-6 text-center">Terra-View</h1>
    {% if error %}
    <div class="mb-4 px-3 py-2 rounded bg-red-900/60 text-red-200 text-sm">{{ error }}</div>
    {% endif %}
    <form method="post" action="/login{% if next %}?next={{ next }}{% endif %}" class="space-y-4">
      <div>
        <label class="block text-sm mb-1" for="email">Email</label>
        <input id="email" name="email" type="email" autofocus required
               class="w-full px-3 py-2 rounded bg-slate-700 border border-slate-600 focus:outline-none focus:ring-2 focus:ring-orange-500">
      </div>
      <div>
        <label class="block text-sm mb-1" for="password">Password</label>
        <input id="password" name="password" type="password" required
               class="w-full px-3 py-2 rounded bg-slate-700 border border-slate-600 focus:outline-none focus:ring-2 focus:ring-orange-500">
      </div>
      <button type="submit"
              class="w-full py-2 rounded bg-orange-500 hover:bg-orange-600 font-medium">Sign in</button>
    </form>
    <p class="mt-4 text-xs text-slate-400 text-center">Forgot your password? Contact your administrator.</p>
  </div>
</body>
</html>
