{% extends 'base/base.html' %}

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

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

{% block content %}
  <div class="container">
    <div class="card mx-auto" style="width: 40rem">
      <div class="card-body pb-0">

        <form method="post">
          {% csrf_token %}
          {% for field in form %}
          <label class="form-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
          <input
            required=""
            class="form-control mb-3"
            id="{{ field.id_for_label }}"
            name="{{ field.html_name }}"
            type="{{ field.widget_type }}"
          />
          {% endfor %}
          {% if form.non_field_errors %}
          <ul class='form-errors'>
            {% for error in form.non_field_errors %}
            <li>{{ error }}</li>
            {% endfor %}
          </ul>
          {% endif %}
          <div class="text-center">
            <button type="submit" class="btn btn-primary">Войти</button>
            <a href="{% url 'password_reset' %}" class="btn btn-link" style="display: block;">Забыли пароль?</a>
          </div>
        </form>
      </div>
    </div>
  </div>
{% endblock %}
