/* ============================================
   vpnsf.ru — основные стили
   Палитра: #FFFFFF #B9B9B9 #000000 #007CFF
   Шрифт: SF Pro Rounded
   ============================================ */

:root {
  --white: #ffffff;
  --gray: #b9b9b9;
  --black: #000000;
  --blue: #007cff;
  --blue-dark: #0066d6;
  --bg-soft: #f5f6f8;
  --radius: 20px;
  --radius-sm: 14px;
  --max-width: 1160px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
  --shadow-blue: 0 16px 40px rgba(0, 124, 255, 0.28);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  color: var(--black);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  text-decoration: none;
  color: inherit;
}

img,
svg {
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--bg-soft);
  color: var(--black);
}

.btn-ghost:hover {
  background: #ebedf0;
  transform: translateY(-2px);
}

.btn-lg {
  padding: 18px 38px;
  font-size: 18px;
}

/* ---------- Хедер ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Прогрессивный edge-blur: сильный у верха, плавно затухает книзу */
.header__blur {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(100% + 36px);
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.72) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 52%, transparent 100%);
}

/* Второй слой блюра — усиливает прогрессию у верхней кромки */
.header__blur::after {
  content: '';
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 76%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 76%);
}

.header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.logo__mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
}

.logo__mark img,
.logo__mark svg {
  width: 100%;
  height: 100%;
}

.logo b {
  color: var(--blue);
  font-weight: 700;
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.logo__tag {
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--gray);
}

.nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav__links {
  display: flex;
  gap: 30px;
}

.nav__links a {
  font-weight: 500;
  font-size: 16px;
  color: #333;
  transition: color 0.15s ease;
}

.nav__links a:hover {
  color: var(--blue);
}

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--black);
  border-radius: 2px;
  transition: 0.25s ease;
}

/* ---------- Секции ---------- */
.section {
  padding: 100px 0;
}

.section__head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 60px;
}

.eyebrow {
  display: inline-block;
  font-weight: 600;
  font-size: 14px;
  color: var(--blue);
  background: rgba(0, 124, 255, 0.1);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.section__title {
  font-weight: 700;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section__subtitle {
  margin-top: 16px;
  font-size: 18px;
  color: #5a5a5a;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 90px 0 80px;
  overflow: hidden;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 50px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 14px;
  color: #444;
  background: var(--bg-soft);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero__badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #23c16b;
  box-shadow: 0 0 0 4px rgba(35, 193, 107, 0.18);
}

.hero__title {
  font-weight: 700;
  font-size: clamp(38px, 5.4vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero__title .accent {
  color: var(--blue);
}

.hero__text {
  margin-top: 22px;
  font-size: 19px;
  color: #4f4f4f;
  max-width: 480px;
}

.hero__actions {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero__stats {
  margin-top: 46px;
  display: flex;
  gap: 40px;
}

.hero__stat b {
  display: block;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.02em;
}

.hero__stat span {
  font-size: 14px;
  color: var(--gray);
}

.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
}

.hero__glow {
  position: absolute;
  inset: 12%;
  background: radial-gradient(circle, rgba(0, 124, 255, 0.35), transparent 62%);
  filter: blur(30px);
}

.hero__globe {
  position: relative;
  width: 78%;
  max-width: 420px;
  animation: float 6s ease-in-out infinite;
}

.hero__globe img,
.hero__globe svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 30px 50px rgba(0, 124, 255, 0.25));
  overflow: visible;
}

/* Кликабельные сегменты глобуса — «проваливаются» вглубь экрана */
.globe-piece {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.15s ease;
}

.globe-piece:hover {
  opacity: 0.8;
}

/* Плавание глобуса — ровное, без желейного сжатия */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* ---------- Логотипы-полоска ---------- */
.marquee {
  padding: 34px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.marquee__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--gray);
  font-weight: 600;
  font-size: 18px;
}

.marquee__row span {
  opacity: 0.75;
}

/* ---------- Фичи ---------- */
.features__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature {
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.feature__icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(0, 124, 255, 0.1);
  color: var(--blue);
  display: grid;
  place-items: center;
  margin-bottom: 22px;
}

.feature__icon svg {
  width: 28px;
  height: 28px;
}

.feature h3 {
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.feature p {
  font-size: 16px;
  color: #5a5a5a;
}

/* ---------- Тарифы ---------- */
.plans__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.plan {
  position: relative;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: var(--radius);
  padding: 34px 30px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.plan--featured {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.plan__tag {
  position: absolute;
  top: 22px;
  right: 22px;
  font-weight: 600;
  font-size: 12px;
  color: var(--white);
  background: var(--blue);
  padding: 5px 12px;
  border-radius: 999px;
}

.plan__name {
  font-weight: 600;
  font-size: 20px;
}

.plan__desc {
  margin-top: 6px;
  font-size: 15px;
  color: #6a6a6a;
}

.plan--featured .plan__desc {
  color: var(--gray);
}

.plan__price {
  margin: 26px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.plan__price b {
  font-weight: 700;
  font-size: 46px;
  letter-spacing: -0.03em;
}

.plan__price span {
  color: var(--gray);
  font-size: 16px;
}

.plan__note {
  font-size: 14px;
  color: #6a6a6a;
  margin-bottom: 26px;
}

.plan--featured .plan__note {
  color: var(--gray);
}

.plan__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
  flex-grow: 1;
}

.plan__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.plan__list svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--blue);
}

.plan--featured .plan__list svg {
  color: #4da3ff;
}

.plan .btn {
  width: 100%;
}

.plan--featured .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
}

.plan--featured .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Как работает ---------- */
.steps__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  counter-reset: step;
}

