<div id="login-page">
  <div class="login-header">
    <button
      type="button"
      appStopClick
      (click)="settings()"
      class="environment-urls-settings-icon"
      attr.aria-label="{{ 'settings' | i18n }}"
    >
      <i class="bwi bwi-cog bwi-lg" aria-hidden="true"></i>
      {{ "settings" | i18n }}
    </button>
  </div>
  <form
    id="login-page"
    #form
    (ngSubmit)="submit()"
    [appApiAction]="formPromise"
    attr.aria-hidden="{{ showingModal }}"
  >
    <div id="content" class="content">
      <img class="logo-image" alt="Bitwarden" />
      <p class="lead">{{ "loginOrCreateNewAccount" | i18n }}</p>
      <div class="box last">
        <div class="box-content">
          <div class="box-content-row" appBoxRow>
            <label for="email">{{ "emailAddress" | i18n }}</label>
            <input
              id="email"
              type="text"
              name="Email"
              [(ngModel)]="email"
              required
              appInputVerbatim="false"
            />
          </div>
          <div class="box-content-row box-content-row-flex" appBoxRow>
            <div class="row-main">
              <label for="masterPassword">{{ "masterPass" | i18n }}</label>
              <input
                id="masterPassword"
                type="{{ showPassword ? 'text' : 'password' }}"
                name="MasterPassword"
                class="monospaced"
                [(ngModel)]="masterPassword"
                required
                appInputVerbatim
              />
            </div>
            <div class="action-buttons">
              <button
                type="button"
                class="row-btn"
                appStopClick
                appA11yTitle="{{ 'toggleVisibility' | i18n }}"
                [attr.aria-pressed]="showPassword"
                (click)="togglePassword()"
              >
                <i
                  class="bwi bwi-lg"
                  aria-hidden="true"
                  [ngClass]="{ 'bwi-eye': !showPassword, 'bwi-eye-slash': showPassword }"
                ></i>
              </button>
            </div>
          </div>
        </div>
      </div>
      <div class="box last" [hidden]="!showCaptcha()">
        <div class="box-content">
          <iframe id="hcaptcha_iframe" style="margin-top: 20px"></iframe>
          <div class="box-content-row">
            <button class="btn block" type="button" routerLink="/accessibility-cookie">
              <i class="bwi bwi-universal-access" aria-hidden="true"></i>
              {{ "loadAccessibilityCookie" | i18n }}
            </button>
          </div>
        </div>
      </div>
      <div class="buttons with-rows">
        <div class="buttons-row">
          <button type="submit" class="btn primary block" [disabled]="form.loading">
            <b [hidden]="form.loading"
              ><i class="bwi bwi-sign-in" aria-hidden="true"></i> {{ "logIn" | i18n }}</b
            >
            <i class="bwi bwi-spinner bwi-spin" [hidden]="!form.loading" aria-hidden="true"></i>
          </button>
          <button type="button" routerLink="/register" class="btn block">
            <i class="bwi bwi-pencil-square" aria-hidden="true"></i> {{ "createAccount" | i18n }}
          </button>
        </div>
        <div class="buttons-row">
          <button
            type="button"
            (click)="launchSsoBrowser('desktop', 'bitwarden://sso-callback')"
            class="btn block"
          >
            <i class="bwi bwi-bank" aria-hidden="true"></i> {{ "enterpriseSingleSignOn" | i18n }}
          </button>
        </div>
      </div>
      <div class="sub-options">
        <button type="button" routerLink="/hint">{{ "getMasterPasswordHint" | i18n }}</button>
      </div>
    </div>
  </form>
</div>
<ng-template #environment></ng-template>
