<!DOCTYPE html>
<html lang="es">

<head>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">

  <title>iLab Gestión Académica - Ingreso Usuarios</title>

  <!-- Custom fonts for this template-->
  <link href="/static/fa-all.min.css" rel="stylesheet" type="text/css">
  <link rel="icon" href="/static/favicon.svg" sizes="any" type="image/svg+xml">
  <link href="/static/googlefonts.css" rel="stylesheet">

  <!-- Custom styles for this template-->
  <link href="/static/sb-admin-2.min.css" rel="stylesheet">

</head>

<body class="bg-gradient-primary">

  <div class="container">

    <!-- Outer Row -->
    <div class="row justify-content-center">

      <div class="col-xl-10 col-lg-12 col-md-9">

        <div class="card o-hidden border-0 shadow-lg my-5">
          <div class="card-body p-0">
            <!-- Nested Row within Card Body -->
            <div class="row">
              <div class="col-lg-6 d-none d-lg-block bg-login-image"></div>
              <div class="col-lg-6">
                <div class="p-5">

            {% with messages = get_flashed_messages(with_categories=true) %}
            {% if messages %}
                  <div class="text-center">
                    <h1 class="h4 text-gray-900 mb-4">Ooooops!!</h1>
                  </div>            
              {% for category, message in messages %}
                <div class="alert alert-{{ category }}">
                  {{  message }}
                </div>
              {% endfor %}
            {% else %}
                  <div class="text-center">
                    <h1 class="h4 text-gray-900 mb-4">Bienvenido!</h1>
                  </div>            
            {% endif %}
          {% endwith %}
                  
                  
                  <form class="user"  method="POST" action="">
                    {{ form.hidden_tag() }}
                    <div class="form-group">
                    {% if form.login.errors %}
                        {{ form.login(class="form-control form-control-user is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.login.errors %}
                                <span>{{ error.decode('utf-8') }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.login(class="form-control form-control-user") }}
                    {% endif %}
                    </div>
                    <div class="form-group">
                    {% if form.clave.errors %}
                        {{ form.clave(class="form-control form-control-user is-invalid") }}
                        <div class="invalid-feedback">
                            {% for error in form.clave.errors %}
                                <span>{{ error.decode('utf-8') }}</span>
                            {% endfor %}
                        </div>
                    {% else %}
                        {{ form.clave(class="form-control form-control-user") }}
                    {% endif %}
                    </div>
                    <div class="form-group">
                      <div class="custom-control custom-checkbox small">
                    {{ form.remember(class="custom-control-input") }}
                    {{ form.remember.label(class="custom-control-label") }}

                      </div>
                    </div>
                    {{ form.submit(class="btn btn-primary btn-user btn-block") }}
                  </form>
                  <hr>
                  <div class="text-center">
                    <a class="small" href="https://app.ilab.cl/reset_password">Recupere su contraseña</a>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>

      </div>

    </div>

  </div>

  <!-- Bootstrap core JavaScript-->
  <script src="/static/jquery.min.js"></script>
  <script src="/static/bootstrap.bundle.min.js"></script>
  <script src="/static/jquery.easing.min.js"></script>
  <script src="/static/sb-admin-2.min.js"></script>

</body>
</html>
