{% extends 'tournaments/base.html' %}
{% block head_title %} Nouveau mot de passe {% endblock %}
{% block first_title %} Padel Club {% endblock %}
{% block second_title %} Nouveau 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">
            {% csrf_token %}
            <label for="new_password1">Nouveau mot de passe :</label>
            <input type="password" name="new_password1" id="new_password1" required>

            <label for="new_password2">Confirmer le nouveau mot de passe :</label>
            <input type="password" name="new_password2" id="new_password2" required>

            <button type="submit" class="rounded-button">Réinitialiser le mot de passe</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 %}
