{% import '_form_macros.html' as macros %}
<form action="{{ url_for('.root') }}" method="post" novalidate>
  {{ login_form.csrf_token }}
  <div class="card-body">
    <div class="form-group">
      {{ macros.with_errors(login_form.username, class="validate", placeholder="Username", tabindex="1", label=False) }}
    </div>
    <div class="form-group mb-0">
      {{ macros.with_errors(login_form.password, class="validate", placeholder="Password or Password + One-Time-Password", tabindex="2", label=False) }}
    </div>
    <div class="form-group mb-0 text-right">
    {% if lost_otp_token is not defined %}
      <small><a href="{{ url_for('.forgot_password_ask') }}">{{ _("Forgot Password?") }}</a></small>
    {% else %}
      <small><a href="{{ url_for('.forgot_password_ask') }}">{{ _("Forgot Password or OTP?") }}</a></small>
    {% endif %}
     <span class="text-muted"> | </span>
    <small><a href="{{ url_for('.otp_sync') }}">{{ _("Sync Token") }}</a></small>
    </div>
  </div>
  <div class="card-footer d-flex justify-content-between">
    <div>{{ macros.non_field_errors(login_form) }}</div>
    {{ login_form.submit(color="primary", tabindex="3") }}
  </div>
</form>
