{% extends 'hidp/base_pre_login.html' %}
{% load i18n %}

{% block title %}{% translate 'Sign in' %}{% endblock %}

{% block main %}
  {% if oidc_error_message %}
    <ul>
      <li>
        {{ oidc_error_message }}
      </li>
    </ul>
  {% endif %}

  <h1>{% translate 'Sign in' %}</h1>

  <h2>{% translate 'With your email and password' %}</h2>

  {% if is_rate_limited %}
    <p>
      {% blocktranslate trimmed %}
        Excessive login attempts have been detected for this account.
        For your safety, additional security measures are now in place.
      {% endblocktranslate %}
    </p>
  {% endif %}

  <form method="post">
    {% csrf_token %}
    {{ form }}

    <p>
      <a href="{{ password_reset_url }}">
        {% translate 'Forgot your password?' %}
      </a>
    </p>

    {% include 'hidp/includes/forms/submit_row.html' with submit_label=_('Sign in') %}
  </form>

  {% if oidc_login_providers %}
    <hr>

    <h2>{% translate 'With a trusted service' %}</h2>

    {% include 'hidp/includes/federated/oidc_provider_list.html' with providers=oidc_login_providers next_url=next %}

  {% endif %}

  {% if register_url %}
    <hr>
    <p>
      {% translate 'No account yet?' %}
      <a href="{{ register_url }}">{% translate 'Sign up' %}</a>
    </p>
  {% endif %}
{% endblock %}
