/* Страница регистрации */

.page-register { background: var(--bg); }

/* фон: ночной Майами из арта, затемнён под панель и к низу */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg::before {
  content: "";
  position: absolute;
  inset: -3%;
  background: url("../art/bg-miami.webp") 30% center / cover no-repeat;
  filter: saturate(1.15) brightness(0.8);
  translate: calc(var(--px, 0) * -0.5rem) calc(var(--py, 0) * -0.35rem);
  transition: translate 0.6s var(--ease-out);
  animation: bg-drift 26s ease-in-out infinite alternate;
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 35%, rgba(4, 6, 22, 0.75) 100%),
    radial-gradient(60% 70% at 78% 50%, rgba(4, 6, 22, 0.55), transparent 75%);
}
@keyframes bg-drift {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.coins { z-index: 1; }

/* ---------- Сетка ---------- */

.reg {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 0;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 92rem;
  margin: 0 auto;
  overflow-x: clip; /* слои арта (монеты, собака) выходят за блок, но не за экран */
  padding:
    max(var(--gutter), env(safe-area-inset-top))
    max(var(--gutter), env(safe-area-inset-right))
    max(var(--gutter), env(safe-area-inset-bottom))
    max(var(--gutter), env(safe-area-inset-left));
}

/* ---------- Арт: слои логотип / собака / слоган ----------
   Позиции слоёв в процентах от блока, поэтому композиция масштабируется целиком.
   Параллакс — через свойство translate (--px/--py от курсора), анимации — через transform. */

.reg__hero {
  position: relative;
  width: 100%;
  max-width: 44rem;
  aspect-ratio: 1 / 0.82;
}
.layer {
  position: absolute;
  height: auto;
  translate: calc(var(--px, 0) * var(--d) * 0.9rem) calc(var(--py, 0) * var(--d) * 0.6rem);
  transition: translate 0.5s var(--ease-out);
  will-change: transform;
}
.layer--coins {
  right: -18%;
  top: 14%;
  width: 92%;
  opacity: 0.9;
  animation: coins-in 1.2s 0.2s var(--ease-out) both, coins-drift 9s 1.4s ease-in-out infinite alternate;
}
@keyframes coins-in {
  from { opacity: 0; transform: scale(0.4) rotate(-12deg); }
  to { opacity: 0.9; transform: none; }
}
@keyframes coins-drift {
  from { transform: rotate(0) translateY(0); }
  to { transform: rotate(4deg) translateY(-3%); }
}
.layer--dog {
  right: -6%;
  bottom: -16%;
  width: 66%;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 1rem 2.5rem rgba(0, 0, 0, 0.55));
  animation: dog-in 1s 0.1s var(--ease-out) both, breathe 4.5s 1.2s ease-in-out infinite;
}
.layer--logo {
  left: -2%;
  top: 4%;
  width: 60%;
  animation: logo-drop 0.9s 0.35s var(--ease-back) both, logo-glow 3.2s 1.4s ease-in-out infinite;
}
.layer--slogan {
  display: none; /* до 960px слогана нет — место отдано логотипу */
  left: -1%;
  bottom: 17%;
  width: 56%;
  animation: slogan-slam 0.7s 0.75s var(--ease-back) both, float 5s 1.6s ease-in-out infinite;
}
@keyframes dog-in {
  from { opacity: 0; transform: translateY(12%) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.012) translateY(-0.4%); }
}
@keyframes logo-drop {
  0% { opacity: 0; transform: translateY(-30%) scale(0.6) rotate(-6deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 0.5rem rgba(170, 70, 255, 0.35)); }
  50% { filter: drop-shadow(0 0 1.6rem rgba(190, 90, 255, 0.75)); }
}
@keyframes slogan-slam {
  0% { opacity: 0; transform: scale(1.6) rotate(-8deg); }
  70% { opacity: 1; transform: scale(0.96) rotate(1deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes float {
  50% { transform: translateY(-2.5%) rotate(-1deg); }
}

/* плашка «Licensed providers only» */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1.4rem 0.7rem 0.75rem;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(14, 26, 82, 0.92), rgba(10, 18, 58, 0.85));
  border: 1px solid var(--line);
  box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-size: clamp(0.8rem, 1.1vw, 0.95rem);
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.badge__ico {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 0.7rem;
  background: linear-gradient(160deg, #3f8cff, #1d4fe0);
  box-shadow: 0 0 1.2rem var(--blue-glow);
  animation: badge-glow 2.8s ease-in-out infinite;
}
.badge__txt b { font-weight: 600; color: #8fb3ff; }
@keyframes badge-glow {
  50% { box-shadow: 0 0 2rem rgba(80, 140, 255, 0.85); }
}
.reg__hero .badge { display: none; }
.badge--inline {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.badge--inline .badge__ico { width: 2.25rem; height: 2.25rem; }

/* ---------- Панель с формой ---------- */

.reg__panel {
  --pad: clamp(1.25rem, 6cqi, 2.75rem);
  position: relative;
  container-type: inline-size;
  width: 100%;
  max-width: 36rem;
  margin-top: clamp(-4.5rem, -10vw, -2.5rem);
  padding: var(--pad);
  padding-top: calc(var(--pad) + 0.5rem);
  border-radius: var(--radius-l);
  background: linear-gradient(180deg, rgba(10, 20, 64, 0.86), rgba(6, 12, 40, 0.92));
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow:
    0 0 0 1px var(--line-strong),
    0 0 2.5rem rgba(47, 107, 255, 0.28),
    0 2rem 4rem rgba(0, 0, 0, 0.55);
  animation: panel-in 0.9s 0.15s var(--ease-out) both;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(2rem) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* бегущий свет по рамке панели */
@property --ang {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.reg__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--ang), transparent 0 70%, #6fa0ff 82%, #fff 86%, #6fa0ff 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: border-run 6s linear infinite;
  pointer-events: none;
}
@keyframes border-run { to { --ang: 360deg; } }

/* ---------- Заголовок (арт) ---------- */

.title {
  margin: -0.5rem 0 clamp(0.75rem, 3cqi, 1.25rem);
  text-align: center;
  line-height: 0;
}
.title img {
  display: inline-block;
  width: min(100%, 30rem);
  animation: title-pop 0.8s 0.5s var(--ease-back) both;
}
@keyframes title-pop {
  from { transform: scale(0.85) rotate(-3deg); filter: brightness(1.8); }
  to { transform: none; filter: none; }
}

/* ---------- Шаги ---------- */

.steps {
  --step-sz: clamp(2.75rem, 13cqi, 4.25rem);
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: start;
  margin: 0 0 clamp(1.25rem, 5cqi, 1.75rem);
  padding: clamp(0.85rem, 3.5cqi, 1.25rem) clamp(0.5rem, 2.5cqi, 1rem);
  list-style: none;
  border-radius: var(--radius);
  background: rgba(8, 16, 52, 0.75);
  box-shadow: inset 0 0 0 1px var(--line);
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  text-align: center;
}
.step__ico {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--step-sz);
  height: var(--step-sz);
  border-radius: 50%;
  border: 2px solid rgba(70, 120, 255, 0.55);
  background: radial-gradient(circle at 50% 35%, #1a3aa8, #0b1b5e);
  color: #cfe0ff;
  transition: transform 0.4s var(--ease-back), background 0.4s, border-color 0.4s, box-shadow 0.4s;
}
.step__ico .icon { width: calc(var(--step-sz) * 0.42); height: calc(var(--step-sz) * 0.42); }
.step__label {
  font-size: clamp(0.68rem, 3cqi, 0.95rem);
  font-weight: 600;
  line-height: 1.2;
  color: #8fb3ff;
  overflow-wrap: anywhere;
}
.step.is-active .step__ico {
  border-color: #7fb0ff;
  background: radial-gradient(circle at 50% 35%, #3a7bff, #1440c8);
  color: #fff;
  box-shadow: 0 0 0 0.3rem rgba(47, 107, 255, 0.2), 0 0 1.4rem var(--blue-glow);
  animation: step-pulse 2.2s ease-in-out infinite;
}
.step.is-active .step__label { color: #fff; }
@keyframes step-pulse {
  0%, 100% { box-shadow: 0 0 0 0.25rem rgba(47, 107, 255, 0.2), 0 0 1.2rem var(--blue-glow); }
  50% { box-shadow: 0 0 0 0.55rem rgba(47, 107, 255, 0.08), 0 0 2rem rgba(70, 130, 255, 0.8); }
}
.step__done {
  position: absolute;
  inset: auto -0.2rem -0.2rem auto;
  width: 1.25rem !important;
  height: 1.25rem !important;
  padding: 0.18rem;
  border-radius: 50%;
  background: var(--ok);
  color: #04261a;
  stroke-width: 3;
  transform: scale(0);
  transition: transform 0.4s var(--ease-back);
}
.step.is-done .step__ico { border-color: var(--ok); }
.step.is-done .step__done { transform: scale(1); }
.step.is-pop .step__ico { animation: step-pop 0.7s var(--ease-back); }
@keyframes step-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.22) rotate(-8deg); }
  100% { transform: scale(1); }
}
.steps__arrow {
  display: grid;
  place-items: center;
  height: var(--step-sz);
  padding: 0 clamp(0.1rem, 1.2cqi, 0.6rem);
  color: #3f7dff;
}
.steps__arrow .icon {
  width: clamp(0.9rem, 4cqi, 1.4rem);
  height: clamp(0.9rem, 4cqi, 1.4rem);
  animation: arrow-nudge 1.6s ease-in-out infinite;
}
.steps__arrow:nth-of-type(4) .icon { animation-delay: 0.2s; }
.steps__arrow:nth-of-type(6) .icon { animation-delay: 0.4s; }
@keyframes arrow-nudge {
  50% { transform: translateX(0.2rem); opacity: 0.55; }
}

/* ---------- Поля ---------- */

.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.95rem; }

.field label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
  font-size: 0.9375rem;
  font-weight: 500;
}
.field label .icon { width: 1.1rem; height: 1.1rem; color: #dfe6ff; }

.control {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--radius-s);
  background: rgba(10, 22, 70, 0.85);
  box-shadow: inset 0 0 0 1px rgba(80, 120, 255, 0.35);
  transition: box-shadow 0.25s, background 0.25s;
}
.control:focus-within {
  background: rgba(14, 30, 92, 0.95);
  box-shadow: inset 0 0 0 1.5px #5d8dff, 0 0 0 0.25rem rgba(47, 107, 255, 0.18), 0 0 1.25rem rgba(47, 107, 255, 0.3);
}
.control__lead {
  position: absolute;
  left: 0.9rem;
  width: 1.15rem;
  height: 1.15rem;
  color: #5d86ff;
  pointer-events: none;
  transition: transform 0.3s var(--ease-back), color 0.25s;
}
.control:focus-within .control__lead { color: #9cbcff; transform: scale(1.15); }
.control input {
  flex: 1;
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  padding: 0.7rem 0.9rem 0.7rem 3rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  font-size: max(16px, 1rem);
  outline: none;
}
.control input::placeholder { color: #8291c4; }
.control--promo input { font-weight: 600; letter-spacing: 0.04em; }

.control__eye {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  margin-right: 0.15rem;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #6f93ff;
  transition: color 0.2s, transform 0.2s;
}
.control__eye .icon { width: 1.3rem; height: 1.3rem; }
.control__eye .eye-off { display: none; }
.control__eye[aria-pressed="true"] .eye-on { display: none; }
.control__eye[aria-pressed="true"] .eye-off { display: block; }
.control__eye:active { transform: scale(0.85); }

.control__ok {
  margin-right: 0.9rem;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0.15rem;
  border-radius: 50%;
  background: var(--ok);
  color: #04261a;
  stroke-width: 3;
  transform: scale(0);
  transition: transform 0.35s var(--ease-back);
}
.control--promo.is-ok .control__ok { transform: scale(1); }

.field__err {
  min-height: 0;
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: var(--danger);
}
.field__err:empty { display: none; }
.field__err--agree { margin-top: -0.4rem; }
.is-invalid .control { box-shadow: inset 0 0 0 1.5px var(--danger), 0 0 1rem rgba(255, 92, 122, 0.25); }
.shake { animation: shake 0.45s; }
@keyframes shake {
  20%, 60% { transform: translateX(-0.4rem); }
  40%, 80% { transform: translateX(0.4rem); }
}

/* чекбокс согласия */
.agree {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  min-height: var(--tap);
  padding-top: 0.15rem;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #c6cff2;
  cursor: pointer;
}
.agree input { position: absolute; opacity: 0; width: 1.5rem; height: 1.5rem; margin: 0; }
.agree__box {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.35rem;
  border: 1.5px solid #4c7bff;
  background: rgba(10, 22, 70, 0.9);
  transition: background 0.2s, border-color 0.2s;
}
.agree__box .icon { width: 1rem; height: 1rem; stroke-width: 3; color: #8fb3ff; transform: scale(0); transition: transform 0.3s var(--ease-back); }
.agree input:checked + .agree__box { border-color: #5d8dff; }
.agree input:checked + .agree__box .icon { transform: scale(1); }
.agree input:focus-visible + .agree__box { outline: 2px solid #8fb0ff; outline-offset: 3px; }
.agree.is-invalid .agree__box { border-color: var(--danger); }

.link {
  color: #4f8bff;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease-out), color 0.2s;
}
@media (hover: hover) {
  .link:hover { background-size: 100% 1px; color: #7aa7ff; }
}

/* кнопка Register */
.btn-register {
  width: 100%;
  min-height: 3.5rem;
  margin-top: 0.35rem;
  font-size: 1.125rem;
  background: linear-gradient(180deg, #4f86ff, #1f56f0 55%, #1846d8);
  box-shadow: 0 0.6rem 1.6rem rgba(31, 86, 240, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: #fff;
}
.btn-register .icon { width: 1.5rem; height: 1.5rem; }
@media (hover: hover) {
  .btn-register:hover { filter: brightness(1.12); box-shadow: 0 0.8rem 2.2rem rgba(31, 86, 240, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35); transform: translateY(-1px); }
}
.spinner {
  display: none;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn-register.is-loading { pointer-events: none; }
.btn-register.is-loading .spinner { display: block; }
.btn-register.is-loading .icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.signin {
  margin: 0.25rem 0 0;
  text-align: center;
  font-size: 0.9375rem;
  color: #b9c3ea;
}
.demo-note {
  margin: -0.25rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}
.link--inactive { cursor: default; pointer-events: none; }
.signin .link { display: inline-block; padding: 0.6rem 0.2rem; margin: -0.6rem 0; }

/* ---------- Узкая панель (контейнер) ---------- */

@container (max-width: 25rem) {
  .steps { --step-sz: 2.6rem; }
  .steps { grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; padding-inline: 0.35rem; }
  .steps__arrow { padding: 0; }
}

/* ---------- 560–959px: арт на всю ширину, композиция растянута по горизонтали ---------- */

@media (min-width: 560px) and (max-width: 959px) {
  .reg__hero {
    max-width: none;
    aspect-ratio: 1.75 / 1;
  }
  .layer--logo { left: 2%; top: 10%; width: 50%; }
  .layer--dog { right: 3%; bottom: -10%; width: 44%; }
  .layer--coins { right: -6%; top: 6%; width: 64%; }
  .reg__panel { max-width: 38rem; margin-top: -2rem; }
}

/* ---------- ≥ 960px: две колонки, как на скрине ---------- */

@media (min-width: 960px) {
  .reg {
    grid-template-columns: minmax(0, 1fr) minmax(27rem, 40rem);
    align-items: center;
    justify-items: stretch;
    column-gap: clamp(1rem, 3vw, 3rem);
  }
  .reg__hero {
    max-width: none;
    width: min(100%, calc(100dvh - 2 * var(--gutter)));
    aspect-ratio: 1 / 1;
    margin-inline: auto;
  }
  .layer--logo { left: 6%; top: 1%; width: 52%; }
  .layer--coins { right: -10%; top: 12%; width: 86%; }
  .layer--dog {
    right: -4%;
    bottom: 0;
    width: 72%;
    -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent);
    mask-image: linear-gradient(to bottom, #000 82%, transparent);
  }
  .layer--slogan { display: block; left: 2%; bottom: 13%; width: 58%; }
  .reg__hero .badge {
    display: inline-flex;
    position: absolute;
    left: 6%;
    bottom: 0;
    z-index: 2;
    animation: reveal-up 0.8s 0.9s var(--ease-out) both;
  }
  .reg__panel {
    max-width: none;
    margin-top: 0;
    animation-name: panel-in-right;
  }
  .badge--inline { display: none; }
  .title img { width: min(100%, 28rem); max-height: clamp(5.75rem, 13.5vh, 11.5rem); object-fit: contain; }

  /* панель целиком влезает в высоту экрана, как на макете */
  .reg__panel { --pad: clamp(1rem, 2.4vh, 2.75rem); }
  .title { margin-bottom: clamp(0.5rem, 1.4vh, 1.25rem); }
  .steps { --step-sz: clamp(2.75rem, min(13cqi, 6.2vh), 4.25rem); margin-bottom: clamp(0.85rem, 2.2vh, 1.75rem); padding-block: clamp(0.65rem, 1.6vh, 1.25rem); }
  .form { gap: clamp(0.45rem, 1vh, 0.95rem); }
  .field label { margin-bottom: clamp(0.25rem, 0.6vh, 0.45rem); }
  .control input { min-height: clamp(2.75rem, 5.2vh, 3rem); }
  .btn-register { min-height: clamp(3rem, 6vh, 3.5rem); }
}
@keyframes panel-in-right {
  from { opacity: 0; transform: translateX(3rem) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* низкий экран в альбомной ориентации: арт прячем, форма на всю высоту */
@media (max-height: 560px) and (orientation: landscape) and (max-width: 959px) {
  .reg__hero { display: none; }
  .reg__panel { margin-top: 0; }
}

/* очень узкие экраны (320–359) */
@media (max-width: 359px) {
  .step__label { font-size: 0.625rem; }
  .agree { font-size: 0.8125rem; }
}
