/*
 * Forgot password — forgot-password.html
 */

body:has(.forgot-password) {
  background: #ffffff;
}

.forgot-password {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg-auth);
}

.forgot-password__header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: var(--header-height-mobile);
  padding-inline: max(var(--page-inline), env(safe-area-inset-left, 0px))
    max(var(--page-inline), env(safe-area-inset-right, 0px));
  flex-shrink: 0;
}

.forgot-password__header--desktop {
  display: none;
}

.forgot-password__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text);
}

.forgot-password__back-icon {
  display: block;
}

.forgot-password__header-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}

.forgot-password__header-spacer {
  width: 40px;
}

.forgot-password__shell {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding: var(--space-24) max(var(--page-inline), env(safe-area-inset-right, 0px))
    var(--space-40) max(var(--page-inline), env(safe-area-inset-left, 0px));
}

.forgot-password__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-32);
  width: 100%;
}

.forgot-password__intro {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  text-align: center;
}

.forgot-password__heading {
  display: none;
}

.forgot-password__instruction {
  margin: 0;
  max-width: 335px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text);
}

.forgot-password__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
  width: 100%;
}

.forgot-password__submit-wrap {
  position: relative;
  width: 100%;
}

.forgot-password__submit-wrap:has(.forgot-password__server-error) {
  margin-bottom: 20px;
}

.forgot-password__server-error {
  position: absolute;
  height: 16px;
  left: 0;
  right: 0;
  bottom: -20px;
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  text-align: center;
  color: #ec5b5b;
}

.forgot-password .field {
  gap: var(--space-8);
}

.forgot-password .field__label {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.3;
}

.forgot-password .field--clearable .field__input::-ms-clear,
.forgot-password .field--clearable .field__input::-webkit-clear-button,
.forgot-password .field--clearable .field__input::-webkit-search-cancel-button {
  display: none;
}

.forgot-password .field__box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid #eaebea;
  border-radius: 16px;
  background: var(--color-input-bg);
}

.forgot-password .field__box .field__input {
  flex: 1;
  min-width: 0;
  min-height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  outline: none;
}

.forgot-password .field__input::placeholder {
  color: #737478;
}

.forgot-password .field--clearable .field__clear {
  display: none;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  color: #737478;
  opacity: 1;
  cursor: pointer;
}

.forgot-password .field--clearable.field--filled .field__clear {
  display: flex;
}

.forgot-password .field--clearable .field__clear:hover {
  opacity: 0.75;
}

.forgot-password .field--clearable:focus-within .field__box {
  border-width: 2px;
  border-color: #2dbe7b;
}

.forgot-password .field--clearable.field--error .field__box,
.forgot-password .field--clearable.field--error:focus-within .field__box {
  border-width: 1px;
  border-color: #ec5b5b;
  background: transparent;
}

.forgot-password .field--clearable.field--error .field__error {
  display: block;
  margin-top: var(--space-8);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: #ec5b5b;
}

.forgot-password .btn--primary:disabled,
.forgot-password .btn--primary.btn--disabled {
  background: #eaebea;
  color: #bfbfbf;
  cursor: not-allowed;
  opacity: 1;
}

.forgot-password .btn--primary:disabled:hover,
.forgot-password .btn--primary.btn--disabled:hover {
  opacity: 1;
}

.forgot-password__terms {
  margin-top: auto;
  margin-inline: auto;
  max-width: 233px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
}

.forgot-password__terms-link {
  font-weight: 600;
}

.forgot-password__terms-link:hover {
  color: var(--color-button);
}

@media (min-width: 768px) {
  body,
  .forgot-password {
    background: var(--color-bg-auth);
  }

  .forgot-password {
    position: relative;
    justify-content: center;
  }

  .forgot-password__header--mobile-tablet {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: var(--header-height-tablet);
    padding-inline: max(var(--page-inline), env(safe-area-inset-left, 0px))
    max(var(--page-inline), env(safe-area-inset-right, 0px));
  }

  .forgot-password__shell {
    flex: 0 1 auto;
    justify-content: center;
    padding: calc(var(--header-height-tablet) + var(--space-24))
      max(var(--page-inline), env(safe-area-inset-right, 0px)) var(--space-40)
      max(var(--page-inline), env(safe-area-inset-left, 0px));
  }

  .forgot-password__content {
    flex: 0 1 auto;
    align-items: center;
  }

  .forgot-password__instruction {
    max-width: 335px;
  }

  .forgot-password__form {
    max-width: 335px;
  }

  .forgot-password__terms {
    margin-top: var(--space-24);
    max-width: 233px;
    text-align: center;
  }
}

@media (min-width: 1280px) {
  body,
  .forgot-password {
    background: var(--color-bg-auth);
  }

  .forgot-password {
    align-items: center;
    justify-content: center;
    padding: var(--space-40) var(--space-16);
  }

  .forgot-password__header--mobile-tablet {
    display: none;
  }

  .forgot-password__shell {
    flex: 0 1 auto;
    width: 100%;
    max-width: var(--content-max);
    padding: 0;
  }

  .forgot-password__header--desktop {
    display: grid;
    grid-template-columns: 24px 1fr;
    min-height: var(--header-height-desktop);
    padding-inline: 0;
    margin-bottom: var(--space-24);
  }

  .forgot-password__header--desktop .forgot-password__back {
    width: 24px;
    height: 24px;
    margin-left: 0;
  }

  .forgot-password__header--desktop .forgot-password__header-spacer {
    display: none;
  }

  .forgot-password__content {
    gap: var(--space-24);
    align-items: center;
  }

  .forgot-password__heading {
    display: block;
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
  }

  .forgot-password__instruction {
    max-width: 502px;
  }

  .forgot-password__form {
    max-width: 502px;
  }

  .forgot-password__terms {
    margin-top: 0;
    padding-inline: var(--space-10);
    text-align: center;
  }
}
