:root {
  --muted: #aeb4bf;
  --link: #8fd9c2;
  --focus-ring: #57c4a6;
  --danger: #ff8f8f;
  --ease-ui: cubic-bezier(0.23, 1, 0.32, 1);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-network a:not(.btn) {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.page-network a:not(.btn):hover {
  color: #e1e4ff;
}

.page-network :where(a, button, input, textarea, summary, [tabindex]):focus-visible,
.footer :where(a, button):focus-visible,
.cookie-notice :where(a, button):focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Touch targets: text controls + CTA buttons only (not checkbox/radio/tabs chrome) */
.page-network :where(
  .btn,
  .btn-sm,
  .btn-pay,
  .lp-sticky-btn,
  .cookie-notice-btn,
  input[type="email"],
  input[type="text"]:not(.auth-honeypot),
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  textarea
),
.cookie-notice button {
  min-height: 44px;
}

.page-network .btn,
.page-network a.btn,
.page-network button.btn,
.page-network .btn-sm,
.page-network .lp-sticky-btn,
.cookie-notice button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Ghost / link-style controls stay compact */
.page-network .btn-ghost,
.page-network summary {
  min-height: 0;
}

.page-network .btn:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip):not(.btn-ghost),
.page-network button.btn:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip) {
  transition:
    background-color 180ms var(--ease-ui),
    border-color 180ms var(--ease-ui),
    color 180ms var(--ease-ui),
    transform 140ms var(--ease-ui);
}

.page-network .btn:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip):not(.btn-ghost):active,
.page-network button.btn:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip):active {
  transform: scale(0.97);
}

.page-network input::placeholder,
.page-network textarea::placeholder {
  color: #9fa6b2;
  opacity: 1;
}

.page-network [aria-invalid="true"] {
  border-color: var(--danger) !important;
}

.page-network .error-msg,
.page-network .login-field-error {
  color: var(--danger);
}

.page-network .lp-hero-title em,
.page-network .lp-display-accent {
  background: none;
  color: #57c4a6;
  animation: none;
}

.page-network .lp-hero-glow,
.page-network .lp-close-glow {
  display: none;
}

.page-network-landing .lp-section .lp-kicker,
.page-network-landing .lp-pricing .lp-kicker {
  display: none;
}

.page-network-landing .network-benefits-grid {
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-network-landing .network-benefit {
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0;
  background: transparent;
}

.page-network .btn:hover,
.page-network .btn-outline:hover,
.page-network .telegram-auth:hover .telegram-auth-facade {
  box-shadow: none;
}

.page-profile .profile-hero--premium,
.page-profile .stat-card--premium-tier {
  animation: none;
  box-shadow: none;
}

.page-profile .profile-hero--premium::after,
.page-profile .stat-card--premium-tier::before {
  display: none;
}

.page-profile .profile-section,
.page-profile .profile-hero.network-card {
  backdrop-filter: none;
}

.page-profile .profile-hero-kicker {
  text-transform: none;
  letter-spacing: 0;
}

.page-profile .profile-tab,
.page-network .auth-tab,
.page-network .t-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.page-profile [role="tabpanel"]:focus-visible {
  outline-offset: 5px;
}

.login-code-block[hidden] {
  display: none;
}

.lp-route-section {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1.2fr);
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  width: min(72rem, calc(100% - 2 * var(--lp-pad)));
  margin: 0 auto;
  padding: clamp(2.75rem, 7vw, 5rem) 0;
}

.lp-route-copy h2 {
  max-width: 16ch;
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 4vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.lp-route-copy p {
  max-width: 54ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  text-wrap: pretty;
}

.lp-route-visual {
  margin: 0;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid rgba(185, 192, 255, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.018);
}

.lp-route-source {
  width: fit-content;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  font-weight: 600;
}

.lp-route-branch {
  width: 50%;
  height: 2.25rem;
  margin: 0 auto;
  border-right: 1px solid rgba(185, 192, 255, 0.45);
  border-left: 1px solid rgba(185, 192, 255, 0.45);
  border-top: 1px solid rgba(185, 192, 255, 0.45);
}

.lp-route-destinations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.lp-route-destination {
  min-height: 6.5rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.lp-route-destination--protected {
  border: 1px solid rgba(185, 192, 255, 0.35);
}

.lp-route-destination--direct {
  border: 1px solid rgba(125, 222, 168, 0.28);
}

.lp-route-destination strong,
.lp-route-destination span {
  display: block;
}

.lp-route-destination span {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.lp-route-visual figcaption {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

@media (max-width: 768px) {
  .lp-route-section {
    grid-template-columns: 1fr;
    width: calc(100% - 2rem);
    padding: 2.5rem 0;
  }

  .lp-route-copy h2 {
    max-width: 20ch;
  }

  /* Cookie banner wins over sticky CTA — avoid stacked bottom bars */
  .cookie-notice-open .lp-sticky {
    display: none !important;
  }

  .cookie-notice-open .cookie-notice:not(.is-hidden) {
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 480px) {
  .lp-route-destinations {
    grid-template-columns: 1fr;
    position: relative;
    gap: 0.75rem;
    padding-left: 1.5rem;
  }

  .lp-route-destinations::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 3.25rem;
    left: 0.5rem;
    border-left: 1px solid rgba(185, 192, 255, 0.45);
  }

  .lp-route-destination {
    position: relative;
  }

  .lp-route-destination::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    width: 1rem;
    border-top: 1px solid rgba(185, 192, 255, 0.45);
  }

  .lp-route-branch {
    width: calc(50% - 0.5rem);
    height: 1.5rem;
    margin: 0 auto 0 0.5rem;
    border: 0;
    border-right: 1px solid rgba(185, 192, 255, 0.45);
    border-bottom: 1px solid rgba(185, 192, 255, 0.45);
  }
}

@media (hover: hover) and (pointer: fine) {
  .page-network .btn:hover:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip):not(.btn-ghost),
  .page-network button.btn:hover:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip) {
    transform: translateY(-1px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto;
  }

  .page-network *,
  .page-network *::before,
  .page-network *::after,
  .cookie-notice,
  .cookie-notice * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition-property: color, background-color, border-color, opacity !important;
    transition-duration: 120ms !important;
    transition-timing-function: ease-out !important;
  }

  .page-network .btn:hover:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip),
  .page-network button.btn:hover:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip),
  .page-network .btn:active:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip),
  .page-network button.btn:active:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip) {
    transform: none;
  }

  .devices-meter-bar::after {
    transition: none !important;
  }
}

@media (hover: none), (pointer: coarse) {
  .page-network .btn:hover:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip),
  .page-network button.btn:hover:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip),
  .page-network .btn:active:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip),
  .page-network button.btn:active:not(.auth-tab):not(.t-tab):not(.profile-tab):not(.plan-chip),
  .page-network .telegram-auth:hover .telegram-auth-facade,
  .page-profile .device-card:hover {
    transform: none !important;
  }
}
