<app-breadcrumb [breadcrumb]="breadcrumb" />
<section class="log-in-section background-image-2 section-b-space">
  <div class="container-fluid-lg w-100">
    <div class="row">
      <div class="col-xxl-6 col-xl-5 col-lg-6 d-lg-block d-none ms-auto">
        <div class="image-contain">
          <img src="assets/images/inner-page/log-in.png" class="img-fluid" alt="login" />
        </div>
      </div>
      <div class="col-xxl-4 col-xl-5 col-lg-6 col-sm-8 mx-auto">
        <app-alert />
        <div class="log-in-box">
          <div class="log-in-title">
            <h3>{{ 'welcome_to' | translate }} {{ (setting$ | async)?.general?.site_name }}</h3>
            <h4>{{ 'login_your_account' | translate }}</h4>
          </div>
          <div class="input-box">
            <form class="row g-4" [formGroup]="form" (ngSubmit)="submit()">
              <div class="col-12">
                <div class="form-floating log-in-form">
                  <input
                    type="email"
                    class="form-control"
                    id="email"
                    id="email"
                    formControlName="email"
                    placeholder="{{ 'email_address' | translate}}"
                  />
                  <label for="email">{{ 'email_address' | translate}}</label>

                  @if(form.controls['email'].touched &&
                  form.controls['email'].errors?.['required']){
                  <div class="invalid-feedback">{{ 'email_is_required' | translate }}</div>
                  } @if(form.controls['email'].touched && form.controls['email'].errors?.['email']){
                  <div class="invalid-feedback">{{ 'invalid_email' | translate }}</div>
                  }
                </div>
              </div>
              <div class="col-12">
                <div class="form-floating theme-form-floating log-in-form">
                  <input
                    type="password"
                    class="form-control"
                    id="password"
                    formControlName="password"
                    placeholder="{{ 'password' | translate }}"
                  />
                  <label for="password">{{ 'password' | translate }}</label>

                  @if(form.controls['password'].touched &&
                  form.controls['password'].errors?.['required']){
                  <div class="invalid-feedback">{{ 'password_is_required' | translate }}</div>
                  }
                </div>
              </div>

              @if(reCaptcha){
              <div class="col-12">
                <re-captcha formControlName="recaptcha" />

                @if(form.controls['recaptcha'].touched &&
                form.controls['recaptcha'].errors?.['required']){
                <div class="invalid-feedback">{{ 'reCaptcha is required' | translate }}</div>
                }
              </div>
              }
              <div class="col-12">
                <div class="forgot-box">
                  <div class="form-check ps-0 m-0 remember-box">
                    <input class="checkbox_animated check-box" type="checkbox" id="remeberme" />
                    <label class="form-check-label" for="remeberme"
                      >{{ 'remember_me' | translate }}</label
                    >
                  </div>
                  <a [routerLink]="['/auth/forgot-password']" class="forgot-password"
                    >{{ 'forgot_password' | translate }}?</a
                  >
                </div>
              </div>
              <div class="col-12">
                <app-button [id]="'login_btn'">{{ 'log_in' | translate }}</app-button>
              </div>
            </form>
          </div>
          <div class="other-log-in">
            <h6>{{ 'or'| translate}}</h6>
          </div>
          <div class="sign-up-box">
            <h4>{{ "don't_have_an_account"| translate}}</h4>
            <a [routerLink]="['/auth/register']">{{ 'sign_up'| translate}}</a>
          </div>

          @if((setting$ | async)?.activation?.login_number){
          <a [routerLink]="['/auth/login-with-number']" class="number-btn"
            ><i class="ri-smartphone-line"></i> {{'Login With Mobile Number' | translate}}</a
          >
          }
        </div>
      </div>
    </div>
  </div>
</section>