.step {
  text-align: left;
}

.step__num {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  font-size: 20px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.step h3 {
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 8px;
}

.step p {
  color: #5a5a5a;
  font-size: 16px;
}

/* ---------- CTA-баннер ---------- */
.cta {
  padding: 80px 0;
}

.cta__box {
  position: relative;
  overflow: hidden;
  background: var(--blue);
  border-radius: 32px;
  padding: 70px 40px;
  text-align: center;
  color: var(--white);
}

.cta__box::before {
  content: '';
  position: absolute;
  width: 480px;
  height: 480px;
  right: -120px;
  top: -180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25), transparent 60%);
}

.cta__box h2 {
  position: relative;
  font-weight: 700;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

.cta__box p {
  position: relative;
  margin: 16px auto 32px;
  max-width: 520px;
  font-size: 18px;
  opacity: 0.9;
}

.cta__box .btn {
  position: relative;
  background: var(--white);
  color: var(--blue);
}

.cta__box .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

/* ---------- FAQ ---------- */
.faq {
  max-width: 780px;
  margin: 0 auto;
}

.faq__item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.faq__q {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 19px;
  color: var(--black);
  text-align: left;
  padding: 26px 40px 26px 0;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq__q::after {
  content: '+';
  font-weight: 500;
  font-size: 28px;
  color: var(--blue);
  transition: transform 0.25s ease;
}

.faq__item.open .faq__q::after {
  transform: rotate(45deg);
}

.faq__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq__a p {
  padding: 0 0 26px;
  color: #5a5a5a;
  font-size: 16px;
}

/* ---------- Футер ---------- */
.footer {
  background: var(--bg-soft);
  padding: 70px 0 34px;
  margin-top: 40px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer__about {
  max-width: 300px;
}

.footer__about p {
  margin-top: 16px;
  color: #6a6a6a;
  font-size: 15px;
}

.footer__col h4 {
  font-weight: 600;
  font-size: 15px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}

.footer__col a {
  display: block;
  color: #333;
  font-size: 16px;
  margin-bottom: 12px;
  transition: color 0.15s ease;
}

.footer__col a:hover {
  color: var(--blue);
}

.footer__bottom {
  margin-top: 50px;
  padding-top: 26px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--gray);
  font-size: 14px;
}

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .section { padding: 72px 0; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { order: -1; max-width: 380px; margin: 0 auto; }
  .features__grid,
  .plans__grid,
  .steps__grid { grid-template-columns: 1fr; }
  .plan--featured { order: -1; }
  .footer__grid { grid-template-columns: 1fr 1fr; }

  .nav__links,
  .nav .btn { display: none; }
  .nav__toggle { display: flex; }

  .nav.open .nav__links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 20px 24px;
    gap: 18px;
    box-shadow: var(--shadow);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
  .nav.open .btn {
    display: inline-flex;
    margin-top: 8px;
  }
}

@media (max-width: 560px) {
  .container { padding: 0 18px; }
  .hero__stats { gap: 26px; }
  .footer__grid { grid-template-columns: 1fr; }
  .cta__box { padding: 50px 24px; }
}

/* ---------- Анимация появления ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .hero__globe { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Тарифы: капсулы + одна карточка ---------- */
.plan-picker {
  max-width: 760px;
  margin: 0 auto;
}

.plan-switch {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.plan-switch__opt {
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  color: var(--black);
  background: var(--white);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.plan-switch__opt:hover {
  transform: translateY(-2px);
  border-color: var(--blue);
}

.plan-switch__opt.is-active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  box-shadow: var(--shadow-blue);
}

/* Центральная «Бесплатно» — выделена синей обводкой всегда */
.plan-switch__opt--free {
  color: var(--blue);
  border-color: var(--blue);
}

.plan-switch__save {
  font-weight: 600;
  font-size: 12px;
  color: var(--blue);
  background: rgba(0, 124, 255, 0.12);
  padding: 2px 9px;
  border-radius: 999px;
}

.plan-switch__opt.is-active .plan-switch__save {
  color: var(--white);
  background: rgba(255, 255, 255, 0.25);
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 124, 255, 0.12);
}

.plan-card__tag {
  position: absolute;
  top: 24px;
  right: 24px;
  font-weight: 600;
  font-size: 12px;
  color: var(--white);
  background: var(--blue);
  padding: 5px 12px;
  border-radius: 999px;
}

.plan-card__tag:empty {
  display: none;
}

.plan-card__name {
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.plan-card__desc {
  margin-top: 6px;
  font-size: 15px;
  color: #6a6a6a;
}

.plan-card__price {
  margin: 24px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.plan-card__price b {
  font-weight: 700;
  font-size: 48px;
  letter-spacing: -0.03em;
}

.plan-card__price span {
  color: var(--gray);
  font-size: 16px;
}

.plan-card__note {
  font-size: 14px;
  color: #6a6a6a;
  margin-bottom: 26px;
}

.plan-card__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.plan-card__list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
}

.plan-card__list svg {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--blue);
}

.plan-card__btn {
  width: 100%;
  margin-top: auto;
}

.plan-card__trial {
  width: 100%;
  margin-top: 12px;
  background: rgba(0, 124, 255, 0.1);
  color: var(--blue);
}

.plan-card__trial:hover {
  background: rgba(0, 124, 255, 0.18);
  transform: translateY(-2px);
}

/* ---------- Тарифы: сетка ---------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.plan-grid .plan-card {
  margin: 0;
  max-width: none;
  border: 2px solid rgba(0, 0, 0, 0.08);
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.plan-grid .plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* Выделение выбранного тарифа — только hover-свечение, без постоянной обводки */

@media (max-width: 920px) {
  .plan-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .plan-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

/* ---------- Эффекты для тарифов: ClickSpark + BorderGlow (порт React Bits) ---------- */
#plans {
  position: relative;
}

/* Канвас с искрами поверх секции, клики пропускает */
.click-spark-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

/* BorderGlow: карточка со свечением у краёв (тарифы и «Возможности») */
.glow-card {
  --edge-proximity: 0;
  --cursor-angle: 45deg;
  --edge-sensitivity: 20;
  --color-sensitivity: 40;
  --cone-spread: 25;
  --glow-padding: 26px;
  position: relative;
  isolation: isolate;
}

/* Цветная градиентная рамка, следующая за курсором (конусная маска) */
.glow-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  z-index: -1;
  border: 2px solid transparent;
  border-radius: calc(var(--radius) + 2px);
  pointer-events: none;
  background:
    linear-gradient(var(--white) 0 100%) padding-box,
    radial-gradient(at 80% 55%, #007cff 0px, transparent 50%) border-box,
    radial-gradient(at 8% 6%, #38bdf8 0px, transparent 50%) border-box,
    radial-gradient(at 41% 38%, #4da3ff 0px, transparent 50%) border-box,
    radial-gradient(at 86% 85%, #38bdf8 0px, transparent 50%) border-box,
    linear-gradient(#007cff 0 100%) border-box;
  mask-image: conic-gradient(
    from var(--cursor-angle) at center,
    black calc(var(--cone-spread) * 1%),
    transparent calc((var(--cone-spread) + 15) * 1%),
    transparent calc((100 - var(--cone-spread) - 15) * 1%),
    black calc((100 - var(--cone-spread)) * 1%)
  );
  -webkit-mask-image: conic-gradient(
    from var(--cursor-angle) at center,
    black calc(var(--cone-spread) * 1%),
    transparent calc((var(--cone-spread) + 15) * 1%),
    transparent calc((100 - var(--cone-spread) - 15) * 1%),
    black calc((100 - var(--cone-spread)) * 1%)
  );
  opacity: calc((var(--edge-proximity) - var(--color-sensitivity)) / (100 - var(--color-sensitivity)));
  transition: opacity 0.25s ease-out;
}

/* Внешнее мягкое свечение за пределами карточки */
.glow-card > .edge-light {
  position: absolute;
  inset: calc(var(--glow-padding) * -1);
  z-index: 1;
  border-radius: var(--radius);
  pointer-events: none;
  mask-image: conic-gradient(
    from var(--cursor-angle) at center,
    black 2.5%, transparent 10%, transparent 90%, black 97.5%
  );
  -webkit-mask-image: conic-gradient(
    from var(--cursor-angle) at center,
    black 2.5%, transparent 10%, transparent 90%, black 97.5%
  );
  opacity: calc((var(--edge-proximity) - var(--edge-sensitivity)) / (100 - var(--edge-sensitivity)));
  transition: opacity 0.25s ease-out;
}

.glow-card > .edge-light::before {
  content: '';
  position: absolute;
  inset: var(--glow-padding);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 1px hsl(210deg 100% 55% / 80%),
    inset 0 0 3px 0 hsl(210deg 100% 55% / 50%),
    inset 0 0 6px 0 hsl(210deg 100% 55% / 40%),
    inset 0 0 15px 0 hsl(210deg 100% 55% / 30%),
    inset 0 0 25px 2px hsl(210deg 100% 55% / 20%),
    0 0 3px 0 hsl(210deg 100% 55% / 50%),
    0 0 6px 0 hsl(210deg 100% 55% / 40%),
    0 0 15px 0 hsl(210deg 100% 55% / 30%),
    0 0 25px 2px hsl(210deg 100% 55% / 22%),
    0 0 50px 2px hsl(210deg 100% 55% / 14%);
}

/* Вне наведения свечение плавно гаснет */
.glow-card:not(:hover)::before,
.glow-card:not(:hover) > .edge-light {
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
}

/* ---------- Dither: дизеринг-волны в hero (порт React Bits) ---------- */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__bg canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Белая вуаль для читаемости текста поверх волн */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.72) 46%, rgba(255, 255, 255, 0.28) 100%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 26%);
}

.hero__grid {
  position: relative;
  z-index: 1;
}

/* ---------- Шаг 2: список приложений ---------- */
.step__apps {
  font-size: 16px;
  color: #5a5a5a;
}

.step__platform {
  font-weight: 600;
  color: var(--black);
  margin-top: 12px;
}

.step__platform:first-child {
  margin-top: 0;
}

.step__apps ul {
  list-style: none;
  margin: 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step__apps a {
  color: var(--blue);
  font-weight: 600;
  white-space: nowrap;
}

.step__apps a:hover {
  text-decoration: underline;
}

.step__link {
  display: inline-block;
  margin-top: 14px;
  color: var(--blue);
  font-weight: 600;
}

.step__link:hover {
  text-decoration: underline;
}

/* ---------- PixelCard: пиксельный эффект при выборе тарифа ---------- */
.plan-card .pixel-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  border-radius: inherit;
}

/* ---------- Страница оплаты ---------- */
.pay {
  padding: 70px 0 110px;
  min-height: 60vh;
}

.pay__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 28px;
  max-width: 900px;
  margin: 36px 0 0;
  align-items: start;
}

.pay-card {
  background: var(--white);
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius);
  padding: 30px;
}

.pay-card--summary {
  border-color: var(--blue);
  box-shadow: 0 20px 50px rgba(0, 124, 255, 0.12);
}

.pay-card h3 {
  font-weight: 600;
  font-size: 19px;
  margin-bottom: 16px;
}

.pay-plan__name {
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.pay-plan__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 14px 0 4px;
}

.pay-plan__price b {
  font-weight: 700;
  font-size: 44px;
  letter-spacing: -0.03em;
}

.pay-plan__price span {
  color: var(--gray);
  font-size: 16px;
}

.pay-plan__note {
  color: #6a6a6a;
  font-size: 14px;
  margin-bottom: 8px;
}

.pay-includes {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid rgba(0, 0, 0, 0.06);
}

.pay-includes h4 {
  font-weight: 600;
  font-size: 15px;
  color: var(--gray);
  margin-bottom: 14px;
}

.pay-includes ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pay-includes li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pay-includes__icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: rgba(0, 124, 255, 0.08);
  border-radius: 12px;
}

