/* ==========================================================================
   VPN APS · неоновая тема страниц входа и регистрации
   Всё заскоплено под .auth-neon, чтобы не ломать остальные страницы сайта.
   ========================================================================== */
@property --a {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.auth-neon {
  --panel: #0e0c15;
  --field: #14111d;
  --line: rgba(255, 255, 255, 0.08);
  --fg: #f5f2f9;
  --mute: #9189a6;
  --dim: #61597a;
  --pink: #ff2d6f;
  --pink-soft: #ff8aa8;
  --violet: #7a3cff;
  --ok: #3ddc97;
  --warn: #ffb347;
  --bad: #ff5470;
  --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  position: relative;
  color: var(--fg);
  font-family: var(--f-body);
  padding-bottom: 40px;
}

.auth-neon::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 8% 0%, rgba(255, 45, 111, 0.16), transparent 70%),
    radial-gradient(50% 45% at 100% 100%, rgba(122, 60, 255, 0.16), transparent 70%);
}

.auth-neon::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 85%);
  mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 85%);
}

.auth-neon :focus-visible {
  outline: 2px solid var(--pink-soft);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- сетка страницы ---------- */
.auth-neon .grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-areas: "intro card" "visual card";
  column-gap: 56px;
  row-gap: 8px;
  align-items: start;
  padding-top: 20px;
}
.auth-neon .intro { grid-area: intro; padding-top: 12px; }
.auth-neon .visual { grid-area: visual; }
.auth-neon .card-col { grid-area: card; position: relative; padding-top: 12px; }
.auth-neon.compact .grid-main {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  grid-template-areas: "card visual";
}
.auth-neon.compact .intro { display: none; }

@media (max-width: 900px) {
  /* на телефоне — одна колонка: заголовок, форма, глобус */
  .auth-neon .grid-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "intro" "card" "visual";
    row-gap: 22px;
    padding-top: 4px;
  }
  .auth-neon.compact .grid-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "card" "visual";
    row-gap: 22px;
    padding-top: 4px;
  }
  .auth-neon .intro,
  .auth-neon .card-col,
  .auth-neon .visual { grid-column: 1 / -1; min-width: 0; }
  .auth-neon h1.hero { font-size: clamp(1.5rem, 7vw, 2rem); margin: 12px 0 10px; }
  .auth-neon .lead { font-size: 14.5px; }
  .auth-neon .globe-wrap { max-width: 340px; margin: 0 auto; }
  .auth-neon .chips { justify-content: center; }
  .auth-neon .card-col { padding-top: 0; }
}

/* ---------- плашка «серверы в сети» ---------- */
.auth-neon .pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--mute);
}
.auth-neon .pill .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.6); animation: neonPing 2.2s infinite;
}
@keyframes neonPing {
  70% { box-shadow: 0 0 0 9px rgba(61, 220, 151, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); }
}

.auth-neon h1.hero {
  font-family: var(--f-display); font-weight: 900;
  font-size: clamp(1.7rem, 3.6vw, 2.9rem);
  line-height: 1.08; letter-spacing: -0.02em;
  margin: 18px 0 14px; color: #fff;
}
.auth-neon h1.hero em {
  font-style: normal;
  background: linear-gradient(95deg, #ff2d6f 10%, #ff9bb4 55%, #b58aff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-neon .lead { color: var(--mute); max-width: 46ch; font-size: 15.5px; margin: 0; line-height: 1.6; }

/* ---------- глобус ---------- */
.auth-neon .globe-wrap { position: relative; max-width: 520px; margin-top: 4px; }
.auth-neon canvas#globe { display: block; width: 100%; aspect-ratio: 1; }
.auth-neon .chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.auth-neon .chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--mute); font-weight: 600;
}
.auth-neon .chip b {
  font-family: var(--f-mono); font-weight: 500; color: var(--fg); font-size: 12px;
  letter-spacing: 0.04em;
}
.auth-neon .chip i { font-style: normal; font-family: var(--f-mono); color: var(--ok); font-size: 11.5px; }

