{% extends "auth_layout.html" %}

{% block head_title %}{{ _('Sign up') }}{% endblock %}

{% block title %}{{ _('Sign up') }}{% endblock %}

{% block auth_form %}
  <form method="POST" action="{{ tenant.url_for(request, 'register:post') }}">
    <div class="space-y-4">
      <div>
        <label class="block text-sm font-medium mb-1" for="input-email">{{ _('Email address') }}</label>
        <input id="input-email" class="form-input w-full" type="email" name="email" value="{{ form_data.get('email') if form_data is defined else ''}}" required />
        {% if form_errors is defined and form_errors.email %}
        <div id="errors-email" class="text-xs mt-1 text-red-500">{{ form_errors.email }}</div>
        {% endif %}
      </div>
      <div>
        <label class="block text-sm font-medium mb-1" for="input-password">{{ _('Password') }}</label>
        <input id="input-password" class="form-input w-full" type="password" name="password" value="{{ form_data.get('password') if form_data is defined else ''}}" required />
        {% if form_errors is defined and form_errors.password %}
          <div id="errors-password" class="text-xs mt-1 text-red-500">{{ form_errors.password }}</div>
        {% endif %}
      </div>
    </div>
    {% block csrf %}{{ super() }}{% endblock %}
    <div class="flex items-center justify-between mt-6">
      <div class="mr-1">
        <a class="text-sm underline hover:no-underline" href="{{ tenant.url_for(request, 'auth:login.get') }}">{{ _('I already have an account') }}</a>
      </div>
      <button type="submit" class="btn bg-primary hover:bg-primary-hover text-white ml-3">{{ _('Sign up') }}</button>
    </div>
  </form>
{% endblock %}
