:root {
  --bg: #050508;
  --bg-elevated: rgba(14, 10, 24, 0.72);
  --purple: #a855f7;
  --purple-mid: #8b5cf6;
  --purple-dark: #6d28d9;
  --purple-glow: rgba(168, 85, 247, 0.45);
  --text: #f8f6fc;
  --muted: #9d94b0;
  --border: rgba(168, 85, 247, 0.22);
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --radius: 18px;
  --font: 'Inter', system-ui, sans-serif;
  --glass: rgba(18, 12, 32, 0.55);
  --glass-border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.glass {
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
}

/* Background */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 75% 15%, rgba(109, 40, 217, 0.35), transparent 60%),
    radial-gradient(ellipse 45% 35% at 15% 75%, rgba(139, 92, 246, 0.15), transparent 55%),
    var(--bg);
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.bg-orb--1 {
  width: 420px;
  height: 420px;
  top: -80px;
  right: -60px;
  background: rgba(124, 58, 237, 0.28);
}

.bg-orb--2 {
  width: 320px;
  height: 320px;
  bottom: 10%;
  left: -80px;
  background: rgba(168, 85, 247, 0.15);
}

main,
.header,
.footer {
  position: relative;
  z-index: 1;
}

/* Typography */
.h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.h2 {
  margin: 0 0 14px;
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
}

.section-title-sm {
  margin: 0 0 16px;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
  max-width: 540px;
}

.chip {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid var(--border);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 5, 8, 0.78);
  backdrop-filter: blur(20px);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.08rem;
}

.nav {
  display: flex;
  gap: 30px;
}

.nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.link-login {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.link-login:hover {
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 14px;
  padding: 13px 24px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  transform: translateY(-2px);
}

.btn--sm {
  padding: 10px 20px;
  font-size: 0.86rem;
  border-radius: 12px;
}

.btn--lg {
  padding: 15px 28px;
  font-size: 1rem;
}

.btn--wide {
  width: 100%;
}

.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, #b44aff 0%, #7c3aed 55%, #6d28d9 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 8px 32px var(--purple-glow);
}

.btn--primary:not(:disabled):hover {
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 12px 40px rgba(168, 85, 247, 0.55);
}

.btn--outline {
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.btn--ghost {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.win-icon {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Purchase top */
.purchase-top {
  padding: 40px 0 56px;
}

.purchase-top__head {
  text-align: center;
  margin-bottom: 36px;
}

.purchase-top__head .lead {
  margin: 0 auto;
}

.purchase-card {
  border-radius: 24px;
  padding: 32px;
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.12),
    0 32px 80px rgba(0, 0, 0, 0.45);
}

.purchase-card__bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.step {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s;
}

.step.active {
  color: #fff;
  background: rgba(168, 85, 247, 0.28);
  border-color: var(--purple-mid);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.2);
}

.step.done {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.35);
}

/* Plan cards (tariffs) */
.tariff-grid--plans {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 22px;
  border-radius: 20px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.plan-card:hover {
  transform: translateY(-4px);
}

.plan-card.selected {
  border-color: var(--purple-mid);
  box-shadow: 0 0 0 1px var(--purple-mid), 0 20px 50px rgba(168, 85, 247, 0.25);
}

.plan-card--featured {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, 0.35),
    0 24px 60px rgba(168, 85, 247, 0.22);
  transform: scale(1.03);
}

.plan-card--featured:hover {
  transform: scale(1.03) translateY(-4px);
}

.plan-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.plan-name {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 700;
}

.plan-price {
  margin-bottom: 18px;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.plan-period {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}

.plan-features {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  flex: 1;
}

.plan-features li {
  position: relative;
  padding: 7px 0 7px 22px;
  font-size: 0.88rem;
  color: var(--muted);
}

.plan-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--purple-mid);
  font-weight: 700;
}

.plan-card .period-list {
  margin-bottom: 14px;
}

.plan-select {
  margin-top: auto;
}

/* Hero */
.hero {
  padding: 24px 0 88px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}

.hero__title {
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0 28px;
}

.hero__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.pill__ico {
  font-size: 1rem;
}

.hero__mock {
  position: relative;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.mock-ring {
  position: absolute;
  width: 88%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(168, 85, 247, 0.35);
  box-shadow:
    0 0 80px rgba(168, 85, 247, 0.25),
    inset 0 0 50px rgba(168, 85, 247, 0.08);
  animation: ring-pulse 4s ease-in-out infinite;
}

@keyframes ring-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

/* App preview mockups */
.app-preview {
  position: relative;
  width: 100%;
  max-width: 320px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
}

.app-preview--hero {
  max-width: 300px;
}

.app-preview--servers {
  max-width: 360px;
  margin-left: auto;
}

.app-preview--download {
  max-width: 280px;
}

.app-preview__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-preview__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}

.app-preview__title {
  margin-left: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.app-preview__body {
  padding: 36px 24px 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(20, 14, 34, 0.9), rgba(10, 8, 18, 0.95));
}

.connect-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(168, 85, 247, 0.4);
  display: grid;
  place-items: center;
  box-shadow: 0 0 40px rgba(168, 85, 247, 0.2);
}