/* ---------- карточка со свечением ---------- */
.auth-neon .card {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, rgba(20, 17, 29, 0.92), rgba(13, 11, 20, 0.96));
  border-radius: 28px;
  padding: 28px 28px 24px;
  box-shadow: inset 0 0 0 1px var(--line), 0 40px 80px -30px rgba(0, 0, 0, 0.9),
              0 0 120px -30px rgba(255, 45, 111, 0.35);
}
.auth-neon .card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  pointer-events: none;
  background: conic-gradient(from var(--a), transparent 0 52%, var(--pink) 72%,
             #ff9bb4 80%, var(--violet) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: neonSpin 7s linear infinite;
}
@keyframes neonSpin { to { --a: 360deg; } }

.auth-neon .card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.auth-neon .badge-time {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--pink-soft);
  padding: 6px 12px; border-radius: 999px; background: rgba(255, 45, 111, 0.1);
  border: 1px solid rgba(255, 45, 111, 0.28);
}
.auth-neon .badge-time svg { width: 14px; height: 14px; }
.auth-neon .steps { display: flex; gap: 5px; }
.auth-neon .steps i {
  width: 22px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1);
  transition: background .3s;
}
.auth-neon .steps i.on {
  background: linear-gradient(90deg, var(--pink), #ff9bb4);
  box-shadow: 0 0 10px rgba(255, 45, 111, 0.6);
}

.auth-neon h2.title {
  font-family: var(--f-display); font-weight: 700; font-size: 23px;
  letter-spacing: -0.01em; margin: 0 0 8px; color: #fff;
}
.auth-neon .sub { margin: 0 0 20px; color: var(--mute); font-size: 13.5px; line-height: 1.55; }

/* ---------- поля ---------- */
.auth-neon .field { margin-bottom: 14px; }
.auth-neon .field label,
.auth-neon .lab {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 8px;
  font-weight: 500;
}
.auth-neon .ctl {
  position: relative; display: flex; align-items: center;
  background: var(--field); border: 1px solid var(--line); border-radius: 15px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-neon .ctl:hover { border-color: rgba(255, 255, 255, 0.16); }
.auth-neon .ctl:focus-within {
  border-color: rgba(255, 45, 111, 0.7);
  box-shadow: 0 0 0 4px rgba(255, 45, 111, 0.14), 0 10px 30px -12px rgba(255, 45, 111, 0.5);
}
.auth-neon .ctl.ok { border-color: rgba(61, 220, 151, 0.45); }
.auth-neon .ctl.err { border-color: rgba(255, 84, 112, 0.7); }
.auth-neon .ctl .ico {
  width: 20px; height: 20px; flex: none; margin-left: 16px; color: var(--dim);
  transition: color .2s; display: block;
}
.auth-neon .ctl:focus-within .ico { color: var(--pink-soft); }
.auth-neon .ctl input {
  flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; outline: 0;
  color: var(--fg); font: 500 15.5px var(--f-body); padding: 16px 14px;
  letter-spacing: 0;
}
.auth-neon .ctl input::placeholder { color: #4f4866; }
.auth-neon .tool {
  flex: none; margin-right: 8px; height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--mute); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; transition: background .2s, color .2s, border-color .2s;
}
.auth-neon .tool:hover {
  background: rgba(255, 45, 111, 0.12); color: #fff; border-color: rgba(255, 45, 111, 0.4);
}
.auth-neon .tool svg { width: 16px; height: 16px; display: block; }
.auth-neon .tool.sq { width: 36px; padding: 0; justify-content: center; }
.auth-neon .tool .eye-off { display: none; }
.auth-neon .tool[aria-pressed="true"] .eye-on { display: none; }
.auth-neon .tool[aria-pressed="true"] .eye-off { display: block; }

.auth-neon .hint {
  margin: 8px 2px 0; font-size: 12.5px; color: var(--mute); min-height: 18px;
  display: flex; gap: 6px; align-items: center; line-height: 1.45;
}
.auth-neon .hint.ok { color: var(--ok); }
.auth-neon .hint.err { color: var(--bad); }

.auth-neon .meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.auth-neon .meter i {
  height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.09);
  transition: background .25s, box-shadow .25s;
}
.auth-neon .meter[data-lv="1"] i:nth-child(-n+1) { background: var(--bad); }
.auth-neon .meter[data-lv="2"] i:nth-child(-n+2) { background: var(--warn); }
.auth-neon .meter[data-lv="3"] i:nth-child(-n+3) { background: #b6e35a; }
.auth-neon .meter[data-lv="4"] i { background: var(--ok); box-shadow: 0 0 10px rgba(61, 220, 151, 0.55); }
.auth-neon .meter-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-top: 8px; flex-wrap: wrap;
}
.auth-neon .rules { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.auth-neon .rules li {
  font-size: 11.5px; padding: 4px 9px; border-radius: 999px; color: var(--dim);
  border: 1px solid var(--line); transition: all .25s;
}
.auth-neon .rules li.on {
  color: var(--ok); border-color: rgba(61, 220, 151, 0.4); background: rgba(61, 220, 151, 0.08);
}
.auth-neon .lv-label {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--mute); white-space: nowrap;
}

/* ---------- капча в стиле темы ---------- */
.auth-neon .captcha {
  margin: 4px 0 16px; padding: 14px; border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 45, 111, 0.12), rgba(14, 12, 21, 0.9));
  border: 1px solid rgba(255, 45, 111, 0.32);
}
.auth-neon .captcha-row { display: flex; align-items: center; gap: 12px; }
.auth-neon .captcha-ico { width: 46px; height: 46px; flex: none; display: block; }
.auth-neon .captcha-ico svg { width: 100%; height: 100%; display: block; }
.auth-neon .captcha-text b {
  display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--pink-soft); font-weight: 500;
}
.auth-neon .captcha-text span { display: block; font-size: 12.5px; color: var(--mute); margin-top: 3px; }
.auth-neon .captcha-task {
  display: flex; align-items: center; justify-content: center; gap: 9px; margin: 12px 0;
}
.auth-neon .cap-chip {
  min-width: 46px; padding: 8px 13px; border-radius: 13px; text-align: center;
  font-family: var(--f-display); font-size: 21px; font-weight: 700; color: #fff;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line);
}
.auth-neon .cap-op { font-size: 19px; font-weight: 800; color: var(--pink-soft); }
.auth-neon .cap-q {
  min-width: 46px; padding: 8px 13px; border-radius: 13px; text-align: center;
  font-family: var(--f-display); font-size: 21px; font-weight: 700; color: var(--pink-soft);
  border: 1px dashed rgba(255, 45, 111, 0.6); background: rgba(255, 45, 111, 0.06);
}
.auth-neon .captcha .ctl { background: rgba(0, 0, 0, 0.35); }
.auth-neon .captcha input { text-align: center; font-size: 17px; font-weight: 700; letter-spacing: 3px; }
.auth-neon .captcha input::placeholder { font-size: 13px; font-weight: 500; letter-spacing: 0; }

