{% extends "base.html" %}
{% load i18n %}

{% block title %}{% trans "Sign Up" %} | Jimma Market{% endblock %}

{% block content %}
<section class="py-5 bg-light min-vh-100 d-flex align-items-center">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-6 col-lg-5">
                <div class="card border-0 shadow-lg rounded-4 overflow-hidden">
                    <div class="bg-primary p-4 text-white text-center">
                        <i class="bi bi-person-plus fs-1 mb-2"></i>
                        <h3 class="fw-bold mb-0">{% trans "Join Jimma Market" %}</h3>
                        <p class="small opacity-75 mb-0">{% trans "Create your account to start shopping" %}</p>
                    </div>
                    <div class="card-body p-4 p-md-5 bg-white">
                        <form method="post">
                            {% csrf_token %}
                            
                            {% for field in form %}
                            <div class="mb-3">
                                <label for="{{ field.id_for_label }}" class="form-label small fw-bold">{{ field.label }}</label>
                                {{ field }}
                                {% if field.help_text %}
                                <div class="form-text small text-muted">{{ field.help_text }}</div>
                                {% endif %}
                                {% if field.errors %}
                                <div class="text-danger small mt-1">
                                    {{ field.errors|striptags }}
                                </div>
                                {% endif %}
                            </div>
                            {% endfor %}
                            
                            <button type="submit" class="btn btn-primary btn-lg w-100 rounded-pill py-3 mt-4 mb-4">
                                {% trans "Create Account" %}
                            </button>

                            <div class="text-center small text-secondary">
                                {% trans "Already have an account?" %} 
                                <a href="{% url 'login' %}" class="text-primary fw-bold text-decoration-none">{% trans "Login" %}</a>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="text-center mt-4">
                    <a href="{% url 'home' %}" class="text-secondary text-decoration-none small">
                        <i class="bi bi-arrow-left me-1"></i> {% trans "Back to Home" %}
                    </a>
                </div>
            </div>
        </div>
    </div>
</section>

<style>
    form input {
        border-radius: 8px !important;
        padding: 10px 15px !important;
        border: 1px solid #dee2e6 !important;
        background-color: #f8f9fa !important;
    }
    form input:focus {
        background-color: #fff !important;
        border-color: #0d6efd !important;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
    }
</style>
{% endblock %}
