/* Вход, регистрация, приглашение, восстановление пароля и код из письма в ключе лендинга (дизайн-код 1.1).
   Слева шапка с логотипом и форма на фоне страницы, справа тёмная сцена первого экрана лендинга:
   вихрь точек, объёмный знак и площадки. На телефоне сцена становится полосой над формой.
   Подключается последним, после xaos.css, только на страницах входа. */

@font-face { font-family: 'Onest Logo'; src: url('/fonts/onest-logo.woff2') format('woff2'); font-weight: 600; font-display: swap; }

/* ---------- 1. Каркас ---------- */
body.ax { margin: 0; background: var(--bg); color: var(--text); }
.ax-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ax-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ax-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "top" "scene" "body" "foot";
  grid-template-rows: auto auto 1fr auto;
  min-height: 100vh; min-height: 100dvh;
  padding: 0 clamp(16px, 3.4vw, 56px);
}
.ax-top { grid-area: top; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; padding: 16px 0 12px; }
.ax-scene { grid-area: scene; }
.ax-body { grid-area: body; display: grid; align-content: center; justify-items: center; padding: clamp(20px, 4vh, 56px) 0; }
.ax-foot { grid-area: foot; padding: 0 0 22px; }

/* логотип как в шапке лендинга */
.ax-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text) !important; text-decoration: none; }
.ax-logo .logo-mark { width: 32px; height: 32px; flex: none; border-radius: 8px; }
.ax-logo .logo-mark rect { stroke: rgb(255 255 255 / .12); stroke-width: 1.5; }
.ax-logo span { font: 600 20px/1 'Onest Logo', var(--font); letter-spacing: -.04em; }
.ax-tools { display: flex; align-items: center; gap: 8px; }
.ax-tools .lang-sw.is-corner { position: static; background: none; }
html.ap-notice-on .ax-tools .lang-sw.is-corner { top: auto; }
.ax .lg-theme { position: static; width: 44px; height: 44px; background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--text); }
.ax .lg-theme:hover { background: var(--surface-2); }

/* ---------- 2. Экраны: без карточек, форма лежит прямо на странице ---------- */
.ax .auth, .ax .invite { display: block; width: 100%; max-width: 420px; min-height: 0; padding: 0; overflow: visible; background: none; }
.ax .auth[hidden], .ax .invite[hidden] { display: none; }
.ax .card, .ax .invite-card { width: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }

/* вкладки и есть заголовок: открытая вкладка набрана в полный цвет и подчёркнута */
.ax .tabs { display: flex; flex-wrap: wrap; gap: 4px clamp(18px, 2vw, 26px); margin: 0 0 8px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.ax .tabs button { position: relative; min-height: 0; padding: 0 0 10px; border: 0; border-radius: 0; background: none !important; box-shadow: none; color: var(--text-3); font-size: clamp(26px, 2.3vw, 34px); font-stretch: var(--wide); font-weight: 600; letter-spacing: -.04em; line-height: 1.08; transition: color var(--t-base) var(--ease-soft); }
.ax .tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform var(--t-base) var(--ease-out); }
.ax .tabs button:hover { color: var(--text-2); }
.ax .tabs button.on { color: var(--text); }
.ax .tabs button.on::after { transform: scaleX(1); }

.ax .reg-perk { margin: 12px 0 2px; padding: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.ax .reg-perk b { color: var(--text); font-weight: 600; }
.ax .join-hint { margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); font-size: 14px; }

/* поля */
.ax .field { margin-top: 16px; color: var(--text-2); font-size: 14px; }
.ax .field input { min-height: 52px; margin-top: 8px; padding: 0 16px; border-radius: 14px; font-size: 16px; }
.ax .forgot-row { display: flex; justify-content: flex-end; margin-top: 10px; }
.ax .forgot-row .link-btn { padding: 4px 0; color: var(--text); font-size: 14px; font-weight: 560; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.ax .ref-row { justify-content: flex-start; }

/* согласия */
.ax .agree { display: grid; gap: 4px; margin-top: 16px; }
.ax .agree .check { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; color: var(--text-2); font-size: 14px; line-height: 1.45; cursor: pointer; }
.ax .agree .check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--text); }
.ax .agree a, .ax .agree-tg a, .ax .otp-help a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.ax .fine { color: var(--text-3); font-size: 13.5px; line-height: 1.5; }

/* главное действие экрана: единственный оранжевый элемент */
.ax #submit, .ax .invite-card .btn[type="submit"], .ax .otp-submit { width: 100%; min-height: 54px; background: var(--orange); color: var(--ink-950); font-size: 16px; font-weight: 600; }
.ax #submit:hover, .ax .invite-card .btn[type="submit"]:hover, .ax .otp-submit:hover { background: var(--orange-hi); }
/* пока код не введён, кнопка серая: приглушённый оранжевый читается как коричневый */
.ax #submit:disabled, .ax .otp-submit:disabled { opacity: 1; background: var(--surface-2); color: var(--text-3); cursor: default; }
.ax .err { color: var(--err); font-size: 14px; }