/* ---------- кодовое слово / промо ---------- */
.auth-neon .promo-toggle {
  background: none; border: 0; padding: 0; color: var(--pink-soft);
  font-weight: 600; font-size: 13px; cursor: pointer; margin: 2px 0 14px;
}
.auth-neon .promo-toggle:hover { text-decoration: underline; text-underline-offset: 4px; }
.auth-neon #promoField[hidden] { display: none; }

/* ---------- согласие ---------- */
.auth-neon .terms {
  display: flex; gap: 12px; align-items: flex-start; margin: 4px 0 18px;
  font-size: 13px; color: var(--mute); cursor: pointer; line-height: 1.5;
}
.auth-neon .terms input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.auth-neon .box {
  width: 22px; height: 22px; flex: none; border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18); background: var(--field);
  display: grid; place-items: center; transition: all .2s; margin-top: 1px;
}
.auth-neon .box svg {
  width: 14px; height: 14px; opacity: 0; transform: scale(0.5);
  transition: all .2s; color: #fff; display: block;
}
.auth-neon .terms input:checked + .box {
  background: linear-gradient(135deg, #ff3d78, #e0124f); border-color: transparent;
  box-shadow: 0 6px 16px -4px rgba(255, 45, 111, 0.7);
}
.auth-neon .terms input:checked + .box svg { opacity: 1; transform: none; }
.auth-neon .terms.err .box { border-color: var(--bad); animation: neonShake .42s; }
.auth-neon .terms a { color: var(--fg); text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.3); text-underline-offset: 3px; }

