<!DOCTYPE html>
<html lang="en">
  <%- include('head.ejs') %>

  <body class="container shadow">
    <noscript> Please turn on JavaScript or change browsers!</noscript>

    <%- include('header.ejs') %>

    <main class="container login-form" role="main">
      <form class="shadow" action="/login" method="post">
        <div class="form-group">
          <h2 class="text-center">Log in</h2>

          <input
            type="email"
            class="form-control"
            name="email"
            placeholder="your@email.com"
            minlength="4"
            maxlength="25"
            required
            autofocus
          />
        </div>

        <div class="form-group">
          <input
            type="password"
            class="form-control"
            name="password"
            placeholder="password"
            minlength="4"
            maxlength="20"
            autocomplete="new-password"
            required
          />
        </div>

        <div class="form-group">
          <input
            type="submit"
            class="btn btn-outline-primary form-control"
            value="Log in"
          />
        </div>

        <div class="clearfix">
          <a href="/password-help" class="pull-right">
            Forgot password?
          </a>
          <a href="/register">
            Sign up, here
          </a>
        </div>
      </form>

      <%if (err === "yes") { %>
      <p class="text-center text-danger">
        Wrong e-mail or password inserted.
      </p>
      <% } %>
    </main>

    <%- include('footer.ejs') %>
  </body>
</html>
