<div class="container mx-auto px-4 py-8">
  <div class="max-w-md mx-auto bg-white shadow rounded p-6">
    <h1 class="text-2xl font-bold mb-4">Kayıt Ol</h1>

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

    <form method="POST" action="/auth/register">
      <input type="hidden" name="_csrf" value="<%= csrfToken %>">
      <div class="mb-3">
        <label class="block text-sm font-medium mb-1">Kullanıcı Adı</label>
        <input type="text" name="username" value="<%= (form && form.username) || '' %>" class="input input-bordered w-full" required>
      </div>
      <div class="mb-3">
        <label class="block text-sm font-medium mb-1">E-posta</label>
        <input type="email" name="email" value="<%= (form && form.email) || '' %>" class="input input-bordered w-full" required>
      </div>
      <div class="mb-3">
        <label class="block text-sm font-medium mb-1">Şifre</label>
        <input type="password" name="password" class="input input-bordered w-full" required>
      </div>
      <div class="mb-4">
        <label class="block text-sm font-medium mb-1">Şifre (Tekrar)</label>
        <input type="password" name="confirmPassword" class="input input-bordered w-full" required>
      </div>
      <div class="flex justify-end gap-2">
        <a href="/auth/login" class="btn">Geri</a>
        <button class="btn btn-primary" type="submit">Kayıt Ol</button>
      </div>
    </form>
  </div>
</div>
