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

{% block head_title %}
    {% trans "Sign Up" %}
{% endblock head_title %}

{% block content %}
    <!-- Signup 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.png' %}" alt="logo">
                                    <img class="img-fluid dark-logo" src="{% static 'main/assets/images/logo/logo-light.png' %}" alt="logo">
                                </a>
                            </div>
                            <h3>{% trans "Create your account" %}</h3>
                            <h6>{% trans "Already have an account?" %} <a class="font-primary" href="{% url 'account_login' %}">{% trans "Login here" %}</a></h6>
                        </div>
                        {% if not SOCIALACCOUNT_ONLY %}
                            {% url 'account_signup' as signup_url %}
                            <form method="post" action="{{ signup_url }}">
                                {% csrf_token %}
                                <div class="form-group">
                                    <label class="form-label" for="id_email">{% trans "Email" %}</label>
                                    <input class="form-control" type="email" name="email" id="id_email" placeholder="{% trans 'Enter Your Email' %}" required>
                                    {% if form.email.errors %}
                                        <div class="alert alert-danger">
                                            {{ form.email.errors }}
                                        </div>
                                    {% endif %}
                                </div>
                                <div class="form-group">
                                    <label class="form-label" for="id_username">{% trans "Username" %}</label>
                                    <input class="form-control" type="text" name="username" id="id_username" placeholder="{% trans 'Enter Your Username' %}" required>
                                    {% if form.username.errors %}
                                        <div class="alert alert-danger">
                                            {{ form.username.errors }}
                                        </div>
                                    {% endif %}
                                </div>
                                <div class="form-group">
                                    <label class="form-label" for="id_password1">{% trans "Password" %}</label>
                                    <div class="input-group group-input">
                                        <input class="form-control showhide-password" type="password" name="password1" id="id_password1" placeholder="{% trans 'Enter Your Password' %}" required>
                                        <span class="input-group-text toggle-show bi bi-eye"></span>
                                    </div>
                                    {% if form.password1.errors %}
                                        <div class="alert alert-danger">
                                            {{ form.password1.errors }}
                                        </div>
                                    {% endif %}
                                </div>
                                <div class="form-group">
                                    <label class="form-label" for="id_password2">{% trans "Confirm Password" %}</label>
                                    <input class="form-control" type="password" name="password2" id="id_password2" placeholder="{% trans 'Confirm Your Password' %}" required>
                                    {% if form.password2.errors %}
                                        <div class="alert alert-danger">
                                            {{ form.password2.errors }}
                                        </div>
                                    {% endif %}
                                </div>
                                <div class="form-group mb-0">
                                    <div class="auth-remember">
                                        <div class="form-check custom-chek">
                                            <input class="form-check-input" id="agree" type="checkbox" required>
                                            <label class="form-check-label" for="agree">{% trans "I Agree Terms and conditions" %}</label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <button class="btn btn-primary" type="submit">
                                        <i class="bi bi-paper-plane"></i> {% trans "Register" %}
                                    </button>
                                </div>
                                {{ redirect_field }}
                            </form>
                        {% endif %}
                        
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Signup End -->
{% endblock content %}

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