{% extends 'index.twig' %}

{% block content %}
<div class="col-12">
  {% if useSslForLogins %}
  <p>
    <a href="{{ secureloginurl }}">{{ securelogintext }}</a>
  </p>
  {% endif %}

  {{ loginMessage | raw }}

  <div id="phpmyfaq-login" class="mb-5">
    <div id="phpmyfaq-login-content">
      <main>
        <div class="container">
          <div class="row justify-content-center">
            <div class="col-lg-6">
              <div class="card shadow-lg border-1 rounded-lg mt-5">
                <div class="card-header">
                  <h2 class="text-center font-weight-light my-4">phpMyFAQ Login</h2>
                </div>
                <div class="card-body">
                  <form action="{{ writeLoginPath|raw }}" method="post" accept-charset="utf-8" role="form">
                    <input type="hidden" name="redirect-action" value="{{ action }}" />
                    <div class="form-floating mb-3">
                      <input
                        class="form-control"
                        id="faqusername"
                        name="faqusername"
                        type="text"
                        placeholder="{{ username }}"
                      />
                      <label for="faqusername">{{ username }}</label>
                    </div>
                    <div class="input-group mb-3">
                      <div class="form-floating">
                        <input
                          class="form-control"
                          id="faqpassword"
                          name="faqpassword"
                          type="password"
                          autocomplete="off"
                          placeholder="{{ password }}"
                          data-pmf-toggle="faqpassword_toggle"
                        />
                        <label for="faqpassword">{{ password }}</label>
                      </div>
                      <span class="input-group-text" id="faqpassword_toggle" role="button" tabindex="0">
                        <i class="bi bi-eye-slash" id="faqpassword_toggle_icon"></i>
                      </span>
                    </div>
                    <div class="form-check mb-3">
                      <input class="form-check-input" id="faqrememberme" type="checkbox" name="faqrememberme" />
                      <label class="form-check-label" for="faqrememberme">{{ rememberMe }}</label>
                    </div>
                    <div class="d-flex align-items-center justify-content-between mt-4 mb-0">
                      <a class="small" href="./forgot-password">{{ sendPassword  }}</a>
                      <button type="submit" class="btn btn-primary">{{ loginHeader }}</button>
                    </div>
                  </form>
                </div>

                <div class="card-footer text-center py-3">
                  {% if enableRegistration %}
                  <a class="w-100 py-2 mb-2 btn btn-outline-secondary rounded-3" href="user/register">
                    {{ registerUser }}
                  </a>
                  {% endif %}
                  {% if useSignInWithMicrosoft %}
                  <a class="w-100 py-2 mb-2 btn btn-outline-dark rounded-3" href="./services/azure">
                    <i class="bi bi-windows" aria-hidden="true"></i>
                    {{ 'msgSignInWithMicrosoft' | translate }}
                  </a>
                  {% endif %}
                  {%  if isWebAuthnEnabled %}
                  <a class="w-100 py-2 mb-2 btn btn-outline-primary rounded-3" href="./services/webauthn">
                    <i class="bi bi-key" aria-hidden="true"></i>
                    {{ 'msgSignInWithPasskey' | translate }}
                  </a>
                  {% endif %}
                </div>
              </div>
            </div>
          </div>
        </div>
      </main>
    </div>
  </div>
</div>

{% endblock %}
