/* NeoLoss — вход и регистрация. Токены и общие компоненты — styles.css */

.auth-page { background: #fff; }
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 100vh; min-height: 100dvh; }

/* ---------- левая колонка ---------- */
.auth__main { display: flex; flex-direction: column; padding: 28px clamp(20px, 5vw, 72px) 28px; }
.auth__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth__back { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); transition: background-color .2s ease, color .2s ease; }
.auth__back:hover { background: var(--blue-50); color: var(--blue-hover); }
.auth__back .icon { width: 18px; height: 18px; }

.auth__box { position: relative; display: grid; width: 100%; max-width: 420px; margin: auto; padding: 40px 0; }
.auth__step { grid-area: 1 / 1; min-width: 0; opacity: 0; visibility: hidden; transform: translateY(12px); filter: blur(6px); transition: opacity .4s ease, transform .55s var(--ease-out), filter .4s ease, visibility 0s .55s; }
.auth__step.is-on { opacity: 1; visibility: visible; transform: none; filter: none; transition: opacity .45s ease .05s, transform .6s var(--ease-out) .05s, filter .45s ease .05s; }

.auth__title { font-size: clamp(2rem, 1.6rem + 1.4vw, 2.75rem); line-height: 1.08; font-weight: 300; letter-spacing: -.03em; }
.auth__lead { margin: 12px 0 28px; font-size: 16px; line-height: 1.5; color: var(--ink-3); }
.auth__lead b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.auth__title, .auth__lead { transition: opacity .25s ease; }
.auth__box.is-swap .auth__title, .auth__box.is-swap .auth__lead { opacity: 0; }

.seg--auth { display: flex; margin-bottom: 24px; }
.seg--auth button { height: 42px; font-size: 15px; }

/* формы внутри шага: вход / почта / регистрация */
.auth__forms { display: grid; }
.auth__form { display: none; }
.auth__form.is-on { display: grid; gap: 16px; animation: form-in .45s var(--ease-out); }
@keyframes form-in { from { opacity: 0; transform: translateY(8px); } }