.pay-includes__icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.pay-includes li b {
  display: block;
  font-weight: 600;
  font-size: 15px;
}

.pay-includes li small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: #6a6a6a;
}

.pay-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.pay-method {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pay-method:hover {
  border-color: var(--blue);
}

.pay-method input {
  accent-color: var(--blue);
  width: 18px;
  height: 18px;
}

.pay-method__icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.pay-method:has(input:checked) {
  border-color: var(--blue);
  background: rgba(0, 124, 255, 0.06);
}

.pay-submit {
  width: 100%;
}

/* Атрибут hidden должен побеждать любые наши display-правила */
[hidden] {
  display: none !important;
}

/* Страница успеха занимает одну колонку вместо сетки с карточкой тарифа */
.pay__grid--single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 560px;
}

/* Поздравление с анимированной галочкой */
.success-head {
  text-align: center;
  padding: 6px 0 22px;
}

.success-check {
  width: 72px;
  height: 72px;
  display: block;
  margin: 0 auto 14px;
}

.success-check__circle {
  fill: var(--blue);
  transform-origin: center;
  animation: checkPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.success-check__mark {
  stroke: #fff;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  animation: checkDraw 0.4s ease-out 0.35s forwards;
}

.success-head__title {
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.02em;
  animation: successFade 0.5s ease-out 0.25s both;
}

.success-head__sub {
  margin-top: 4px;
  font-size: 15px;
  color: #6a6a6a;
  animation: successFade 0.5s ease-out 0.4s both;
}

@keyframes checkPop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes successFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .success-check__circle,
  .success-check__mark,
  .success-head__title,
  .success-head__sub {
    animation: none;
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

.free-step {
  margin-bottom: 28px;
}

.free-step__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 14px;
  line-height: 1.3;
}

.free-step__num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}

