/* TED Service — публичный лендинг (нейтральные формулировки) */
:root {
  --bg: #0e1621;
  --bg2: #121c28;
  --card: #17212b;
  --text: #e4e6ea;
  --muted: #8a9bae;
  --accent: #5baaec;
  --accent2: #79d7ff;
  --border: #2b3a4e;
  --radius: 14px;
  --sidebar-bg: #0b111b;
  --sidebar-w: 272px;
  --topbar-h: 52px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Шапка и сайдбар лендинга: без подчёркивания при наведении */
.site-topbar a:hover,
.site-sidebar a:hover {
  text-decoration: none;
}

.site-topbar .site-cta:hover {
  text-decoration: none !important;
}

/* ===== Layout: sidebar + main column ===== */
.site-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s;
}

body.nav-open .site-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.site-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-w);
  max-width: 100vw;
  z-index: 45;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  padding: 22px 12px 20px 16px;
}

.sidebar-brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none !important;
}

.sidebar-brand span {
  color: var(--accent2);
}

.sidebar-brand:hover {
  color: #fff;
}

.sidebar-tagline {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

.sidebar-divider {
  height: 1px;
  margin: 18px 0 6px;
  background: linear-gradient(90deg, rgba(91, 170, 236, 0.35), transparent);
  opacity: 0.9;
}

.sidebar-nav {
  flex: 0 0 auto;
  min-width: 0;
  overflow-x: hidden;
}

/* Inline-SVG в flex: без жёстких min/max часть движков раздувает иконку на весь экран */
.site-sidebar svg {
  display: block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex-shrink: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.nav-group {
  margin-top: 14px;
}

.nav-group-title {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px 10px;
  opacity: 0.85;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px 10px 10px;
  margin-bottom: 2px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent2);
}

.nav-link.is-active {
  background: rgba(91, 170, 236, 0.14);
  color: var(--accent2);
}

.nav-ic {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex-shrink: 0;
  display: block;
  opacity: 0.88;
}

.nav-link.is-active .nav-ic,
.nav-link:hover .nav-ic {
  opacity: 1;
}

.sidebar-spacer {
  flex: 1;
  min-height: 16px;
}

.sidebar-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
  min-width: 0;
}

.sidebar-cta-bot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent2) !important;
  text-decoration: none !important;
  border: 1px solid rgba(121, 215, 255, 0.35);
  background: rgba(91, 170, 236, 0.06);
  transition: background 0.15s, border-color 0.15s;
}

.sidebar-cta-bot:hover {
  background: rgba(91, 170, 236, 0.12);
  border-color: rgba(121, 215, 255, 0.55);
}

.sidebar-cta-bot--soft {
  font-weight: 600;
  color: var(--text) !important;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-cta-bot--soft:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(121, 215, 255, 0.4);
  color: var(--accent2) !important;
}

.site-main-col {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.site-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--topbar-h);
  padding: 8px 16px 8px 8px;
  background: rgba(14, 22, 33, 0.96);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 25;
  backdrop-filter: blur(10px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 11px;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

body.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

body.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.topbar-brand {
  flex: 1;
  min-width: 0;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none !important;
  text-align: center;
}

.topbar-brand span {
  color: var(--accent2);
}

.topbar-brand:hover {
  color: #fff;
}

.topbar-cta {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.82rem;
}

@media (min-width: 961px) {
  .topbar-brand {
    text-align: left;
    margin-left: 4px;
  }

  body.nav-open .site-backdrop {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

@media (max-width: 960px) {
  .site-backdrop {
    top: var(--topbar-h);
  }

  .site-sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
    top: var(--topbar-h);
    bottom: 0;
    height: auto;
  }

  body.nav-open .site-sidebar {
    transform: translateX(0);
  }

  .site-main-col {
    margin-left: 0;
  }

  .nav-toggle {
    display: flex;
  }

  body.nav-open {
    overflow: hidden;
  }
}

.site-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(135deg, var(--accent), #3d8fd9);
  color: #fff !important;
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
}

.site-cta:hover {
  filter: brightness(1.08);
}

.site-cta.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text) !important;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 64px;
  width: 100%;
}

#hero,
.section,
#docs,
#happ-routing,
footer#contacts {
  scroll-margin-top: calc(var(--topbar-h) + 12px);
}

.hero {
  padding: 36px 0 48px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1.25;
}

.hero .lead {
  margin: 0 auto 24px;
  max-width: 560px;
  color: var(--muted);
  font-size: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.section h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  color: #fff;
}

.section .sub {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
}

.grid-2 {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--accent2);
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.happ-routing-card {
  margin-bottom: 24px;
}

.happ-routing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

/* Табы инструкций */
.plat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.plat-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.plat-tab.active {
  background: rgba(91, 170, 236, 0.2);
  border-color: var(--accent);
  color: var(--accent2);
}

