body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Two-column layout ── */
.login-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 40px;
  max-width: 860px;
  padding: 0 24px;
  padding-top: calc((100vh - 56px - 520px) / 2);
  margin: 0 auto;
  min-height: calc(100vh - 56px);
}

/* ── Offer column — растягивается на высоту формы, контент по центру ── */
.login-offer-col {
  display: flex;
  align-items: center;
  flex: 0 0 340px;
  max-width: 340px;
}

/* ── Offer ── */
.login-offer {
}

.offer-title {
  font-family: var(--font-heading);
  font-size: calc(var(--fs-base) + 14px);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.offer-title span { color: var(--accent); }

.offer-desc {
  margin-top: 10px;
  font-size: var(--fs-lg);
  line-height: 1.5;
  color: var(--text-dim);
}

.offer-features {
  list-style: none;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offer-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-md);
  color: var(--text-dim);
}

.offer-features li svg { flex-shrink: 0; }

.offer-trial {
  margin-top: 20px;
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--accent-glow);
  color: var(--accent);
  font-size: var(--fs-md);
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--accent-glow);
}

/* ── Form (right) ── */
.login-form-wrap {
  width: 100%;
  max-width: 380px;
  flex-shrink: 0;
  padding-top: 5px;
  min-height: 0;
}

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.tab {
  flex: 1;
  padding: 0 12px 12px;
  text-align: center;
  font-size: var(--fs-lg);
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Forms ── */
.login-forms-container {
  position: relative;
}
.form {
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.form.active {
  visibility: visible;
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

label {
  display: block;
  font-size: var(--fs-md);
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-lg);
  outline: none;
  transition: border-color 0.2s;
}

input::placeholder { color: var(--text-muted); opacity: 0.4; }
input:focus { border-color: var(--accent); }

.field { margin-bottom: 18px; }

.input-with-btn {
  position: relative;
}
.input-with-btn input { padding-right: 40px; }
.input-action-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent; border-radius: 6px;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.15s;
}
.input-action-btn:hover {
  color: var(--accent);
  background: var(--accent-glow);
  border-color: var(--accent-glow);
}

/* Комикс-подсказка про случайное имя. Стрелка целится в кнопку рандома
   в правом углу инпута — попадает в неё одинаково на любой ширине. */
.name-hint {
  position: relative;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-size: calc(var(--fs-base) - 2px);
  line-height: 1.4;
  color: var(--text);
  animation: nameHintWiggle 2.4s ease-in-out infinite;
}
.name-hint::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 15px;
  width: 10px;
  height: 10px;
  background: var(--accent-glow);
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
  transform: rotate(45deg);
}
@keyframes nameHintWiggle {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
  .name-hint { animation: none; }
}

.legal-notice {
  font-size: calc(var(--fs-base) - 3px);
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 14px;
  text-align: center;
}
.legal-notice a {
  color: var(--text-dim);
  text-decoration: underline;
}
.legal-notice a:hover {
  color: var(--accent);
}
/* Флажок согласия на ПДн (partials/pd_consent.html): /register — в форме перед «Зарегистрироваться»,
   /login — только после ?oauth_error=consent, над кнопкой Яндекс ID */
.oauth-consent { margin-bottom: var(--space-lg); }
.form-consent { margin-bottom: var(--space-md); }
/* Глобальные label/input этой страницы (подписи полей, текстовые поля) флажку не нужны */
.pd-consent-label { margin-bottom: 0; }
.pd-consent-label input { padding: 0; border: none; background: none; }
/* «Если аккаунта ещё нет, он будет создан» — под кнопками входа через OAuth */
.ya-legal {
  margin-top: var(--space-sm);
  margin-bottom: var(--space-lg);
}

button[type="submit"] {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 12px;
  background: var(--accent); color: var(--bg);
  font-family: var(--font); font-size: var(--fs-lg); font-weight: 700;
  border: none; border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s;
}
button[type="submit"]:hover { opacity: 0.9; }
button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Social login ── */
.social-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  color: var(--text-muted); font-size: var(--fs-sm);
}
.social-divider::before,
.social-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}

.social-buttons {
  display: flex; gap: 8px;
}

.social-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: var(--fs-md); font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}
.social-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
  background: var(--bg-input);
}
.social-btn svg { flex-shrink: 0; }

/* Яндекс ID (spec-yandex-id): основная кнопка над заглушками остальных провайдеров */
.social-buttons--secondary { margin-top: var(--space-md); }
/* Подсказка под ошибкой входа: аккаунт мог быть создан через Яндекс ID без пароля */
.login-hint {
  margin: calc(-1 * var(--space-sm)) 0 var(--space-lg);
  font-size: var(--fs-sm); line-height: 1.5; color: var(--text-dim);
}

/* ── Messages ── */
.error-msg {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: var(--fs-md);
  margin-bottom: 18px;
  display: none;
}
.error-msg.visible { display: block; }

.success-msg {
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid var(--green);
  color: var(--green);
  padding: 16px;
  border-radius: var(--radius);
  font-size: var(--fs-lg);
  text-align: center;
  display: none;
}
.success-msg.visible { display: block; }
.success-msg strong { display: block; font-size: calc(var(--fs-base) + 2px); margin-bottom: 6px; }

.forgot-link {
  display: block;
  text-align: right;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  text-decoration: none;
  margin-bottom: 18px;
  cursor: pointer;
}
.forgot-link:hover { color: var(--accent); }

.forgot-form { display: none; margin-top: 8px; }
.forgot-form.visible { display: block; }

.btn {
  width: 100%; padding: 12px;
  font-size: var(--fs-lg); font-weight: 700;
  background: var(--accent); color: var(--bg);
}
.btn:hover { opacity: 0.9; }

.info-msg {
  background: rgba(88, 166, 255, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: var(--fs-md);
  margin-bottom: 18px;
  display: none;
}
.info-msg.visible { display: block; }

/* Контекст перехода (?from=pos-guest — перенос бесплатной проверки позиций в проект) */
.login-context {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-card));
  border: 1px solid var(--accent-glow);
  color: var(--text-dim);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  font-size: var(--fs-md);
  line-height: 1.5;
  margin-bottom: var(--space-lg);
}
.login-context strong { display: block; color: var(--text); font-weight: 600; margin-bottom: var(--space-2xs); }

/* ── Switch link between login/register ── */
.login-switch {
  text-align: center; font-size: var(--fs-md); color: var(--text-dim); margin-top: 18px;
}
.login-switch a { color: var(--accent); text-decoration: none; font-weight: 500; }
.login-switch a:hover { text-decoration: underline; }

/* ── Tab as link ── */
a.tab { text-decoration: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .login-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: none;
    gap: 5px;
    margin: 20px auto 32px;
    padding: 0 16px;
    padding-top: 0;
    min-height: 0;
  }
  .login-offer-col {
    display: contents;
  }
  .login-offer {
    max-width: 100%;
    text-align: center;
  }
  .offer-title { font-size: calc(var(--fs-base) + 8px); }
  .offer-desc { display: none; }
  .offer-features {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }
  .offer-features li {
    font-size: var(--fs-sm);
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 10px;
  }
  .offer-features li svg { width: 12px; height: 12px; }
  .login-offer { display: flex; flex-direction: column; }
  .offer-title { order: 1; }
  .offer-trial { order: 2; font-size: var(--fs-sm); padding: 7px 12px; margin-top: 8px; background: none; border: none; color: var(--text-dim); }
  .offer-desc { order: 3; }
  .offer-features { order: 4; margin-top: 10px; }
  .login-form-wrap { max-width: 100%; min-height: auto; }
}