.store-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.store-link {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--black);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.store-link:hover {
  border-color: var(--blue);
}

.store-link .platform-ico {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.platform-btn .platform-ico {
  width: 18px;
  height: 18px;
  object-fit: contain;
  margin-right: 8px;
  filter: brightness(0) invert(1); /* чёрные логотипы -> белые на синей кнопке */
}

/* Логотип macOS — широкая надпись, при обычном размере выглядит крошечной */
.store-link .platform-ico--wide {
  width: 28px;
  height: 28px;
}

.platform-btn .platform-ico--wide {
  width: 32px;
  height: 32px;
}

.tg-btn {
  width: 100%;
  text-align: center;
  justify-content: center;
}

#freeResult {
  margin-top: 4px;
}

.free-alt {
  margin: 4px 0 10px;
  border: 2px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.free-alt summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
}

.free-alt__body {
  margin-top: 10px;
  color: #4a4a4a;
}

.free-alt__body ul {
  margin: 8px 0 8px 18px;
}

.free-alt__body li {
  margin-bottom: 6px;
}

.free-alt__body a {
  color: var(--blue);
}

.copy-btn {
  border: none;
  background: rgba(0, 124, 255, 0.1);
  color: var(--blue);
  font-weight: 600;
  font-size: 12px;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}

.pay-captcha {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  min-height: 65px;
}

.pay-captcha[hidden] {
  display: none;
}

.platform-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

.platform-btn {
  width: 100%;
  text-align: center;
}

.free-result__hint {
  font-size: 14px;
  color: #6a6a6a;
  margin: 0 0 12px;
}

.free-result__sub {
  margin-top: 14px;
  font-size: 13px;
  color: #6a6a6a;
  word-break: break-all;
}

.free-result__sub a {
  color: var(--blue);
}

