{% extends "base.html" %}
{% block content %}
<div class="max-w-md mx-auto my-8">
  <div class="bg-white p-8 rounded-lg shadow-md">
    <h1 class="text-2xl font-bold text-irish-green mb-6 text-center">Create Account</h1>
    
    <!-- Messages/Alerts -->
    {% if error %}
      <div class="mb-4 p-3 rounded bg-red-100 text-red-700">
        {{ error }}
      </div>
    {% endif %}
    
    <form action="/auth/register" method="post" class="space-y-4">
      <div>
        <label for="username" class="block text-sm font-medium text-gray-700 mb-1">Username</label>
        <input
          type="text"
          id="username"
          name="username"
          required
          class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-irish-green focus:border-irish-green"
        >
      </div>
      
      <div>
        <label for="email" class="block text-sm font-medium text-gray-700 mb-1">Email Address</label>
        <input
          type="email"
          id="email"
          name="email"
          required
          class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-irish-green focus:border-irish-green"
        >
      </div>
      
      <div>
        <label for="password" class="block text-sm font-medium text-gray-700 mb-1">Password</label>
        <input
          type="password"
          id="password"
          name="password"
          required
          minlength="8"
          class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-irish-green focus:border-irish-green"
        >
        <p class="text-xs text-gray-500 mt-1">At least 8 characters</p>
      </div>
      
      <div>
        <label for="confirm_password" class="block text-sm font-medium text-gray-700 mb-1">Confirm Password</label>
        <input
          type="password"
          id="confirm_password"
          name="confirm_password"
          required
          minlength="8"
          class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-irish-green focus:border-irish-green"
        >
      </div>
      
      <div>
        <button
          type="submit"
          class="w-full bg-irish-green text-white py-2 px-4 rounded-md hover:bg-opacity-90 transition focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-irish-green"
        >
          Register
        </button>
      </div>
    </form>
    
    <div class="mt-6 pt-6 border-t border-gray-200 text-center">
      <p class="text-gray-600">Already have an account?</p>
      <a href="/auth/login" class="block mt-2 bg-cream-white text-irish-green border border-irish-green py-2 px-4 rounded-md hover:bg-irish-green hover:text-white transition">
        Log in
      </a>
    </div>
  </div>
</div>
{% endblock %}