.plat-panel {
  display: none;
}

.plat-panel.active {
  display: block;
}

.steps {
  margin: 0;
  padding-left: 22px;
}

.steps li {
  margin-bottom: 10px;
  color: var(--muted);
}

.steps strong {
  color: var(--text);
}

.connect-overview {
  margin: 0 0 24px;
  padding-left: 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.connect-overview li {
  margin-bottom: 10px;
}

.connect-overview strong {
  color: var(--text);
}


.instruction-manual-card {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(91, 170, 236, 0.06);
}

.instruction-manual-title {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--accent2);
}

.instruction-manual-links {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.instruction-manual-links li {
  margin-bottom: 8px;
}

.instruction-manual-links a {
  color: var(--accent2);
  font-weight: 600;
}

.instruction-manual-single {
  margin: 0;
  font-size: 0.95rem;
}

.instruction-manual-single a {
  color: var(--accent2);
  font-weight: 600;
}

.instruction-embed-trigger {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: inherit;
  color: var(--accent2);
  font-weight: 600;
  text-decoration: underline;
  text-align: left;
  cursor: pointer;
}

.instruction-embed-wrap {
  margin: 14px 0 18px;
}

.instruction-embed-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 8px;
}

.instruction-embed-close {
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
}

.instruction-embed-open {
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: underline;
}

.instruction-embed-open:hover {
  color: var(--accent2);
}

.instruction-embed-error {
  margin: 0 0 8px;
  color: #f0a8a8;
}

.instruction-embed-frame {
  display: block;
  width: 100%;
  min-height: min(70vh, 640px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

.connect-details {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0 4px;
}

.connect-details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--accent2);
  user-select: none;
}

.connect-details > summary::-webkit-details-marker {
  display: none;
}

.connect-details > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 2px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  opacity: 0.7;
  flex-shrink: 0;
}

.connect-details[open] > summary::after {
  margin-top: 6px;
  transform: rotate(-135deg);
}

.connect-details-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--muted);
}

.connect-details-body p {
  margin: 12px 0 0;
}

.connect-details-body p:first-child {
  margin-top: 12px;
}

.connect-figure {
  margin: 16px 0 0;
  text-align: center;
}

.connect-illu {
  max-width: min(100%, 320px);
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.connect-illu.instr-ping-img {
  max-width: min(100%, 420px);
}

.instr-tabs .plat-tab {
  font-size: 0.78rem;
  padding: 8px 10px;
}

@media (min-width: 520px) {
  .instr-tabs .plat-tab {
    font-size: 0.85rem;
    padding: 8px 14px;
  }
}

.connect-plat-tabs .plat-tab {
  font-size: 0.75rem;
  padding: 8px 10px;
}

@media (min-width: 520px) {
  .connect-plat-tabs .plat-tab {
    font-size: 0.82rem;
    padding: 8px 12px;
  }
}

.connect-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 20px;
}

.connect-cta-row .site-cta {
  flex: 1 1 200px;
  justify-content: center;
  text-align: center;
}

/* Тарифы */
.tariff-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.tariff {
  text-align: center;
  padding: 24px 16px;
}

.tariff .price {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 8px 0;
}

.tariff .note {
  font-size: 0.8rem;
  color: var(--muted);
}

.tariff .badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(91, 170, 236, 0.1);
  border: 1px solid rgba(91, 170, 236, 0.28);
  color: var(--accent2);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--card);
}

.faq-q {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.faq-q::after {
  content: "+";
  color: var(--accent);
  font-size: 1.2rem;
  font-weight: 400;
}

.faq-item.open .faq-q::after {
  content: "−";
}

.faq-a {
  display: none;
  padding: 0 18px 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.faq-item.open .faq-a {
  display: block;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.doc-links a {
  display: inline-flex;
  padding: 12px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  font-weight: 600;
}

footer {
  padding: 32px 0 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

/* Контакты: текстовые ссылки + компактные кнопки только для входа в Telegram */
.contacts-heading {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
}

.contacts-lead {
  margin: 0 0 18px;
  max-width: 520px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
}

.contacts-block-label {
  margin: 0 0 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-tg-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent2) !important;
  text-decoration: none !important;
  border: 1px solid rgba(121, 215, 255, 0.45);
  background: rgba(91, 170, 236, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.contact-chip:hover {
  background: rgba(91, 170, 236, 0.12);
  border-color: rgba(121, 215, 255, 0.68);
  text-decoration: none !important;
}

.contact-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.contacts-links {
  margin: 0;
  max-width: 520px;
}

.contacts-links p {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.45;
}

.contacts-links a {
  font-weight: 600;
}

.muted-small {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 16px;
}

@media (max-width: 400px) {
  .topbar-cta {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
}
