<app-breadcrumb [breadcrumb]="breadcrumb" />
<section class="log-in-section 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/sign-up.png" class="img-fluid" alt="register" />
        </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 phone-field">
                <div class="form-floating log-in-form">
                  <input
                    type="number"
                    class="form-control"
                    id="phone"
                    id="phone"
                    formControlName="phone"
                    placeholder="{{ 'phone' | translate }}"
                  />
                  <label for="phone">{{ 'phone_number' | translate }}</label>

                  @if(form.controls['phone'].touched &&
                  form.controls['phone'].errors?.['required']){
                  <div class="invalid-feedback">{{ 'phone_number_is_required' | translate }}</div>
                  }
                  <select2
                    class="custom-select intl-tel-input"
                    [data]="codes"
                    [templates]="template"
                    formControlName="country_code"
                  >
                    <ng-template #template let-data="data">
                      <div class="country">
                        <div class="flag-box">
                          <div class="iti-flag {{data?.class}}"></div>
                        </div>
                        <span class="dial-code">{{data.code}}</span>
                      </div>
                    </ng-template>
                  </select2>
                </div>
              </div>
              <div class="col-12">
                <app-button [id]="'send_otp_btn'">{{ 'Send Otp' | 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>
        </div>
      </div>
      <div class="col-xxl-7 col-xl-6 col-lg-6"></div>
    </div>
  </div>
</section>
