/* ============================================================================
   ElectricTools — страницы входа и регистрации
   Подключать после styles.css и cabinet.css.
   ============================================================================ */

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.auth__inner {
  width: 100%;
  max-width: 460px;
}

.auth__logo {
  display: block;
  width: 210px;
  margin: 0 auto 30px;
}

.auth__card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  padding: 38px 34px;
}

.auth__title {
  font-size: 27px;
  text-align: center;
  margin-bottom: 8px;
}

.auth__lead {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 28px;
}

.auth__form-error {
  display: none;
  margin-bottom: 20px;
}
.auth__form-error.is-visible { display: flex; }

.auth__submit { margin-top: 24px; }

.auth__foot {
  text-align: center;
  margin-top: 24px;
  font-size: 15px;
  color: var(--muted);
}
.auth__foot a {
  color: var(--blue-600);
  font-weight: 600;
}
.auth__foot a:hover { text-decoration: underline; }

.auth__back {
  display: block;
  text-align: center;
  margin-top: 22px;
  font-size: 14px;
  color: var(--muted);
}
.auth__back:hover { color: var(--blue-600); }

/* ---------- Показать/скрыть пароль ---------- */
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 52px; }

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
  line-height: 0;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.password-toggle:hover { color: var(--blue-600); background: var(--bg-tint); }

/* ---------- Индикатор надёжности пароля ---------- */
.strength { margin-top: 10px; }
.strength__bar {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.strength__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width .25s var(--ease), background .25s var(--ease);
}
.strength__text {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
}
.strength--weak   .strength__fill { width: 33%;  background: #F87171; }
.strength--medium .strength__fill { width: 66%;  background: #FBBF24; }
.strength--strong .strength__fill { width: 100%; background: #34D399; }

/* ---------- Требования к паролю ---------- */
.requirements {
  margin-top: 12px;
  display: grid;
  gap: 5px;
}
.requirement {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  transition: color .18s var(--ease);
}
.requirement__mark {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--muted-2);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: 9px;
  line-height: 1;
  color: transparent;
  transition: all .18s var(--ease);
}
.requirement.is-met { color: #047857; }
.requirement.is-met .requirement__mark {
  background: #10B981;
  border-color: #10B981;
  color: #fff;
}

@media (max-width: 520px) {
  .auth__card { padding: 28px 22px; }
  .auth__logo { width: 170px; }
}

/* ============================================================================
   Почтовые сценарии: восстановление пароля, подтверждение адреса,
   список разрешённых доменов на регистрации.
   ============================================================================ */

/* ---------- Иконка-состояние в шапке карточки ---------- */
.auth__badge {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--bg-tint);
  border: 1px solid #C7DCFB;
  color: var(--blue-600);
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.auth__badge--ok {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #059669;
}
.auth__badge--error {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

.auth__card--center { text-align: center; }
.auth__card--center .auth__foot { text-align: center; }

/* ---------- Блок кнопок «что дальше» ---------- */
.auth__actions {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}
.auth__actions .btn { margin: 0; }

/* ---------- Результат операции (письмо отправлено / пароль изменён) ---------- */
.auth__result { margin-bottom: 4px; }
.auth__result .note__body span { display: block; }

/* ---------- Ссылка «Забыли пароль?» в строке с меткой поля ---------- */
.field__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.field__label-row .field__label { margin-bottom: 8px; }

.field__aside {
  font-size: 13px;
  color: var(--blue-600);
  font-weight: 600;
  white-space: nowrap;
}
.field__aside:hover { text-decoration: underline; }

/* ---------- Разрешённые домены на странице регистрации ---------- */
.domains {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-soft);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.domains__title {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.domains__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.domains__item {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #C7DCFB;
  color: var(--blue-700);
  transition: background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
/* Домен, который пользователь ввёл, подсвечивается — сразу видно попадание */
.domains__item.is-active {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: #047857;
}
/* Введён неразрешённый домен — весь блок становится предупреждением */
.domains.is-invalid {
  border-color: #FDE68A;
  background: #FFFBEB;
}
.domains.is-invalid .domains__title { color: #B45309; }

