{% extends "base.html" %}
{% load static %}
{% load i18n %}
{% load allauth account %}

{% block head_title %}
    {% trans "Change Password" %}
{% endblock head_title %}

{% block content %}
    <!-- Change Password Start -->
    <section class="space-py-100">
        <div class="container">
            <div class="grid grid-cols-12">
                <div class="col-span-12">
                    <div class="codex-authbox">
                        <div class="auth-header">
                            <div class="codex-brand">
                                <a href="{% url 'main:home' %}">
                                    <img class="img-fluid light-logo" src="{% static 'main/assets/images/logo/logo.webp' %}" alt="logo">
                                    <img class="img-fluid dark-logo" src="{% static 'main/assets/images/logo/logo-light.webp' %}" alt="logo">
                                </a>
                            </div>
                            <h3>{% trans "Change Your Password" %}</h3>
                            <p>{% trans "To enhance the security of your account, we recommend updating your password periodically." %}</p>
                        </div>
                        <div class="auth-form">
                            {% url 'account_change_password' as action_url %}
                            <form method="post" action="{{ action_url }}">
                                {% csrf_token %}
                                {{ redirect_field }}
                                <div class="group-form">
                                    {% for field in form %}
                                        <div class="mb-3">
                                            {{ field.label_tag }}
                                            {{ field }}
                                            {% if field.errors %}
                                                <div class="text-danger">{{ field.errors }}</div>
                                            {% endif %}
                                        </div>
                                    {% endfor %}
                                </div>
                                <div class="group-form">
                                    <button class="btn btn-primary w-100" type="submit">
                                        {% trans "Change Password" %}
                                    </button>
                                </div>
                                <div class="mt-3">
                                    <a href="{% url 'account_reset_password' %}" class="text-secondary">
                                        {% trans "Forgot Password?" %}
                                    </a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Change Password End -->
{% endblock content %}

{% block extra_body %}
    {{ block.super }}
{% endblock extra_body %}