/* вход через Telegram: спокойная кнопка, цвет только у значка */
.ax .tg-login { margin-top: 6px; }
.ax .tg-login .or { margin: 18px 0 14px; color: var(--text-3); font-size: 13px; }
.ax .tg-login .or::before, .ax .tg-login .or::after { background: var(--line); }
.ax .tg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; border: 0; border-radius: var(--r-pill); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font: 560 15px/1 var(--font); cursor: pointer; transition: background-color var(--t-base) var(--ease-soft); }
.ax .tg-btn:hover { background: var(--surface-2); border: 0; }
.ax .tg-btn svg { width: 20px; height: 20px; fill: #26A5E4; }
.ax .agree-tg { margin-top: 8px; font-size: 12.5px; }
/* v74: Yandex ID and VK ID next to Telegram, the same outline pill with the brand mark */
.ax .tg-login .tg-btn + .id-row { margin-top: 10px; }
.ax .id-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.ax .id-btn svg { fill: initial; }
.ax .tg-btn[hidden], .ax .id-row[hidden] { display: none; }
.ax .tg-btn:focus-visible { outline: 2px solid var(--accent, #FF5A1F); outline-offset: 2px; }
.ax .id-btn[aria-busy="true"] { opacity: .6; cursor: progress; }

/* приглашение: текст над формой одной колонкой */
.ax .invite { position: static; display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 30px; }
.ax .invite[hidden] { display: none; }
.ax .invite-copy { gap: 14px; max-width: none; }
.ax .invite-kicker { display: inline-flex; align-items: center; gap: 9px; width: fit-content; padding: 6px 14px 6px 11px; border-radius: var(--r-pill); background: none; box-shadow: inset 0 0 0 1px var(--line); color: var(--text-2); font-size: 13.5px; }
.ax .invite-kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text); }
.ax .invite-copy h1 { max-width: none; font-size: clamp(30px, 2.6vw, 40px); font-stretch: var(--wide); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; }
.ax .invite-copy > p { color: var(--text-2); font-size: 15.5px; }
.ax .invite-code { border: 0; border-radius: var(--r-pill); background: none; box-shadow: inset 0 0 0 1px var(--line-2); }
.ax .invite-code b { font-family: var(--font); }
.ax .invite-perks { border-top-color: var(--line); }
.ax .invite-perks article { padding: 12px 0; border-bottom-color: var(--line); }
.ax .invite-perks span { color: var(--text-3); }
.ax .invite-card h2 { font-size: 24px; font-stretch: var(--wide); letter-spacing: -.035em; }
.ax .invite-card .fine:first-child { margin: 0; }
.ax .invite-switch { margin-top: 12px; color: var(--text-2); }

/* код из письма, восстановление и новый пароль: рисунок и текст по центру колонки */
.ax .otp-card .otp-title { font-size: clamp(28px, 2.4vw, 36px); font-stretch: var(--wide); font-weight: 600; letter-spacing: -.04em; line-height: 1.05; }
.ax .otp-card .otp-lead { color: var(--text-2); }
.ax .otp-card .field { text-align: left; }

/* документы внизу колонки */
.ax .legal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-size: 13px; }
.ax .legal-links a { color: var(--text-3); text-decoration: none; transition: color var(--t-fast); }
.ax .legal-links a:hover { color: var(--text); }

/* ---------- 3. Сцена: тёмная в обеих темах, как первый экран лендинга ---------- */
.ax-stage { position: relative; height: 168px; overflow: hidden; isolation: isolate; border-radius: 24px; background: radial-gradient(60% 75% at 55% 42%, var(--ink-850), var(--ink-900) 72%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1); }
.ax-vortex { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.ax-obj { position: absolute; z-index: 1; left: 50%; top: 50%; --w: 112px; width: var(--w); aspect-ratio: 1276 / 1400; margin: calc(var(--w) * -.54859) 0 0 calc(var(--w) * -.5); }
.ax-float { position: relative; width: 100%; height: 100%; animation: ax-float 3.4s ease-in-out infinite alternate; }
.ax-float img { display: block; width: 100%; height: 100%; }
.ax-float .ax-dot { position: absolute; inset: 0; }
@keyframes ax-float { from { transform: translateY(0) rotate(0); } to { transform: translateY(-10px) rotate(1.6deg); } }
.ax-copy { display: none; }

@media (min-width: 1000px) {
  .ax-shell {
    grid-template-columns: clamp(480px, 38vw, 720px) minmax(0, 1fr);
    grid-template-areas: "top scene" "body scene" "foot scene";
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(32px, 4vw, 72px);
    padding-right: 0;
  }
  .ax-scene { align-self: start; position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 14px 14px 14px 0; }
  .ax-stage { height: 100%; border-radius: 32px; }
  .ax-obj { left: 54%; top: 40%; --w: clamp(190px, 30vh, 340px); }
  .ax-copy { display: block; position: absolute; z-index: 2; left: clamp(28px, 3vw, 52px); right: clamp(28px, 3vw, 52px); bottom: clamp(28px, 3vw, 48px); }
  .ax-title { margin: 0 0 clamp(20px, 2vw, 28px); color: var(--ink-50); font-size: clamp(38px, 3.7vw, 72px); font-stretch: var(--wide); font-weight: 620; letter-spacing: -.045em; line-height: .97; }
  .ax-title span { display: block; }
  .ax-nets { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
  .ax-nets li { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgb(255 255 255 / .04); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .1); }
  .ax-nets svg { width: 26px; height: 26px; }
}
@media (min-width: 1000px) and (max-height: 760px) {
  .ax-title { font-size: clamp(34px, 3vw, 52px); }
  .ax-nets li { width: 44px; height: 44px; border-radius: 14px; }
  .ax-nets svg { width: 22px; height: 22px; }
}
@media (max-width: 560px) {
  .ax .lg-theme { width: 42px; height: 42px; }
  .ax-body { align-content: start; padding: 28px 0 36px; }
  .ax-stage { height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .ax-float { animation: none; }
  .ax .tabs button, .ax .tabs button::after, .ax .tg-btn, .ax .legal-links a { transition: none; }
}
