:root {
  color-scheme: dark;
  --ink: #0f172a;
  --text: #eff5fb;
  --muted: #8ea0b2;
  --line: rgba(255, 255, 255, 0.08);
  --panel: rgba(17, 28, 39, 0.92);
  --panel-2: #132130;
  --bg: #08111a;
  --bg-soft: #0f1b27;
  --navy: #091224;
  --teal: #49d6ba;
  --teal-2: #27b99b;
  --blue: #4987ff;
  --warning: #ffc96f;
  --shadow: 0 20px 52px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(73, 214, 186, 0.18), transparent 30%),
    radial-gradient(circle at bottom right, rgba(73, 135, 255, 0.18), transparent 24%),
    var(--bg);
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 12px clamp(18px, 5vw, 72px);
  background: rgba(9, 18, 36, 0.96);
  color: var(--text);
  box-shadow: 0 10px 30px rgba(9, 18, 36, 0.24);
  backdrop-filter: blur(18px);
  animation: headerDrop 0.55s ease both;
}

.brand,
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-weight: 800;
  font-size: 18px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.brand-logo {
  width: 46px;
  height: 46px;
  max-width: 46px;
  max-height: 46px;
  flex: 0 0 46px;
  border: 1px solid rgba(73, 214, 186, 0.32);
  border-radius: 14px;
  object-fit: cover;
  background: #020709;
  box-shadow:
    0 0 22px rgba(39, 167, 231, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.04);
  box-shadow:
    0 0 28px rgba(39, 167, 231, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.brand:hover {
  transform: translateY(-1px);
}

.header-actions a {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.login-button {
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text) !important;
}

.header-actions a:hover,
.login-button.is-authenticated {
  transform: translateY(-1px);
  border-color: rgba(73, 214, 186, 0.28);
  background: rgba(73, 214, 186, 0.12);
  color: var(--text) !important;
}

.hero {
  min-height: auto;
  padding: clamp(42px, 6vh, 72px) clamp(18px, 5vw, 72px) clamp(46px, 7vh, 82px);
  background:
    radial-gradient(circle at 20% 0%, rgba(73, 214, 186, 0.24), transparent 34%),
    radial-gradient(circle at 88% 22%, rgba(73, 135, 255, 0.22), transparent 28%),
    linear-gradient(180deg, rgba(8, 17, 26, 0.2), rgba(8, 17, 26, 0.98));
}

.hero-inner,
.section-inner,
.footer-inner {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.hero-inner {
  display: grid;
  justify-items: center;
  text-align: center;
  animation: heroRise 0.7s ease both;
}

.eyebrow {
  margin: 0 0 10px;
  color: #087f78;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(48px, 7vw, 86px);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

.hero-copy {
  max-width: 620px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.55;
}

.trust-chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
}

.trust-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  margin-bottom: 24px;
}

.feature-card,
.reason-grid article,
.account-panel,
.builder-panel,
.summary-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.feature-card {
  min-height: 220px;
  padding: 28px 24px;
  transition: transform 0.24s ease, border-color 0.24s ease, background 0.24s ease, box-shadow 0.24s ease;
}

.feature-card:hover,
.reason-grid article:hover,
.builder-panel:hover,
.summary-panel:hover,
.account-panel:hover {
  transform: translateY(-3px);
  border-color: rgba(73, 214, 186, 0.22);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin-bottom: 22px;
  border-radius: 18px;
  color: #04120f;
  font-size: 30px;
  font-weight: 800;
  transition: transform 0.24s ease;
}

.feature-card:hover .feature-icon,
.reason-grid article:hover span {
  transform: scale(1.05) translateY(-2px);
}

.feature-icon.globe {
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
}

.feature-icon.shield {
  background: rgba(73, 214, 186, 0.14);
  border: 1px solid rgba(73, 214, 186, 0.28);
  color: var(--teal);
}

.feature-icon.infinity {
  background: var(--panel-2);
  color: var(--teal);
}

.feature-card h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

.feature-card p,
.reason-grid p,
.account-panel p,
.builder-panel p,
.summary-panel p,
.site-footer p {
  color: var(--muted);
  line-height: 1.55;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  width: min(560px, 100%);
}

body.is-authenticated .hero-actions {
  grid-template-columns: minmax(220px, 360px);
  justify-content: center;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
  padding: 16px 22px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.primary-button {
  color: #04120f;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  box-shadow: 0 18px 32px rgba(73, 214, 186, 0.16);
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.primary-button:hover,
.secondary-button:hover,
.telegram-login-shell:hover,
.chip-button:hover {
  transform: translateY(-2px);
}

.account-section,
.why-section,
.plans-section {
  padding: clamp(46px, 7vh, 68px) clamp(18px, 5vw, 72px);
}

.account-section {
  background: var(--bg);
}

.account-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 24px;
  padding: clamp(22px, 4vw, 36px);
}

.account-panel:not(:has(.telegram-widget-slot)) {
  grid-template-columns: 1fr;
}

.account-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.telegram-widget-slot {
  min-width: 214px;
  min-height: 46px;
  display: grid;
  place-items: center;
  gap: 10px;
  padding-top: 10px;
}

.site-login-entry {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin: 14px 0 16px;
}

.account-copy .site-login-entry {
  width: min(100%, 360px);
}

.telegram-login-fallback {
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

.telegram-login-fallback.is-hidden {
  display: none;
}

.telegram-login-shell {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #27a7e7;
  color: #fff;
  box-shadow: 0 16px 34px rgba(39, 167, 231, 0.28);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.site-login-entry .telegram-login-shell {
  width: 100%;
  min-height: 58px;
}

.telegram-login-shell:hover {
  box-shadow: 0 20px 42px rgba(39, 167, 231, 0.34);
  filter: brightness(1.04);
}

.telegram-login-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.18);
  font-size: 14px;
}

.telegram-login-fallback small {
  max-width: 260px;
  color: var(--muted);
  line-height: 1.35;
}

.site-login-entry small {
  color: var(--muted);
  line-height: 1.35;
}

.account-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.account-stats div,
.account-note {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.account-stats span,
.account-note span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.account-stats strong,
.account-note strong {
  display: block;
  margin-top: 6px;
}

.account-note {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.why-section {
  background: rgba(15, 27, 39, 0.62);
}

.section-heading {
  max-width: 620px;
  margin-bottom: 22px;
}

.section-heading h2,
.account-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.reason-grid article {
  padding: 24px;
  border-radius: 22px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.reason-grid span {
  display: block;
  margin-bottom: 18px;
  font-size: 30px;
}

.reason-grid h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.plans-section {
  background: var(--bg);
}

.plan-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.62fr);
  gap: 18px;
  align-items: start;
}

.builder-panel,
.summary-panel {
  padding: clamp(24px, 4vw, 38px);
}

.builder-panel {
  display: grid;
  gap: 20px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.builder-head h3,
.summary-panel h3 {
  margin: 12px 0 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.08;
}

.status-badge {
  display: inline-flex;
  border: 1px solid rgba(73, 214, 186, 0.34);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(73, 214, 186, 0.12);
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.price-block {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.price-block strong {
  font-size: clamp(36px, 6vw, 54px);
  line-height: 0.95;
}

.price-block span {
  color: var(--muted);
  font-size: 13px;
}

.builder-group {
  display: grid;
  gap: 12px;
}

.builder-label-row,
.range-labels,
.summary-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.builder-label-row span,
.range-labels,
.summary-list span {
  color: var(--muted);
}

.device-range {
  width: 100%;
  min-height: 44px;
  accent-color: var(--teal);
}

.segmented-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.duration-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payment-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chip-button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.chip-button.is-selected {
  border-color: rgba(73, 214, 186, 0.34);
  background: rgba(73, 214, 186, 0.16);
}

.chip-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.summary-panel {
  display: grid;
  gap: 18px;
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.summary-list {
  display: grid;
  gap: 12px;
}

.summary-list div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.summary-list div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.payment-status {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.payment-status.success {
  border-color: rgba(73, 214, 186, 0.34);
  background: rgba(73, 214, 186, 0.09);
}

.payment-status p {
  margin: 0;
}

.compact-button {
  width: auto;
  min-height: 48px;
  justify-self: start;
}

.site-footer {
  padding: 34px clamp(18px, 5vw, 72px);
  background: #050a10;
  color: var(--text);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
}

.reveal.is-visible {
  animation: revealUp 0.62s ease both;
}

@keyframes headerDrop {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.footer-inner p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.68);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  width: min(420px, calc(100vw - 28px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px 16px;
  background: rgba(9, 17, 26, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .feature-grid,
  .trust-chips,
  .reason-grid,
  .plan-builder {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 0;
  }

  .price-block {
    justify-items: start;
  }

  .account-actions {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  .account-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 64px;
    padding: 8px 12px;
  }

  .brand {
    font-size: 15px;
  }

  .brand-logo {
    width: 40px;
    height: 40px;
    max-width: 40px;
    max-height: 40px;
    flex-basis: 40px;
    border-radius: 12px;
  }

  .header-actions a:not(.login-button) {
    display: none;
  }

  .login-button {
    padding: 12px 16px;
  }

  .hero {
    min-height: calc(100svh - 64px);
    padding: 34px 14px 44px;
  }

  h1 {
    font-size: clamp(42px, 17vw, 64px);
  }

  .trust-chips {
    gap: 8px;
  }

  .trust-chips span {
    border-radius: 16px;
    font-size: 13px;
  }

  .feature-card {
    padding: 26px 20px;
  }

  .hero-actions {
    grid-template-columns: 1fr;
  }

  body.is-authenticated .hero-actions {
    grid-template-columns: 1fr;
  }

  .account-section,
  .why-section,
  .plans-section {
    padding: 38px 14px;
  }

  .account-panel,
  .builder-panel,
  .summary-panel {
    border-radius: 22px;
  }

  .site-login-entry {
    width: 100%;
  }

  .account-stats {
    grid-template-columns: 1fr;
  }

  .payment-row {
    grid-template-columns: 1fr;
  }

  .duration-row {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