.connect-ring--on {
  border-color: rgba(34, 197, 94, 0.6);
  box-shadow: 0 0 50px rgba(34, 197, 94, 0.25);
}

.connect-ring__inner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
}

.connect-ring--on .connect-ring__inner {
  background: rgba(34, 197, 94, 0.12);
}

.connect-status {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.connect-status--on {
  color: var(--green);
  font-weight: 600;
}

.app-preview__nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px 8px 12px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.62rem;
  text-align: center;
  color: var(--muted);
}

.app-preview__nav .active {
  color: var(--purple-mid);
  font-weight: 600;
}

.server-preview-list {
  padding: 12px;
  display: grid;
  gap: 8px;
  background: linear-gradient(180deg, rgba(20, 14, 34, 0.9), rgba(10, 8, 18, 0.95));
}

.server-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.server-preview-item--active {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.1);
}

/* Sections */
.section {
  padding: 80px 0;
}

.section--dark {
  background: rgba(0, 0, 0, 0.22);
}

.section__head {
  margin-bottom: 44px;
}

.section__head--center {
  text-align: center;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feat-card {
  padding: 26px 22px;
  border-radius: var(--radius);
  transition: border-color 0.2s, transform 0.2s;
}

.feat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border);
}

.feat-card__ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.16);
  font-size: 1.3rem;
  margin-bottom: 18px;
}

.feat-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
}

.feat-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Servers */
.servers__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.server-list {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.95rem;
}

.flag {
  width: 36px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(168, 85, 247, 0.2);
  font-size: 0.68rem;
  font-weight: 800;
  color: #d8b4fe;
  flex-shrink: 0;
}

.ping {
  margin-left: auto;
  font-size: 0.85rem;
  font-weight: 600;
}

.ping--ok {
  color: var(--green);
}
.ping--warn {
  color: var(--yellow);
}
.ping--bad {
  color: var(--red);
}

/* Download */
.download {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}

.download-meta {
  margin-top: 14px;
}

.download__visual {
  display: flex;
  justify-content: center;
}

/* Steps grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.step-card {
  padding: 28px 22px;
  border-radius: var(--radius);
  text-align: center;
  transition: transform 0.2s;
}

.step-card:hover {
  transform: translateY(-3px);
}

.step-card__n {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--purple-mid);
  opacity: 0.55;
  margin-bottom: 10px;
}

.step-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.step-card p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Footer */
.footer {
  padding: 44px 0 52px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer__links {
  display: flex;
  gap: 22px;
}

.footer__links a {
  color: var(--muted);
  font-size: 0.9rem;
}

.footer__links a:hover {
  color: var(--text);
}

/* Auth & purchase internals */
.auth-tabs,
.auth-email-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab,
.auth-subtab {
  flex: 1;
  padding: 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active,
.auth-subtab.active {
  border-color: var(--purple-mid);
  background: rgba(168, 85, 247, 0.22);
}

.auth-form {
  display: grid;
  gap: 14px;
  max-width: 420px;
}

.field {
  display: grid;
  gap: 6px;
  text-align: left;
}

.field span {
  font-size: 0.82rem;
  color: var(--muted);
}

.field input {
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--purple-mid);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

.oauth-row {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  max-width: 420px;
}

.btn-yandex {
  width: 100%;
  background: #fc3f1d !important;
  color: #fff !important;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple-mid));
  display: grid;
  place-items: center;
  font-weight: 800;
}

.period-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.period-btn {
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  transition: all 0.15s;
}

.period-btn.selected {
  border-color: var(--purple-mid);
  background: rgba(168, 85, 247, 0.22);
}

.payment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.payment-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: all 0.15s;
}

.payment-card:hover {
  border-color: var(--border);
}

.payment-card.selected {
  border-color: var(--purple-mid);
  box-shadow: 0 0 0 1px var(--purple-mid);
}

.payment-card .name {
  font-weight: 600;
  font-size: 0.92rem;
}

.payment-card .desc {
  font-size: 0.76rem;
  color: var(--muted);
  margin-top: 4px;
}

.checkout-summary {
  margin: 18px 0 14px;
  font-size: 0.95rem;
}

.payment-wait {
  margin-top: 18px;
}

.sub-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.alert {
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.alert--ok {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

.alert:not(.alert--ok) {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.link-box {
  display: flex;
  gap: 10px;
  margin: 14px 0 18px;
}

.link-box input {
  flex: 1;
  min-width: 0;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.82rem;
}

.row-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#telegram-login {
  min-height: 44px;
}

/* Responsive */
@media (max-width: 960px) {
  .nav {
    display: none;
  }

  .hero__grid,
  .servers__grid,
  .download,
  .features,
  .steps-grid,
  .tariff-grid--plans {
    grid-template-columns: 1fr;
  }

  .hero__mock {
    order: -1;
  }

  .plan-card--featured {
    transform: none;
  }

  .plan-card--featured:hover {
    transform: translateY(-4px);
  }

  .features {
    grid-template-columns: 1fr 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }

  .app-preview--servers {
    margin: 0 auto;
  }
}

@media (max-width: 520px) {
  .features,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .purchase-card {
    padding: 22px 16px;
  }

  .wrap {
    width: min(1180px, calc(100% - 28px));
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
