{% extends 'base.html' %}

{% block title %}Регистрация{% endblock %}

{% block content %}
    <h1>Регистрация</h1>
    <form method="post" class="registration-form">
        {% csrf_token %}
        <div class="error">{{ form.non_field_errors }}</div>
        
        <div class="form-group">
            <label for="username">Логин</label>
            {{ form.username }}
            {% for error in form.username.errors %}
                <div class="error">{{ error }}</div>
            {% endfor %}
        </div>
        
        <div class="form-group">
            <label for="password">Пароль</label>
            {{ form.password }}
            {% for error in form.password.errors %}
                <div class="error">{{ error }}</div>
            {% endfor %}
        </div>
        
        <div class="form-group">
            <label for="full_name">ФИО</label>
            {{ form.full_name }}
            {% for error in form.full_name.errors %}
                <div class="error">{{ error }}</div>
            {% endfor %}
        </div>
        
        <div class="form-group">
            <label for="phone">Телефон</label>
            {{ form.phone }}
            {% for error in form.phone.errors %}
                <div class="error">{{ error }}</div>
            {% endfor %}
        </div>
        
        <div class="form-group">
            <label for="email">Электронная почта</label>
            {{ form.email }}
            {% for error in form.email.errors %}
                <div class="error">{{ error }}</div>
            {% endfor %}
        </div>
        
        <center><button type="submit" class="submit-button">Зарегистрироваться</button></center>
    </form>

    <p class="login-link">Уже зарегистрированы? <a href="{% url 'login' %}">Войти</a></p>

{% endblock %}