/* поле */
.fld { display: grid; gap: 7px; }
.fld label { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.fld__opt { font-size: 12.5px; font-weight: 400; color: var(--ink-4); }
.fld__link { font-size: 13px; font-weight: 500; color: var(--blue); }
.fld__link:hover { color: var(--blue-hover); }
.fld__box {
  position: relative; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px;
  border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .2s ease, background-color .2s ease;
}
.fld__box:hover { box-shadow: inset 0 0 0 1px #CFDAE8; }
.fld__box:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px rgb(11 107 229 / .12); }
.fld__box > .icon { width: 19px; height: 19px; color: var(--ink-4); transition: color .2s ease; }
.fld__box:focus-within > .icon { color: var(--blue); }
.fld__box input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.fld__box input::placeholder { color: #A3ADBC; }
.fld__eye { width: 36px; height: 36px; display: grid; place-items: center; margin-right: -6px; border: 0; border-radius: 10px; background: none; color: var(--ink-4); }
.fld__eye:hover { color: var(--blue); background: var(--blue-50); }
.fld__eye.is-on { color: var(--blue); }
.fld__err { min-height: 0; font-size: 13px; color: #C2321F; }
.fld__err:empty { display: none; }
.fld.is-bad .fld__box { box-shadow: inset 0 0 0 1.5px #E2533F, 0 0 0 4px rgb(226 83 63 / .1); animation: shake .35s ease; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.auth__consent { margin-top: 2px; font-size: 13.5px; line-height: 1.45; color: var(--ink-3); }
.auth__consent a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgb(11 107 229 / .35); }
.auth__consent.is-bad .check__box { border-color: #E2533F; }

.auth__alt { text-align: center; }
.link-btn { border: 0; background: none; padding: 6px 8px; border-radius: 8px; font-size: 14.5px; font-weight: 500; color: var(--blue); }
.link-btn:hover { background: var(--blue-50); color: var(--blue-hover); }

.btn.is-loading { pointer-events: none; color: transparent; }
.btn.is-loading::after { content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid rgb(255 255 255 / .4); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* шаг с кодом */
.auth__stepback { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 22px -8px; padding: 6px 8px; border: 0; border-radius: 10px; background: none; font-size: 14.5px; font-weight: 500; color: var(--ink-3); }
.auth__stepback:hover { background: var(--blue-50); color: var(--blue-hover); }
.auth__stepback .icon { width: 18px; height: 18px; }
.code { display: grid; gap: 16px; min-width: 0; }
.code .btn { max-width: 100%; }
.code__cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 320px; }
.code__cells input {
  width: 100%; min-width: 0; height: 68px; border: 0; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
  text-align: center; font: inherit; font-size: 28px; font-weight: 600; color: var(--ink); outline: none; caret-color: var(--blue);
  transition: box-shadow .2s ease, background-color .2s ease, transform .2s var(--ease-out);
}
.code__cells input:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px rgb(11 107 229 / .12); }
.code__cells input.is-filled { background: #fff; transform: translateY(-2px); }
.code.is-bad .code__cells input { box-shadow: inset 0 0 0 1.5px #E2533F; animation: shake .35s ease; }
.code__resend { text-align: left; font-size: 14px; color: var(--ink-3); }
.code__resend b { font-variant-numeric: tabular-nums; color: var(--ink); }

/* готово */
.auth__done { text-align: center; justify-items: center; }
.auth__done-ico { width: 72px; height: 72px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 50%; background: #22B07D; color: #fff; box-shadow: 0 0 0 10px rgb(34 176 125 / .14); }
.auth__done-ico .icon { width: 34px; height: 34px; stroke-width: 2.6; }
.auth__done.is-on .auth__done-ico { animation: pop .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.auth__foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--ink-3); }
.auth__foot p { display: inline-flex; align-items: center; gap: 7px; }
.auth__foot .icon { width: 16px; height: 16px; color: #22B07D; }
.auth__foot a { color: var(--ink-2); font-weight: 500; }
.auth__foot a:hover { color: var(--blue); }

/* ---------- правая колонка: визуал ---------- */
.auth__visual { position: relative; margin: 12px 12px 12px 0; border-radius: 32px; display: grid; place-items: center; overflow: hidden; }
.auth__visual-in { position: relative; width: min(88%, 720px); padding: 48px 0; }
.auth__visual-title { margin-bottom: 32px; font-size: clamp(2rem, 1.4rem + 1.6vw, 3rem); line-height: 1.08; font-weight: 300; letter-spacing: -.03em; }
.auth__shot { border-radius: 22px; overflow: hidden; background: rgb(255 255 255 / .55); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .8), 0 40px 80px -40px rgb(16 40 90 / .45); transform: perspective(1400px) rotateY(-6deg) rotateX(2deg); transform-origin: left center; }
.auth__shot-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-bottom: 1px solid rgb(255 255 255 / .7); }
.auth__shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgb(15 26 42 / .12); }
.auth__shot-bar span { margin: 0 auto; padding: 3px 12px; border-radius: 7px; background: rgb(255 255 255 / .7); font-size: 11.5px; color: var(--ink-3); }
.auth__shot img { display: block; width: 100%; height: auto; }
.auth__chips { position: absolute; right: -24px; bottom: 6%; display: grid; gap: 12px; justify-items: end; }
.auth__chips .chip--float:nth-child(1) { margin-right: 30px; rotate: -3deg; }
.auth__chips .chip--float:nth-child(2) { rotate: 2.5deg; }
.auth__chips .chip--float:nth-child(3) { margin-right: 18px; rotate: -1.5deg; }
.auth__chips .chip--float { background: linear-gradient(135deg, rgb(255 255 255 / .82), rgb(255 255 255 / .55)); animation: levitate 6s ease-in-out infinite; }
.auth__chips .chip--float:nth-child(2) { animation-duration: 7s; animation-delay: -2s; }
.auth__chips .chip--float:nth-child(3) { animation-duration: 6.5s; animation-delay: -4s; }

@media (max-width: 1100px) {
  .auth__chips { right: -8px; }
}
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__visual { display: none; }
  .auth__main { padding: 18px 16px 22px; }
  .auth__box { padding: 32px 0; }
}
@media (max-width: 420px) {
  .code__cells { gap: 8px; }
  .code__cells input { height: 60px; font-size: 24px; }
  .auth__foot { flex-direction: column; align-items: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .auth__step, .auth__step.is-on { transition: none; filter: none; transform: none; }
  .auth__form.is-on, .auth__chips .chip--float, .fld.is-bad .fld__box, .code.is-bad .code__cells input { animation: none; }
}