.pay-note {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--blue);
  background: rgba(0, 124, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
}

.pay-note[hidden] {
  display: none;
}

@media (max-width: 760px) {
  .pay__grid { grid-template-columns: minmax(0, 1fr); }
}

/* При оплате контент карточки растворяется, остаются только пиксели */
.plan-card > *:not(.pixel-fx) {
  transition: opacity 0.3s ease;
}

.plan-card.is-paying > *:not(.pixel-fx) {
  opacity: 0;
}

/* ---------- Плавный переход между страницами ---------- */
.page-veil {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--white);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.page-veil.is-active {
  opacity: 1;
}

/* Страница оплаты плавно проявляется */
.page-fade-in {
  animation: pageIn 0.375s ease both;
}

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .page-fade-in { animation: none; }
}

/* ---------- Желейный логотип ---------- */
.logo__mark img {
  transform-origin: 50% 100%;
}

.logo:hover .logo__mark img {
  animation: jelly 0.7s ease;
}

@keyframes jelly {
  0% { transform: scale(1, 1); }
  22% { transform: scale(1.25, 0.72); }
  40% { transform: scale(0.78, 1.22); }
  56% { transform: scale(1.14, 0.86); }
  70% { transform: scale(0.94, 1.06); }
  84% { transform: scale(1.04, 0.96); }
  100% { transform: scale(1, 1); }
}

@media (prefers-reduced-motion: reduce) {
  .logo:hover .logo__mark img { animation: none; }
}

/* ---------- Legal pages (privacy.html / terms.html) ---------- */
.legal {
  padding: 70px 0 110px;
  min-height: 60vh;
}

.legal .section__title {
  max-width: 760px;
}

.legal__updated {
  margin-top: 16px;
  font-size: 15px;
  color: var(--gray);
}

.legal__body {
  max-width: 760px;
  margin-top: 36px;
}

.legal__body h2 {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin: 36px 0 10px;
}

.legal__body h2:first-child {
  margin-top: 0;
}

.legal__body p {
  font-size: 16px;
  line-height: 1.65;
  color: #5a5a5a;
}

.legal__body p + p {
  margin-top: 10px;
}

.legal__body ul {
  margin: 10px 0 0 22px;
  font-size: 16px;
  line-height: 1.65;
  color: #5a5a5a;
}

.legal__body li + li {
  margin-top: 6px;
}

.legal__body b {
  color: var(--black);
}

.legal__body a {
  color: var(--blue);
  font-weight: 600;
}

.legal__body a:hover {
  text-decoration: underline;
}

/* ---------- Чат поддержки (js/chat.js) ---------- */
.chatw {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  font-family: inherit;
}

.chatw__fab {
  position: relative;
  width: 62px;
  height: 62px;
  border: none;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 124, 255, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  margin-left: auto;
}

.chatw__fab:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 14px 34px rgba(0, 124, 255, 0.52);
}

.chatw__fab:active {
  transform: scale(0.93);
}

.chatw__ico {
  position: absolute;
  transition: opacity 0.18s ease, transform 0.26s ease;
}

.chatw__ico--close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.chatw__fab.is-open .chatw__ico--chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.chatw__fab.is-open .chatw__ico--close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.chatw__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  box-shadow: 0 2px 8px rgba(255, 59, 48, 0.5);
}

