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

{% block content %}
  <div class="row justify-content-center">
    <div class="col-12">
      <div class="card o-hidden border-0 shadow-lg my-5">
        <div class="card-body">
          <div class="p-5">
            <form class="user" action="{% url "vote:code_login" %}" method="post">
              {% csrf_token %}
              <div class="form-group">
                <label>Login with your access code received by e-mail</label>
              </div>
              <div class="form-group">
                <input type="text" class="form-control form-control-user text-center"
                       id="id_access_code"
                       name="{{ form.access_code.name }}"
                       placeholder="Access Code"
                       autofocus="true"
                       required="true"
                       minlength="24"
                       maxlength="27"
                       spellcheck="false">
                {% if form.access_code.errors %}
                  <div class="invalid-feedback">{{ form.access_code.errors }}</div>
                {% endif %}
              </div>
              <input type="hidden" name="next" value="{{ next }}"/>
              <button type="submit" class="btn btn-primary btn-user btn-block">Login</button>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
{% endblock %}
