{% extends 'base.html' %}

{% block title %}Смена пароля{% endblock %}

{% block content %}
<div class="container">
    <div class="form-container">
        <h2 class="text-center mb-4">Смена пароля</h2>

        <form method="post">
            {% csrf_token %}
            <div class="mb-3">
                {% include 'accounts/password_input.html' with field_name=form.old_password.id_for_label field_label='Старый пароль' required=True field_errors=form.old_password.errors %}
            </div>

            <div class="mb-3">
                {% include 'accounts/password_input.html' with field_name=form.new_password1.id_for_label field_label='Новый пароль' required=True field_errors=form.new_password1.errors %}
            </div>
            
            <div class="mb-3">
                {% include 'accounts/password_input.html' with field_name=form.new_password2.id_for_label field_label='Подтверждение нового пароля' required=True field_errors=form.new_password2.errors %}
            </div>
            
            <div class="d-grid gap-2 d-md-flex justify-content-md-end">
                <a href="{% url 'accounts:profile' %}" class="btn btn-outline-secondary me-md-2">
                    <i class="bi bi-arrow-left me-1"></i> Отмена
                </a>
                <button type="submit" class="btn btn-primary">
                    <i class="bi bi-save me-1"></i> Сохранить изменения
                </button>
            </div>
        </form>
    </div>
</div>
{% endblock %}