{% extends 'base.html' %}

{% block title %}Авторизация{% endblock %}

{% block content %}
    <h1>Авторизация</h1>
    <form method="post" class="auth-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>
        
        <center><button type="submit" class="submit-button">Войти</button></center>
    </form>

    <p class="register-link">Нет аккаунта? <a href="{% url 'register' %}">Зарегистрироваться</a></p>

{% endblock %}