{% extends 'tournaments/base.html' %}
{% block head_title %} Réinitialisation du mot de passe {% endblock %}
{% block first_title %} Padel Club {% endblock %}
{% block second_title %} Réinitialisation du mot de passe {% endblock %}

{% block content %}
<div class="grid-x">
<div class="bubble">
    <div class="cell medium-6 large-6 my-block">
        {% if form.errors %}
            <div class="alert">
                {% for field, errors in form.errors.items %}
                    {% for error in errors %}
                        <p>{{ error }}</p>
                    {% endfor %}
                {% endfor %}
            </div>
        {% endif %}

        <!-- Add non-field errors (if any) -->
        {% if form.non_field_errors %}
            <div class="alert">
                {% for error in form.non_field_errors %}
                    <p>{{ error }}</p>
                {% endfor %}
            </div>
        {% endif %}
        <form method="post" action="{% url 'password_reset' %}">
            {% csrf_token %}
            <label for="email">Adresse e-mail :</label>
            <input type="email" name="email" id="email" required>
            <button type="submit" class="rounded-button">Envoyer le lien de réinitialisation</button>
        </form>
        <p>
            <a href="{% url 'login' %}" class="styled-link">Retour à la connexion</a>
        </p>
    </div>
    {% for message in messages %}
      <div class="alert alert-{{ message.tags }}">{{ message }}</div>
    {% endfor %}
</div>
</div>
{% endblock %}
