/* ==========================================================================
   Вход и регистрация
   ==========================================================================
   Экран разделён надвое: слева форма, справа — короткий ответ на вопрос
   «зачем мне здесь аккаунт». Человек на этом шаге ещё сомневается, и пустой
   тёмный экран с двумя полями сомнение усиливает.

   На узком экране правая половина скрывается целиком: на телефоне ценность
   формы в том, чтобы её быстро заполнить, а не читать рядом.
   ========================================================================== */

.auth-body {
  margin: 0;
  min-height: 100vh;
  font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.auth-body a { color: inherit; }

/* Полоса стенда живёт в design.css: она одинакова во всех оболочках. */

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  min-height: calc(100vh - 30px);
}

/* --- Левая половина: форма --- */

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
}

.auth-form-inner { width: 100%; max-width: 400px; }

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
  margin-bottom: clamp(28px, 5vw, 48px);
}
.auth-brand .ic { width: 30px; height: 30px; color: var(--accent); }

.auth-title {
  font-size: clamp(26px, 3.4vw, 34px);
  font-weight: 750;
  letter-spacing: -.028em;
  margin: 0 0 10px;
}
.auth-sub {
  color: var(--text-dim);
  font-size: 15px;
  margin: 0 0 28px;
  line-height: 1.55;
}

/* --- Поля --- */

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font: inherit;
  /* 16px обязательны: при меньшем размере Safari на iOS зумит страницу
     при фокусе, и человек проваливается в увеличенное поле. */
  font-size: 16px;
  padding: 14px 16px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.field input::placeholder { color: var(--muted); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 7px 0 0;
  line-height: 1.5;
}

/* Поле с кнопкой показа пароля */
.field-password { position: relative; }
.field-password input { padding-right: 52px; }
.password-toggle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.password-toggle:hover { color: var(--text); background: var(--surface-2); }

/* Индикатор надёжности пароля: не оценка «сильный/слабый» ради галочки,
   а подсказка о длине — единственном, что реально влияет на подбор. */
.pw-strength {
  display: flex;
  gap: 5px;
  margin-top: 9px;
}
.pw-strength i {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--surface-3);
  transition: background var(--normal) var(--ease);
}
.pw-strength.s1 i:nth-child(1) { background: var(--red); }
.pw-strength.s2 i:nth-child(-n+2) { background: var(--amber); }
.pw-strength.s3 i:nth-child(-n+3) { background: var(--green); }
.pw-strength.s4 i { background: var(--green); }

.auth-actions { margin-top: 26px; }

.auth-alt {
  margin-top: 22px;
  text-align: center;
  font-size: 14.5px;
  color: var(--text-dim);
}
.auth-alt a { color: var(--accent); text-decoration: none; font-weight: 600; }
.auth-alt a:hover { text-decoration: underline; }

.auth-legal {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* --- Правая половина --- */

.auth-aside {
  position: relative;
  display: flex;
  align-items: center;
  padding: clamp(32px, 5vw, 72px);
  background: var(--bg-soft);
  border-left: 1px solid var(--border-soft);
  overflow: hidden;
}
.auth-aside::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(76, 125, 240, .12) 0%, transparent 62%);
  pointer-events: none;
}

.auth-aside-inner { position: relative; max-width: 520px; }
.auth-aside h2 { margin-bottom: 18px; }
.auth-aside .subhead { margin-bottom: 34px; }

.auth-points { list-style: none; padding: 0; margin: 0; }
.auth-points li {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--border-soft);
}
.auth-points li:first-child { border-top: 0; }
.auth-points strong {
  display: block;
  font-size: 15.5px;
  font-weight: 650;
  margin-bottom: 4px;
}
.auth-points span:not(.ic-box) {
  display: block;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.55;
}

/* --- Сообщение об ошибке формы --- */

.auth-error {
  display: flex;
  gap: 11px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--red-soft);
  border: 1px solid rgba(240, 86, 75, .3);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 22px;
}
.auth-error .ic { width: 18px; height: 18px; color: var(--red); flex: 0 0 auto; margin-top: 1px; }

/* --- Адаптив --- */

@media (max-width: 900px) {
  /* Правая половина уходит: на телефоне важно быстро заполнить форму,
     а не читать рядом с ней. */
  .auth-split { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-form-side { align-items: flex-start; padding-top: 40px; }
}
