{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% load crispy_forms_tags %}  {% block title %}{% trans "Change Password" %} - KAAUH ATS{% endblock %}

{% block styles %}
{% endblock %}

{% block content %}
    <div class="d-flex vh-80 w-100 justify-content-center align-items-center mt-5">

        <div class="form-card">

            <h2 id="form-title" class="h3 fw-bold mb-4 text-center">
                {% trans "Change Password" %}
            </h2>

            <p class="text-muted small mb-4 text-center">
                {% trans "Please enter your current password and a new password to secure your account." %}
            </p>

            <form method="post" action="{% url 'account_change_password' %}" class="space-y-4 account-password-change">
                {% csrf_token %}

                {{ form|crispy }}

                {% if form.non_field_errors %}
                    <div class="alert alert-danger p-3 small mt-3" role="alert">
                        {% for error in form.non_field_errors %}{{ error }}{% endfor %}
                    </div>
                {% endif %}

                <button type="submit" class="btn btn-danger w-100 mt-3">
                    {% trans "Change Password" %}
                </button>
            </form>

            <div class="pt-5 mt-4 text-center border-top border-light-subtle">
                <p class="text-muted small mb-0">
                    <i class="fas fa-arrow-left me-1"></i>
                    <a href="{% url 'user_detail' request.user.pk %}" class="text-accent  text-decoration-none text-secondary">{% trans "Return to Profile" %}</a>
                </p>
            </div>
        </div>
    </div>
{% endblock %}