<x-layout bodyClass="">

  <div>
    <div class="position-sticky z-index-sticky container top-0">
      <div class="row">
        <div class="col-12"></div>
      </div>
    </div>

    <main class="main-content mt-0">
      <section>
        <div class="page-header min-vh-100">
          <div class="container">
            <div class="row">
              <div
                class="col-6 d-lg-flex d-none h-100 position-absolute justify-content-center flex-column start-0 top-0 my-auto pe-0 text-center"
              >
                <div
                  class="position-relative bg-gradient-primary h-100 border-radius-lg d-flex flex-column justify-content-center m-3 px-7"
                  style="
                                    background-image: url('https://images.unsplash.com/photo-1567532939604-b6b5b0db2604?ixlib=rb-4.0.3&auto=format&fit=crop&w=3387&q=80');
                                    background-size: cover;
                                    background-position: center;
                                    background-repeat: no-repeat;
                                    "
                >
                </div>
              </div>
              <div
                class="col-xl-4 col-lg-5 col-md-7 d-flex flex-column ms-lg-auto me-lg-5 me-auto ms-auto"
              >
                <div class="card card-plain">
                  <div class="card-header">
                    <h4 class="font-weight-bolder">Sign Up Teacher</h4>
                    <p class="mb-0">
                      Enter your name, email and password <br />
                      to register a teacher
                    </p>
                  </div>
                  <div class="card-body">
                    <form
                      action="{{ route('register') }}"
                      method="POST"
                    >
                      @csrf

                      <input
                        id="registerUserRole"
                        name="registerUserRole"
                        type="hidden"
                        value="teacher"
                      />

                      <div class="input-group input-group-outline mt-3">
                        <label class="form-label">Name / First name</label>
                        <input
                          class="form-control"
                          name="name"
                          type="text"
                          value="{{ old('name') }}"
                        >
                      </div>
                      @error('name')
                        <p class='text-danger inputerror'>{{ $message }} </p>
                      @enderror

                      <div class="input-group input-group-outline mt-3">
                        <label class="form-label">Last name :</label>
                        <input
                          class="form-control"
                          name="lastName"
                          type="text"
                          value="{{ old('lastName') }}"
                        >
                      </div>
                      @error('lastName')
                        <p class='text-danger inputerror'>{{ $message }} </p>
                      @enderror

                      <div class="input-group input-group-outline mt-3">
                        <label class="form-label">Teacher email</label>
                        <input
                          class="form-control"
                          name="email"
                          type="email"
                          value="{{ old('email') }}"
                        >
                      </div>
                      @error('email')
                        <p class='text-danger inputerror'>{{ $message }} </p>
                      @enderror

                      <div class="input-group input-group-outline mt-3">
                        <label class="form-label">Password :</label>
                        <input
                          class="form-control"
                          name="password"
                          type="password"
                        >
                      </div>
                      @error('password')
                        <p class='text-danger inputerror'>{{ $message }} </p>
                      @enderror

                      <div
                        class="form-check form-check-info mt-3 ps-0 text-start"
                      >
                        <input
                          class="form-check-input"
                          id="flexCheckDefault"
                          type="checkbox"
                          value=""
                          checked
                        >
                        <label
                          class="form-check-label"
                          for="flexCheckDefault"
                        >
                          I agree the
                          <a
                            class="text-dark font-weight-bolder"
                            href="javascript:;"
                          >
                            Terms and Conditions
                          </a>
                        </label>
                      </div>

                      <div class="text-center">
                        <button
                          class="btn btn-lg bg-gradient-primary btn-lg w-100 mb-0 mt-4"
                          type="submit"
                        >
                          Sign Up as a teacher
                        </button>
                      </div>
                    </form>
                  </div>

                  <div class="card-footer px-lg-2 px-1 pt-0 text-center">
                    <p class="mx-auto mb-2 text-sm">
                      Already have an account?
                      <a
                        class="text-primary text-gradient font-weight-bold ps-1"
                        href="{{ route('login') }}"
                      >
                        Sign in
                      </a>
                    </p>

                    <p class="mx-auto mb-2 text-sm">
                      <a
                        class="text-primary text-gradient font-weight-bold"
                        href={{ route('register-student') }}
                      >
                        register as a student
                      </a>
                      instead
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </main>
  </div>

  @push('js')
    <script src="{{ asset('assets') }}/js/jquery.min.js"></script>
    <script>
      $(function() {

        var text_val = $(".input-group input").val();
        if (text_val === "") {
          $(".input-group").removeClass('is-filled');
        } else {
          $(".input-group").addClass('is-filled');
        }
      });
    </script>
  @endpush
</x-layout>
