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

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

{% block content %}
    <!-- Set Password Section 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 "Set Password" %}</h3>
                        </div>
                        {% url 'account_set_password' as action_url %}
                        <form method="post" action="{{ action_url }}">
                            {% csrf_token %}
                            {{ redirect_field }}
                            <div class="mb-4">
                                {% for field in form.visible_fields %}
                                    <div class="form-group">
                                        {{ field.label_tag }}
                                        {{ field }}
                                        {% if field.help_text %}
                                            <small class="form-text text-muted">{{ field.help_text }}</small>
                                        {% endif %}
                                        {% for error in field.errors %}
                                            <div class="text-danger">{{ error }}</div>
                                        {% endfor %}
                                    </div>
                                {% endfor %}
                            </div>
                            <div class="d-flex justify-content-between align-items-center">
                                <button type="submit" name="action" class="btn btn-primary">
                                    {% trans 'Set Password' %}
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Set Password Section End -->
{% endblock content %}

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