/* ---------- кнопка ---------- */
.auth-neon .submit {
  position: relative; overflow: hidden; width: 100%; height: 56px; border: 0;
  border-radius: 16px; cursor: pointer;
  background: linear-gradient(135deg, #ff3d78 0%, #e0124f 100%);
  color: #fff; font: 700 16px var(--f-body); letter-spacing: 0.01em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 18px 40px -12px rgba(255, 45, 111, 0.85),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform .2s, box-shadow .2s;
}
.auth-neon .submit::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg);
}
.auth-neon .submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 48px -12px rgba(255, 45, 111, 0.95),
              inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #fff;
}
.auth-neon .submit:hover::after { animation: neonShine .9s ease; }
@keyframes neonShine { to { left: 130%; } }
.auth-neon .submit:active { transform: translateY(0); }
.auth-neon .submit svg { width: 18px; height: 18px; display: block; transition: transform .2s; }
.auth-neon .submit:hover svg { transform: translateX(4px); }
.auth-neon .submit .spin {
  display: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35); border-top-color: #fff;
  animation: neonRot .7s linear infinite;
}
.auth-neon .submit.loading .spin { display: block; }
.auth-neon .submit.loading .arr { display: none; }
.auth-neon .submit.loading { pointer-events: none; filter: saturate(0.85); }
@keyframes neonRot { to { transform: rotate(360deg); } }

/* ---------- подписи под карточкой ---------- */
.auth-neon .foot { margin: 16px 0 0; text-align: center; color: var(--mute); font-size: 13.5px; }
.auth-neon .foot a { color: var(--fg); font-weight: 700; }
.auth-neon .foot a:hover { color: var(--pink-soft); }
.auth-neon .platforms {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  margin-top: 12px; color: var(--dim); font-family: var(--f-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
}
.auth-neon .platforms span { display: inline-flex; align-items: center; gap: 7px; }
.auth-neon .platforms svg { width: 14px; height: 14px; display: block; }

/* ---------- ошибка сервера ---------- */
.auth-neon .form-alert {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 14px; padding: 12px 14px; margin: 0 0 16px;
  background: rgba(255, 84, 112, 0.12); border: 1px solid rgba(255, 84, 112, 0.45);
  color: #ffb3c0; font-size: 13px; line-height: 1.5;
  animation: neonShake .42s cubic-bezier(.36, .07, .19, .97);
}
.auth-neon .form-alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }

.auth-neon .shake { animation: neonShake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes neonShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

@media (max-width: 520px) {
  .auth-neon .card { padding: 22px 16px 20px; border-radius: 22px; }
  .auth-neon h2.title { font-size: 20px; }
  .auth-neon .sub { font-size: 13px; }
  .auth-neon .tool .t { display: none; }
  .auth-neon .tool { padding: 0; width: 36px; justify-content: center; }
  .auth-neon .ctl input { padding: 15px 12px; font-size: 16px; }
  .auth-neon .ctl .ico { margin-left: 13px; }
  .auth-neon .submit { height: 54px; font-size: 15.5px; }
  .auth-neon .cap-chip, .auth-neon .cap-q { min-width: 40px; padding: 7px 10px; font-size: 18px; }
  .auth-neon .cap-op { font-size: 16px; }
  .auth-neon .captcha { padding: 12px; }
  .auth-neon .captcha-ico { width: 40px; height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-neon *, .auth-neon *::before, .auth-neon *::after {
    animation: none !important; transition: none !important;
  }
}
