<div class="margin-content">
  <div i18n class="title-page title-page-single">
    Reset my password
  </div>

  <form role="form" (ngSubmit)="resetPassword()" [formGroup]="form">
    <div class="form-group">
      <label i18n for="password">Password</label>
      <my-input-toggle-hidden formControlName="password" inputId="password"
                              i18n-placeholder placeholder="Password"
                              [ngClass]="{ 'input-error': formErrors['password'] }"
                              autocomplete="new-password"></my-input-toggle-hidden>
      <div *ngIf="formErrors.password" class="form-error">
        {{ formErrors.password }}
      </div>
    </div>

    <div class="form-group">
      <label i18n for="password-confirm">Confirm password</label>
      <my-input-toggle-hidden formControlName="password-confirm" inputId="password-confirm"
                              i18n-placeholder placeholder="Confirmed password"
                              [ngClass]="{ 'input-error': formErrors['password-confirm'] }"
                              autocomplete="new-password"></my-input-toggle-hidden>
      <div *ngIf="formErrors['password-confirm']" class="form-error">
        {{ formErrors['password-confirm'] }}
      </div>
    </div>

    <input type="submit" i18n-value value="Reset my password" [disabled]="!form.valid || !isConfirmedPasswordValid()">
  </form>
</div>
