{% extends 'pages/base.html' %}
{% load static %}

{% block title %}Login{% endblock title %}

{% block content %}

  <div class="auth-main">
    <div class="auth-wrapper v1">
      <div class="auth-form">
        <div class="position-relative my-5">
          <div class="auth-bg">
            <span class="r"></span>
            <span class="r s"></span>
            <span class="r s"></span>
            <span class="r"></span>
          </div>
          <div class="card mb-0">
            <form method="post" class="card-body">
              {% csrf_token %}

              <div class="text-center">
                <a href="">
                  <div>
                    <img src="{% static 'assets/images/logo-dark.svg' %}" alt="img">
                  </div>
                </a>
              </div>
              <h4 class="text-center f-w-500 mt-4 mb-3">Login</h4>
              <p class="text-center mb-3">
                {% if messages %}
                  {% for message in messages %}
                    <div class="alert alert-{{ message.tags }}" role="alert">
                                                                              {{ message }}
                    </div>
                  {% endfor %}
              {% endif %}
              </p>
              
              {% if form.non_field_errors %}
                {% for error in form.non_field_errors %}
                  <span class="d-block text-danger mb-3">{{ error }}</span>
                {% endfor %}
              {% endif %}

              {% for field in form %}
              <div class="form-group mb-3">
                {{ field }}
              </div>
              {% endfor %}
              <div class="d-flex mt-1 justify-content-between align-items-center">
                <div class="form-check">
                  <input class="form-check-input input-primary" type="checkbox" id="customCheckc1" checked="">
                  <label class="form-check-label text-muted" for="customCheckc1">Remember me?</label>
                </div>
                <a href="#" class="text-secondary f-w-400 mb-0">Forgot Password?</a>
              </div>
              <div class="text-center mt-4">
                <button type="submit" class="btn btn-primary shadow px-sm-4">Login</button>
              </div>
              <div class="d-flex justify-content-between align-items-end mt-4">
                <h6 class="f-w-500 mb-0">Don't have an Account?</h6>
                <a href="{% url 'register' %}" class="link-primary">Create Account</a>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>

{% endblock content %}