.chatw__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: 384px;
  height: min(600px, calc(100vh - 140px));
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  transform-origin: bottom right;
  animation: chatwPop 0.3s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes chatwPop {
  from { opacity: 0; transform: translateY(16px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chatw__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(135deg, #2b97ff 0%, var(--blue) 55%, #0064cf 100%);
  color: var(--white);
}

.chatw__avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.chatw__headtext {
  flex: 1;
  min-width: 0;
}

.chatw__headtext b {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chatw__headtext small {
  display: flex;
  align-items: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  margin-top: 2px;
}

.chatw__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34e37a;
  box-shadow: 0 0 0 3px rgba(52, 227, 122, 0.25);
  display: inline-block;
  margin-right: 7px;
  flex-shrink: 0;
}

.chatw__close {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.chatw__close:hover {
  background: rgba(255, 255, 255, 0.32);
}

.chatw__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #fafbfd;
  scroll-behavior: smooth;
}

.chatw__row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.chatw__row--me {
  justify-content: flex-end;
}

.chatw__mini {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 20px;
}

.chatw__col {
  max-width: 78%;
  display: flex;
  flex-direction: column;
}

.chatw__row--me .chatw__col {
  align-items: flex-end;
}

.chatw__msg {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  animation: chatwMsg 0.22s ease;
}

@keyframes chatwMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chatw__msg--me {
  background: linear-gradient(135deg, #1a8dff, var(--blue));
  color: var(--white);
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px rgba(0, 124, 255, 0.25);
}

.chatw__msg--op {
  background: var(--white);
  color: var(--black);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.chatw__msg--err {
  opacity: 0.55;
  outline: 1.5px dashed #ff3b30;
  cursor: pointer;
}

.chatw__time {
  font-size: 11px;
  color: #a7adb8;
  margin: 3px 6px 8px;
}

.chatw__form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--white);
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.chatw__input {
  flex: 1;
  border: none;
  outline: none;
  background: #f2f4f8;
  border-radius: 999px;
  padding: 12px 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--black);
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.chatw__input:focus {
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(0, 124, 255, 0.35);
}

.chatw__send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #e3e7ee;
  color: #9aa3b0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.chatw__send.is-ready {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 6px 16px rgba(0, 124, 255, 0.35);
}

.chatw__send.is-ready:hover {
  background: var(--blue-dark);
  transform: scale(1.07);
}

.chatw__send:active {
  transform: scale(0.92);
}

/* Планшеты и узкие окна: панель не шире экрана */
.chatw__panel {
  max-width: calc(100vw - 28px);
}

@media (max-width: 480px) {
  .chatw {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  /* На телефонах чат раскрывается на весь экран: удобнее печатать,
     а dvh-высота корректно сжимается под клавиатурой iOS/Android */
  .chatw__panel {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    transform-origin: bottom center;
  }

  .chatw__head {
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
  }

  .chatw__form {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  /* минимум 16px — иначе iOS Safari зумит страницу при фокусе на поле */
  .chatw__input {
    font-size: 16px;
  }

  /* страница под открытым чатом не прокручивается */
  body:has(.chatw__panel:not([hidden])) {
    overflow: hidden;
  }

  /* FAB перекрывал кнопку отправки — в полноэкранном чате закрытие через крестик в шапке */
  .chatw__fab.is-open {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatw__panel,
  .chatw__msg {
    animation: none;
  }
}

/* ---------- Переключатели языка и темы (правый низ футера) ---------- */
.footer__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang { position: relative; }

.lang__current {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.lang__current:hover { border-color: var(--blue); transform: scale(1.08); }

.lang__current img,
.lang__item img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: block;
}

.lang__menu {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0; /* меню открывается ВВЕРХ — переключатель живёт в футере */
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 170px;
  padding: 6px;
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 60;
}
.lang.open .lang__menu { display: flex; }

.lang__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  color: var(--black);
  text-align: left;
  transition: background 0.15s ease;
}
.lang__item:hover { background: var(--bg-soft); }
.lang__item.is-active { color: var(--blue); font-weight: 700; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--black);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.theme-toggle:hover { border-color: var(--blue); transform: scale(1.08); }
.theme-toggle svg { width: 20px; height: 20px; display: block; }

/* ---------- Тёмная тема ----------
   Включается html[data-theme="dark"] (ставится инлайн-скриптом в <head>).
   Основное — инверсия переменных; ниже точечные фиксы мест
   с жёстко прописанными светлыми цветами. */
:root { color-scheme: light; }

[data-theme='dark'] {
  color-scheme: dark;
  --white: #14161c;
  --black: #f2f4f8;
  --gray: #8a919e;
  --bg-soft: #1c1f27;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --shadow-blue: 0 16px 40px rgba(0, 124, 255, 0.22);
}

/* белый текст на синем задан через var(--white) — в тёмной теме он обязан остаться белым */
[data-theme='dark'] .btn-primary,
[data-theme='dark'] .plan--featured,
[data-theme='dark'] .plan__tag,
[data-theme='dark'] .plan--featured .btn-ghost,
[data-theme='dark'] .step__num,
[data-theme='dark'] .cta__box,
[data-theme='dark'] .plan-switch__opt.is-active,
[data-theme='dark'] .plan-switch__opt.is-active .plan-switch__save,
[data-theme='dark'] .plan-card__tag,
[data-theme='dark'] .chatw__fab,
[data-theme='dark'] .chatw__head,
[data-theme='dark'] .chatw__close,
[data-theme='dark'] .chatw__msg--me,
[data-theme='dark'] .chatw__send.is-ready {
  color: #fff;
}

[data-theme='dark'] .cta__box .btn { background: #fff; }
[data-theme='dark'] .chatw__avatar { background: #fff; }

/* хедер: блюр-градиент был белым */
[data-theme='dark'] .header__blur {
  background: linear-gradient(
    to bottom,
    rgba(20, 22, 28, 0.92) 0%,
    rgba(20, 22, 28, 0.72) 55%,
    rgba(20, 22, 28, 0) 100%
  );
}

/* hero: вуаль поверх WebGL-волн была белой */
[data-theme='dark'] .hero__bg::after {
  background:
    linear-gradient(to right, rgba(20, 22, 28, 0.94) 0%, rgba(20, 22, 28, 0.72) 46%, rgba(20, 22, 28, 0.28) 100%),
    linear-gradient(to bottom, rgba(20, 22, 28, 0.85) 0%, rgba(20, 22, 28, 0) 26%);
}

/* серые тексты, прописанные жёстко под светлый фон */
[data-theme='dark'] .nav__links a,
[data-theme='dark'] .footer__col a {
  color: #c8cdd6;
}

[data-theme='dark'] .hero__badge,
[data-theme='dark'] .hero__text,
[data-theme='dark'] .section__subtitle,
[data-theme='dark'] .feature p,
[data-theme='dark'] .step p,
[data-theme='dark'] .step__apps,
[data-theme='dark'] .faq__a p,
[data-theme='dark'] .legal__body p,
[data-theme='dark'] .legal__body ul {
  color: #a3aab6;
}

[data-theme='dark'] .plan__desc,
[data-theme='dark'] .plan__note,
[data-theme='dark'] .plan-card__desc,
[data-theme='dark'] .plan-card__note,
[data-theme='dark'] .pay-includes li small,
[data-theme='dark'] .free-result__hint,
[data-theme='dark'] .free-result__sub {
  color: #8a919e;
}

/* светлые рамки на тёмном фоне */
[data-theme='dark'] .hero__badge { border-color: rgba(255, 255, 255, 0.06); }
[data-theme='dark'] .marquee { border-color: rgba(255, 255, 255, 0.08); }
[data-theme='dark'] .feature { border-color: rgba(255, 255, 255, 0.08); }
[data-theme='dark'] .plan { border-color: rgba(255, 255, 255, 0.1); }
[data-theme='dark'] .plan-grid .plan-card { border-color: rgba(255, 255, 255, 0.1); }
[data-theme='dark'] .plan-switch__opt { border-color: rgba(255, 255, 255, 0.12); }
[data-theme='dark'] .faq__item { border-color: rgba(255, 255, 255, 0.12); }
[data-theme='dark'] .footer__bottom { border-color: rgba(255, 255, 255, 0.1); }
[data-theme='dark'] .nav.open .nav__links { border-color: rgba(255, 255, 255, 0.08); }
[data-theme='dark'] .lang__menu { border-color: rgba(255, 255, 255, 0.1); }
[data-theme='dark'] .pay-card:not(.pay-card--summary) { border-color: rgba(255, 255, 255, 0.1); }
[data-theme='dark'] .pay-includes { border-color: rgba(255, 255, 255, 0.1); }
[data-theme='dark'] .pay-method:not(:has(input:checked)) { border-color: rgba(255, 255, 255, 0.12); }
[data-theme='dark'] .store-link { border-color: rgba(255, 255, 255, 0.12); }
[data-theme='dark'] .free-alt { border-color: rgba(255, 255, 255, 0.1); }

/* чат поддержки */
[data-theme='dark'] .chatw__body { background: #181b22; }
[data-theme='dark'] .chatw__mini,
[data-theme='dark'] .chatw__msg--op,
[data-theme='dark'] .chatw__form {
  border-color: rgba(255, 255, 255, 0.1);
}

/* ---------- Адаптив: полировка под все устройства ---------- */
@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero__grid { gap: 32px; }
  .steps__grid { gap: 28px; }
  .cta { padding: 56px 0; }
}

@media (max-width: 560px) {
  .section { padding: 56px 0; }
  .hero { padding: 32px 0 52px; }
  .hero__visual { max-width: 290px; }
  .hero__text { font-size: 17px; }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero__stats {
    flex-wrap: wrap;
    gap: 18px 30px;
    margin-top: 34px;
  }
  .hero__stat b { font-size: 26px; }

  .marquee { padding: 24px 0; }
  .marquee__row {
    justify-content: center;
    gap: 12px 20px;
    font-size: 15px;
  }

  .feature { padding: 24px 20px; }
  .plan-grid .plan-card { padding: 28px 22px; }

  .cta__box { border-radius: 24px; }

  .footer__grid { gap: 28px; }
  .footer__bottom {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
  }
}

/* совсем узкие экраны (старые/маленькие смартфоны) */
@media (max-width: 380px) {
  .container { padding: 0 14px; }
  .logo__tag { display: none; }
  .hero__stats { gap: 14px 22px; }
  .step h3 { font-size: 18px; }
}

/* ---------- Пробный доступ: таймер и экран продления ---------- */
.free-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px auto 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(0, 124, 255, 0.08);
  color: var(--blue);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

[data-theme='dark'] .free-timer {
  background: rgba(0, 124, 255, 0.18);
}

.free-expired {
  text-align: center;
  padding: 10px 0 4px;
}

.free-expired__ico {
  font-size: 46px;
  line-height: 1;
  margin-bottom: 14px;
}

.free-expired__title {
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.free-expired__text {
  color: #6a6a6a;
  margin-bottom: 20px;
}

[data-theme='dark'] .free-expired__text {
  color: #8a919e;
}

.renew-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.renew-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 10px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

[data-theme='dark'] .renew-opt {
  border-color: rgba(255, 255, 255, 0.12);
}

.renew-opt:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
}

.renew-opt b {
  font-weight: 700;
  font-size: 17px;
}

.renew-opt span {
  font-size: 14px;
  color: var(--gray);
}

.renew-opt--hit {
  border-color: var(--blue);
}

.renew-opt--hit i {
  position: absolute;
  top: -10px;
  right: 10px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  padding: 2px 10px;
  border-radius: 999px;
}

@media (max-width: 380px) {
  .renew-grid { grid-template-columns: 1fr; }
}

/* ---------- Пробный доступ: контент по центру страницы ---------- */
.pay--free .section__title {
  text-align: center;
}

.pay--free .pay__grid {
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Ссылка-подписка: аккуратная карточка с кнопкой копирования ---------- */
.sub-link {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.sub-link__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 8px;
}

.sub-link__row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.sub-link__url {
  flex: 1;
  min-width: 0;
  display: block; /* не flex: text-overflow работает только на блоке */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  background: var(--white);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}

.sub-link__url:hover {
  border-color: var(--blue);
}

[data-theme='dark'] .sub-link__url {
  border-color: rgba(255, 255, 255, 0.1);
}

.sub-link__copy {
  position: relative;
  flex-shrink: 0;
  align-self: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.sub-link__copy:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.sub-link__copy:active {
  transform: scale(0.96);
}

.sub-link__copy.is-copied {
  background: #23c16b;
}

/* обе иконки лежат по центру одна поверх другой; активная видна, вторая — сжата */
.sub-link__copy svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 17px;
  height: 17px;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sub-link__copy .sub-link__copy-ico {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.sub-link__copy .sub-link__check-ico {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3) rotate(-90deg);
}

.sub-link__copy.is-copied .sub-link__copy-ico {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3) rotate(90deg);
}

.sub-link__copy.is-copied .sub-link__check-ico {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

/* галочка «дорисовывается» штрихом */
.sub-link__check-ico path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
}

.sub-link__copy.is-copied .sub-link__check-ico path {
  animation: sub-check-draw 0.35s ease 0.1s forwards;
}

@keyframes sub-check-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* на узких экранах кнопка встаёт под ссылку на всю ширину */
@media (max-width: 480px) {
  .sub-link__row {
    flex-direction: column;
  }

}

/* ---------- Ключ доступа (карточка на успехе + в ЛК) ---------- */
.sub-link--key {
  border: 1px solid rgba(0, 124, 255, 0.25);
  background: rgba(0, 124, 255, 0.06);
}

.sub-link__url--key {
  font-size: 17px;
  letter-spacing: 1px;
  text-align: center;
  color: var(--black);
  cursor: text;
  user-select: all; /* тап по ключу выделяет его целиком */
}

.sub-link__hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--gray);
}

.sub-link__hint a {
  color: var(--blue);
  font-weight: 600;
}

/* ---------- Личный кабинет (lk.html) ---------- */
.lk-hint {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 14px;
}

.lk-form {
  display: flex;
  gap: 10px;
}

.lk-input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;
  background: var(--white);
  color: var(--black);
  outline: none;
  transition: border-color 0.15s ease;
}

.lk-input:focus {
  border-color: var(--blue);
}

[data-theme='dark'] .lk-input {
  border-color: rgba(255, 255, 255, 0.15);
}

.lk-forgot {
  display: block;
  margin-top: 14px;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lk-linklike {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lk-status {
  display: inline-block;
  font-weight: 700;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.lk-status--active {
  background: rgba(35, 193, 107, 0.12);
  color: #189a54;
}

.lk-status--expired {
  background: rgba(0, 0, 0, 0.06);
  color: var(--gray);
}

.lk-status--blocked {
  background: rgba(255, 59, 48, 0.1);
  color: #d92d20;
}

.lk-remember {
  margin-top: 14px;
  font-size: 14px;
}

.lk-logout {
  color: var(--gray);
  margin-top: 18px;
}

@media (max-width: 480px) {
  .lk-form {
    flex-direction: column;
  }
}

/* ---------- Модалка «Сохраните ключ доступа» (после выдачи пробного ключа) ---------- */
.keymodal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.keymodal.is-open {
  opacity: 1;
}

.keymodal__card {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  transform: translateY(24px) scale(0.96);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.keymodal.is-open .keymodal__card {
  transform: none;
}

.keymodal__title {
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  color: var(--gray);
  margin-bottom: 14px;
}

.keymodal__key {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
  padding: 14px 12px;
  background: var(--bg-soft);
  border-radius: 14px;
  user-select: all; /* тап — выделяется целиком */
  word-break: break-all;
}

.keymodal__sub {
  font-size: 14px;
  color: var(--gray);
  text-align: center;
  margin-top: 12px;
}

.keymodal__btns {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.keymodal__btn {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 124, 255, 0.08);
  color: var(--blue);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.keymodal__btn:hover {
  background: rgba(0, 124, 255, 0.14);
}

.keymodal__btn:active {
  transform: scale(0.97);
}

.keymodal__btn.is-done {
  background: rgba(35, 193, 107, 0.12);
  color: #189a54;
}

.keymodal__info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(0, 124, 255, 0.06);
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.keymodal__info a {
  color: var(--blue);
  font-weight: 600;
}

.keymodal__info-ico {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  color: var(--blue);
}

.keymodal__confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.keymodal__confirm input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.keymodal__box {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #c9c9c9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.keymodal__box::after {
  content: '✓';
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.keymodal__confirm input:checked + .keymodal__box {
  background: var(--blue);
  border-color: var(--blue);
}

.keymodal__confirm input:checked + .keymodal__box::after {
  transform: scale(1);
}

.keymodal__go {
  width: 100%;
  margin-top: 16px;
}

.keymodal__go:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

[data-theme='dark'] .keymodal__box {
  border-color: rgba(255, 255, 255, 0.3);
}

/* на телефоне — шторка снизу, как нативная */
@media (max-width: 560px) {
  .keymodal {
    align-items: flex-end;
    padding: 0;
  }

  .keymodal__card {
    max-width: none;
    border-radius: 24px 24px 0 0;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .keymodal,
  .keymodal__card,
  .keymodal__box::after {
    transition: none;
  }
}

/* ---------- Плашка-отсчёт активной подписки (левый нижний угол) ---------- */
.sub-badge {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--white);
  color: var(--black);
  border: 2px solid rgba(0, 124, 255, 0.35);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

.sub-badge b {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.sub-badge:hover {
  border-color: var(--blue);
}

@media (max-width: 480px) {
  .sub-badge {
    left: 12px;
    bottom: 12px;
    padding: 8px 13px;
    font-size: 13px;
  }
}
