{% extends "base.html" %}
{% from "_macros.html" import icon, mark, wordmark %}

{% block title %}Sign in - {{ brand.name }}{% endblock %}

{% block body %}
<main class="auth">
  <div class="auth__card">
    <div class="auth__brand">
      {{ mark(cls="brand-mark", uid="auth") }}
      <h1 class="auth__title">{{ wordmark() }}</h1>
      <p class="auth__subtitle">{{ brand.text.login_tagline }}</p>
    </div>

    {% if error %}
    <div class="alert alert--error" role="alert">
      {{ icon("warning", "alert__icon") }}
      <span>{{ error }}</span>
    </div>
    {% endif %}

    <form method="post" action="/auth/login" class="stack">
      <input type="hidden" name="next" value="{{ next|default('/') }}">

      <div class="field">
        <label class="field__label" for="email">Email</label>
        <input class="input" type="email" id="email" name="email" required
               autocomplete="username" autofocus value="{{ email|default('') }}">
      </div>

      <div class="field">
        <label class="field__label" for="password">Password</label>
        <input class="input" type="password" id="password" name="password" required
               autocomplete="current-password">
      </div>

      <button class="btn btn--primary btn--block" type="submit">Sign in</button>
    </form>

    {% if allow_signup %}
    <p class="auth__footer">
      No account yet? <a href="/auth/register">Create one</a>.
    </p>
    {% endif %}
  </div>
</main>
{% endblock %}
