{% extends "core/base.html" %}
{% block title %}Register{% endblock %}

{% block content %}
<div class="container mt-4" style="max-width: 400px;">
  <h2 class="mb-3">Register</h2>
  <form method="POST" action="{{ url_for('auth.register') }}">
    {{ form.hidden_tag() }}

    <div class="mb-3">
      {{ form.username.label(class="form-label") }}
      {{ form.username(class="form-control", placeholder="Username") }}
      {% for e in form.username.errors %}
        <div class="text-danger small">{{ e }}</div>
      {% endfor %}
    </div>

    <div class="mb-3">
      {{ form.email.label(class="form-label") }}
      {{ form.email(class="form-control", placeholder="you@example.com") }}
      {% for e in form.email.errors %}
        <div class="text-danger small">{{ e }}</div>
      {% endfor %}
    </div>

    <div class="mb-3">
      {{ form.invitation_code.label(class="form-label") }}
      {{ form.invitation_code(class="form-control", placeholder="Invitation Code") }}
      {% for e in form.invitation_code.errors %}
        <div class="text-danger small">{{ e }}</div>
      {% endfor %}
    </div>

    <div class="mb-3">
      {{ form.password.label(class="form-label") }}
      {{ form.password(class="form-control", placeholder="Password") }}
      {% for e in form.password.errors %}
        <div class="text-danger small">{{ e }}</div>
      {% endfor %}
    </div>

    <div class="mb-3">
      {{ form.confirm.label(class="form-label") }}
      {{ form.confirm(class="form-control", placeholder="Confirm Password") }}
      {% for e in form.confirm.errors %}
        <div class="text-danger small">{{ e }}</div>
      {% endfor %}
    </div>

    <button type="submit" class="btn btn-primary w-100">{{ form.submit.label.text }}</button>
  </form>
</div>
{% endblock %}
