/* ==========================================================================
   /login/ — combined entry page: phone-by-SMS (primary) + Telegram deep-link
   (secondary). Loads `account-form.css` alongside this file to reuse the
   shared input/consent/btn primitives for the phone form.
   ========================================================================== */

.login {
  /* Зеркало .account-form (см. комментарии там): минус in-flow шапка,
     одна grid-строка вместо auto 1fr (вторая осталась от выпиленного
     логотипа) и вертикальный центр карточки. */
  min-height: calc(100vh - var(--header-height));
  padding: 40px var(--container-padding-x) 64px;
  display: grid;
  grid-template-rows: 1fr;
  align-items: center;
  justify-items: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(245, 194, 5, 0.08) 0%, transparent 60%),
    var(--color-bg);
}

/* Card ------------------------------------------------------------------- */
.login__card {
  width: 100%;
  max-width: 520px;
  padding: 44px clamp(24px, 4vw, 48px);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.96) 0%, rgba(12, 12, 12, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(245, 194, 5, 0.06);
  text-align: center;
}

.login__eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(245, 194, 5, 0.14);
  border: 1px solid rgba(245, 194, 5, 0.45);
  color: var(--color-accent-from);
  font-family: var(--font-meta);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login__title {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: var(--shadow-text);
  color: var(--color-text);
}

.login__lede {
  margin: 18px auto 0;
  max-width: 380px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

/* Phone form (primary) --------------------------------------------------- */
/* Reuses .account-form__* primitives; this just owns the layout. */
.login__phone-form {
  margin-top: 28px;
}

/* Status ----------------------------------------------------------------- */
.login__status {
  margin: 20px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.login__status[data-state="done"] {
  background: rgba(78, 200, 130, 0.1);
  border-color: rgba(78, 200, 130, 0.45);
  color: #6ad99c;
}

.login__status[data-state="expired"],
.login__status[data-state="error"] {
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.4);
  color: #ff8a8a;
}

.login__spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(245, 194, 5, 0.25);
  border-top-color: var(--color-accent-from);
  animation: login-spin 0.8s linear infinite;
}

.login__status[data-state="done"] .login__spinner,
.login__status[data-state="expired"] .login__spinner,
.login__status[data-state="error"] .login__spinner {
  display: none;
}

@keyframes login-spin {
  to { transform: rotate(360deg); }
}

/* Hint ------------------------------------------------------------------- */
.login__hint {
  margin: 28px auto 0;
  max-width: 420px;
  text-align: left;
  font-family: var(--font-body);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.login__hint summary {
  cursor: pointer;
  list-style: none;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  transition: color .15s ease;
}

.login__hint summary:hover { color: var(--color-accent-from); }
.login__hint summary::-webkit-details-marker { display: none; }
.login__hint summary::before {
  content: "▾  ";
  font-size: 12px;
  display: inline-block;
  transition: transform .15s ease;
}

.login__hint[open] summary::before { transform: rotate(180deg); }

.login__hint p { margin: 12px 0 8px; }

.login__copyable {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-meta);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  word-break: break-all;
}

/* Alt path: SMS login --------------------------------------------------- */
.login__divider {
  margin: 32px 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, 0.36);
  font-family: var(--font-meta);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.login__divider::before,
.login__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.login__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 20px auto 0;
  padding: 0 28px;
  height: 52px;
  min-width: 240px;
  border-radius: var(--radius-button);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(14px, 1.4vw, 16px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.login__btn-secondary > svg {
  width: 20px;
  height: 20px;
  max-width: none;
  flex-shrink: 0;
  color: #29a0e0;
}

.login__btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(245, 194, 5, 0.45);
  transform: translateY(-1px);
}

@media (max-width: 480px) {
  .login { padding-top: 24px; gap: 32px; }
  .login__card { padding: 32px 20px; }
  /* «Подключить Telegram-бота» / «Пропустить — к поездкам» — 23-24 симв.
     аплокейса RoadRadio (600 резолвится в Bold — есть только 400/700/900):
     иконка, трекинг 0.06em и 14px разом в 320px не помещаются. */
  .login__btn-secondary {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 48px;
    padding: 0 8px;
    font-size: 13px;
    letter-spacing: normal;
  }
  .login__btn-secondary > svg { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .login__spinner { animation: none; }
}

/* Primary button (Telegram deep-link on /profile/link-telegram/) — mirrors
   .account-form__btn so it matches the gold button on the phone-entry page. */
.login__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 28px auto 0;
  padding: 0 32px;
  height: 60px;
  min-width: 260px;
  border: none;
  border-radius: var(--radius-button);
  background: var(--grad-accent);
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(16px, 1.6vw, 19px);
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: var(--shadow-button), 0 8px 24px rgba(245, 194, 5, 0.18);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}

.login__btn > svg {
  width: 20px;
  height: 20px;
  max-width: none;
  flex-shrink: 0;
}

.login__btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: var(--shadow-button), 0 12px 32px rgba(245, 194, 5, 0.32);
}

.login__btn:active {
  transform: translateY(0);
}

.login__alt-hint {
  margin: 16px auto 0;
  max-width: 380px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 480px) {
  /* 14px, не 15: «Открыть бот в Telegram» — 22 символа, на символ длиннее
     всего, что носит .account-form__btn, — нужен запас. */
  .login__btn {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 56px;
    padding: 0 10px;
    font-size: 14px;
  }
  .login__btn > svg { display: none; }
}

/* Telegram-link confirmation page (accounts/confirm_telegram_link.html).
   .login__btn / .login__btn-secondary are used as real <button>s here. */
button.login__btn,
button.login__btn-secondary {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.login__tg-identity {
  margin: 22px auto 0;
  display: inline-block;
  padding: 12px 22px;
  border-radius: 14px;
  background: rgba(41, 160, 224, 0.1);
  border: 1px solid rgba(41, 160, 224, 0.4);
  font-family: var(--font-meta);
  font-size: clamp(18px, 2.2vw, 22px);
  color: #bfe6fb;
  word-break: break-word;
}
