/* Login — two-panel split layout (ported from Lovable redesign) */
/* Токены (этап 2): цвета через семантику (--ink, --border, --surface, --danger),
   отступы/шрифты/радиусы — через шкалы. style.css грузится до login.css (base.html),
   поэтому var() резолвятся. Позиционные offset'ы (top/left/right) и hero-паддинги
   медиазапросов оставлены литералами — это координаты раскладки, не шкала отступов. */

.login-split {
  display: flex;
  min-height: 100vh;
  background: #fff;
  font-family: 'Exo 2', sans-serif;
  color: var(--ink);
}

/* Left black panel: brand + marketing copy */
.login-left {
  position: relative;
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: var(--space-4) 0 var(--space-4) var(--space-4);
  padding: var(--space-10) var(--space-12);
  color: #fff;
  border-radius: var(--radius-2xl);   /* 24→20 */
  box-sizing: border-box;
  overflow: hidden;
  background-color: #000; /* fallback, пока картинка грузится */
  background-image:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.6) 0%,
      rgba(0, 0, 0, 0.15) 28%,
      rgba(0, 0, 0, 0.15) 58%,
      rgba(0, 0, 0, 0.85) 100%
    ),
    url("../images/login-bg.3f8a527e0064.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.login-brand .login-brand-name {
  font-size: 20px;   /* off-grid: единственный вход, снап 20→18 заметен → этап 3 */
  font-weight: 600;
  letter-spacing: 0.2px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.login-tagline {
  margin: 0;
  max-width: 560px;
  font-size: var(--fs-base);
  line-height: 24px;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Right form panel */
.login-right {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-10);
  box-sizing: border-box;
}

.login-register-link {
  position: absolute;
  top: 32px;
  right: 40px;
  padding: var(--space-2) var(--space-5);   /* 10→8 / 18→20 */
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
}

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

.login-form h1 {
  max-width: 100%;
  margin: 0;
  font-size: var(--fs-display-1);   /* 28 */
  font-weight: 700;
  text-align: center;
  color: var(--ink);
}

.login-subtitle {
  margin: var(--space-2) 0 28px;   /* 28px off-grid: снап 28→32 заметен → этап 3 */
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

/* Плавающая подпись auth-поля (a11y: placeholder перестаёт быть единственной подписью, и
   при этом подпись не теряется при вводе). Пустое поле — подпись на месте плейсхолдера;
   фокус или заполнено — уезжает мелкой на верхнюю границу («нотч» с белым фоном; панель
   формы = .login-split #fff). Держится на :placeholder-shown, поэтому у поля placeholder=" "
   (пробел). Описательные плейсхолдеры убраны — их роль берёт подпись; ограничение длины
   пароля осталось за серверной валидацией. OTP-поля floating не используют (там aria-label).
   Цвет — var(--text-muted) (#6f6f6f, AA-тон); login.css грузится auth-страницами после style.css. */
.login-float { position: relative; }
.login-float + .login-float { margin-top: var(--space-4); }
.login-otp + .login-float { margin-top: var(--space-4); }

.login-float .login-label {
  position: absolute;
  left: 10px;                 /* +4px внутреннего padding = 14px, совпадает с padding-left поля */
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0 var(--space-1);
  background: #fff;
  color: var(--text-muted);
  font-size: var(--fs-sm);    /* = размер текста поля: в покое читается как плейсхолдер */
  pointer-events: none;
  transition: top .15s ease, font-size .15s ease;
}
.login-float .login-field:focus + .login-label,
.login-float .login-field:not(:placeholder-shown) + .login-label {
  top: 0;
  font-size: var(--fs-xs);
}

.login-field {
  width: 100%;
  padding: var(--space-3) var(--space-4);   /* 12 / 14→16 */
  font-size: var(--fs-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
  font-family: 'Exo 2', sans-serif;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.login-pw-wrap {
  position: relative;
  margin-top: var(--space-3);
}

.login-pw-wrap .login-field {
  margin-top: 0;
  padding-right: 44px;   /* клиренс под иконку-глаз */
}

/* Keep the field border when the eye toggle switches type to "text" —
   global `input[type=text] { border:none }` in style.css would otherwise win */
.login-form .login-field {
  border: 1px solid var(--border);
}

/* Eye toggle — override global button{} reset from style.css */
.login-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.login-error {
  margin-top: var(--space-2);   /* 10→8 */
  text-align: center;
  font-size: var(--fs-xs);      /* 13→12 */
  color: var(--danger);
  min-height: 18px;
}

/* Primary button — override global button{} reset from style.css */
.login-btn {
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--green-2);
  color: var(--ink);
  font-family: 'Exo 2', sans-serif;
  font-size: var(--fs-base);    /* 15→16 */
  font-weight: 600;
  line-height: normal;
  cursor: pointer;
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Чекбоксы согласий (register). Нативный input — доступен с клавиатуры и получает
   фокус-кольцо из style.css автоматически. Текст — muted-тон, ссылки — тёмные. */
.login-consent {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-3);
  font-size: var(--fs-xs);      /* 13→12 */
  line-height: 1.4;
  color: var(--text-muted);
}
.login-consent--first { margin-top: var(--space-4); }
.login-consent input[type="checkbox"] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.login-consent label { cursor: pointer; }
.login-consent a { color: var(--ink); text-decoration: underline; }

.login-forgot {
  display: block;
  margin-top: var(--space-5);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Stacked fields (register / reset) — space consecutive inputs */
.login-field + .login-field {
  margin-top: var(--space-3);
}

/* Success message (forgot-password) — успех-зелёный точечный, отдельного токена нет */
.login-success {
  margin-top: var(--space-2);
  text-align: center;
  font-size: var(--fs-xs);      /* 13→12 */
  color: #388e3c;
  min-height: 18px;
}

/* OTP code inputs (reset-password) — segmented joined cells */
.login-otp {
  display: flex;
  width: 100%;
  margin: var(--space-1) 0 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}

.login-otp input {
  flex: 1;
  min-width: 0;
  height: 64px;
  text-align: center;
  font-size: var(--fs-xl);      /* 22 */
  font-weight: 600;
  font-family: 'Exo 2', sans-serif;
  color: var(--ink);
  border: none;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  outline: none;
}

.login-otp input:last-child {
  border-right: none;
}

.login-otp input:focus {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 0 0 2.5px #1a1a1a;   /* спец-кольцо OTP-фокуса, литерал */
}

/* Space between OTP block and the password fields below it */
.login-otp + .login-field {
  margin-top: var(--space-4);
}


/* Resend-code timer (verify-email) */
.login-timer {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--fs-xs);      /* 13→12 */
  color: var(--text-muted);
}

.login-timer.ready-to-send {
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}

/* Mid desktop (1200–1440px): keep two panels but ease the cramping —
   the illustration takes a smaller share and its padding shrinks so the
   form on the right keeps comfortable breathing room. */
@media (max-width: 1440px) and (min-width: 1201px) {
  .login-left {
    flex: 0 0 42%;
    padding: 32px 36px;   /* hero-раскладка, литерал (36 off-grid) */
  }
}

/* Tablet & mobile (≤1200px): hide the illustration panel, center the form.
   Below this the 50/50 split cramps both the tagline and the form, so
   collapse to a single centered column. */
@media (max-width: 1200px) {
  .login-left {
    display: none;
  }

  .login-right {
    flex: 1 1 100%;
    padding: 80px 24px 40px;   /* hero-раскладка, литерал */
  }

  .login-register-link {
    top: 20px;
    right: 20px;
  }
}
