/*
 * constellation.css — Block 7 R=6 integrations constellation styling
 * Extracted from index.html in aihunter--409 block-205.1a refactor (2026-06-13).
 * Single source of truth — loaded via _layout.html for all pages that include
 * the _partials/integrations_constellation.html partial.
 */

/* Block 7 — Integrations section + panel wrapping */
section.integrations {
  padding: 32px 0;
  background: var(--surface);
}
.integrations-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.integrations-panel {
  background: #1A1F2E;
  --brand-subtle: #2A3548;
  --fg: #E2E8F0;
  --border: rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 48px 40px;
}
.integrations-panel .block-h2,
.integrations-panel .lead,
.integrations-panel p {
  color: var(--fg);
}

/* Block 7 R=6 — SVG overlay constellation (math-guaranteed line endpoints) */
.constellation {
  position: relative;
  max-width: 1100px;
  margin: 32px auto 0;
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.constellation-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.team-rail {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  background: var(--brand-subtle);
  border-radius: 4px;
  padding: 7px 9px;
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
}
.team-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-subtle);
  border: 1px dashed var(--brand);
  border-radius: 4px;
  padding: 3px 6px;
}
.team-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}
.team-fig-square {
  width: 24px;
  height: 24px;
  background: var(--brand);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.team-fig-square svg {
  width: 14px;
  height: 14px;
  fill: white;
}
.channels-row {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
}
.channel-pill {
  background: var(--brand-subtle);
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.channel-pill svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}
.constellation-middle {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
}
.constellation-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 32px;
  justify-content: flex-end;
  padding-right: 96px;
}
.data-grid {
  display: grid;
  grid-template-columns: repeat(3, 32px);
  grid-template-rows: repeat(2, 32px);
  gap: 8px;
  background: var(--brand-subtle);
  border-radius: 4px;
  padding: 7px;
  transform: translateY(16px);
}
.data-square {
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.data-square svg {
  width: 18px;
  height: 18px;
  fill: white;
}
.data-pill {
  background: var(--brand-subtle);
  color: var(--fg);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transform: translateY(16px);
}
.constellation-right {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding-left: 160px;
}
.constellation-right-pill {
  background: var(--brand);
  color: white;
  border-radius: 4px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 700;
  display: inline-block;
  box-shadow: 0 3px 12px rgba(244, 163, 0, 0.25);
  white-space: nowrap;
  line-height: 1;
  transform: translateY(16px);
}
.constellation-right-pill > span {
  display: inline-flex;
  align-items: center;
}
.constellation-right-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  display: inline-block;
  margin-right: 8px;
}
.constellation-center-wrap {
  text-align: center;
  margin-top: 0;
  position: relative;
  z-index: 1;
}
.constellation-center {
  background: var(--brand);
  border-radius: 4px;
  padding: 12px 22px;
  color: white;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 3px 12px rgba(244, 163, 0, 0.25);
}
.constellation-center > span:first-of-type {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.constellation-center > span:first-of-type > .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  display: inline-block;
  margin-right: 8px;
}
.constellation-center-sub {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.85;
}
.channel-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Block 7 — BOTTOM zone (Интеграция pill + 4 brand cells + tooltip) */
.integrations-pill {
  background: var(--brand-subtle);
  color: var(--fg);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  align-self: center;
  position: relative;
  z-index: 1;
}
.integrations-cells {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  background: var(--brand-subtle);
  border-radius: 4px;
  padding: 7px;
}
.integration-cell {
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.integration-cell--b24 { background: #2FC6F6; color: white; }
.integration-cell--1c  { background: #F5C518; color: black; }
.integration-cell--amo { background: #1F85DE; color: white; }
.integration-cell--more {
  background: var(--brand-subtle);
  color: var(--fg);
  border: 1px dashed var(--brand);
  cursor: default;
}
.integration-chevron {
  font-weight: 700;
  margin-left: 2px;
  color: var(--brand);
}
.integration-cell--more {
  cursor: pointer;
  transition: background 150ms ease;
}
.integration-cell--more:hover {
  background: var(--brand);
  color: white;
}
.integration-cell--more:hover .integration-chevron {
  color: white;
}

/* Integrations popover (anchored to "+ещё" cell).
   Explicit colors — popover always white card, dark text. Constellation
   section overrides --fg/--surface for dark navy theme (L20-22), но popover
   visually independent card (Block 205.1d R=3 hotfix). */
.integrations-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: #FFFFFF;
  color: #0F172A;
  border: 1px solid #E2E8F0;
  border-radius: 4px;
  padding: 14px 16px 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  display: none;
  z-index: 100;
  text-align: left;
}
.integrations-popover.active { display: block; }
.integrations-popover__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.integrations-popover__list li {
  padding: 6px 4px;
  font-size: 14px;
  font-weight: 500;
  color: #0F172A;
  white-space: nowrap;
}
.integrations-popover__list li + li {
  border-top: 1px solid #E2E8F0;
}
.integrations-popover__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--fg);
  opacity: 0.5;
  border-radius: 4px;
  transition: opacity 150ms ease, background 150ms ease;
}
.integrations-popover__close:hover {
  opacity: 1;
  background: var(--brand-subtle);
}

/* Mobile responsive — constellation collapses to vertical stack */
@media (max-width: 700px) {
  section.integrations { padding: 64px 16px; }
  .constellation { gap: 24px; padding: 16px 0; }
  .constellation-lines { display: none; }
  .team-rail { flex-wrap: wrap; gap: 8px; padding: 12px 14px; justify-content: center; width: auto; margin: 0; }
  .channels-row { flex-wrap: wrap; gap: 8px; padding: 0; }
  .channel-pill { min-width: auto; }
  .constellation-middle { grid-template-columns: 1fr; gap: 24px; }
  .constellation-left { display: flex; flex-direction: column; align-items: center; gap: 8px; justify-self: center; padding-right: 0; }
  .data-pill { transform: none; }
  .data-grid { transform: none; }
  .constellation-right { justify-self: center; padding-left: 0; }
  .constellation-right-pill { transform: none; }
  .constellation-center-wrap { margin-top: 0; }
  .constellation-center { padding: 10px 18px; }
  .constellation-center > span:first-of-type { font-size: 15px; }
  .team-fig-square { width: 28px; height: 28px; }
  .team-fig-square svg { width: 16px; height: 16px; }
}


/* =========================================
   === FAQ === (Block 9 HH-style split — copied from index.html L656-759 в 211)
   ========================================= */
section.faq {
  padding: 80px 24px;
  background: var(--surface);
}
.faq-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.faq .section-head {
  margin-bottom: 32px;
}
.faq-grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 24px;
  align-items: stretch;
}
.faq-cta-card {
  background: transparent;
  border-radius: 0;
  padding: 32px 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: flex-start;
  gap: 20px;
}
.faq-cta-headline {
  font-size: clamp(24px, 2vw, 32px);
  font-weight: 700;
  color: var(--fg);
  margin: 0 0 12px;
  line-height: 1.2;
}
.faq-cta-lead {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
  max-width: 280px;
}
.faq-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.faq-cta-card .btn {
  width: 100%;
  justify-content: center;
}
.faq-accordion-card {
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.faq-accordion-card details {
  border-bottom: 1px solid var(--border);
}
.faq-accordion-card details:last-child {
  border-bottom: none;
}
.faq-accordion-card summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  line-height: 1.4;
}
.faq-accordion-card summary::-webkit-details-marker { display: none; }
.faq-accordion-card summary::after {
  content: "+";
  color: var(--brand);
  font-size: 24px;
  font-weight: 400;
  transition: transform 200ms ease;
  flex-shrink: 0;
  line-height: 1;
}
.faq-accordion-card details[open] summary::after {
  transform: rotate(45deg);
}
.faq-answer {
  padding: 0 0 18px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}
.faq-answer p { margin: 0 0 8px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer a {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.faq-answer strong { color: var(--fg); font-weight: 700; }


/* =========================================
   === Final CTA === (dark navy panel — copied from index.html L812-855 в 211)
   ========================================= */
section.final-cta {
  padding: 32px 0;
}
.final-cta-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.final-cta-panel {
  background: #1A1F2E;
  --brand-subtle: #2A3548;
  --fg: #E2E8F0;
  --border: rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 80px 48px;
  text-align: center;
}
.final-cta-panel .block-h2,
.final-cta-panel p {
  color: var(--fg);
}
.final-cta-panel .btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}
.final-cta-panel .btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.final-cta-panel .block-h2 {
  font-size: clamp(32px, 4.5vw, 52px);
  margin: 0 0 20px;
  line-height: 1.1;
  font-weight: 800;
}
.final-cta-panel p {
  color: var(--muted);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.5;
}


/* =========================================
   === Mobile === (FAQ + Final CTA breakpoint 700px — copied from index.html L266-275 в 211)
   ========================================= */
@media (max-width: 700px) {
  section.faq { padding: 64px 16px; }
  .faq-container { padding: 0 16px; }
  .faq-grid { grid-template-columns: 1fr; gap: 16px; }
  .faq-cta-card { padding: 32px 24px; }
  .faq-accordion-card { padding: 8px 24px; }
  .faq-accordion-card summary { font-size: 15px; padding: 14px 0; }

  section.final-cta { padding: 0 16px; }
  .final-cta-container { padding: 0 16px; }
  .final-cta-panel { padding: 48px 24px; border-radius: 16px; }
}

/* Apps-wall — Sintra-style integrations grid (block 208 task 470).
   208.2 rework: DB-driven from service_catalog + pack_integrations.status.
   Random shuffle 15-18 cells per request, scattered holes, frosted vs solid states. */
.apps-wall {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  padding: 24px 0;
}
.app-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.15s;
  min-height: 70px;
}
.app-cell svg { width: 22px; height: 22px; }
.app-cell__name { font-size: 13px; line-height: 1.2; }
.app-cell:hover { transform: translateY(-2px); }
.app-cell--frosted {
  background: rgba(255, 255, 255, 0.05) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0.35;
  color: rgba(255, 255, 255, 0.6) !important;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}
.app-cell-hole {
  background: transparent;
  min-height: 70px;
  pointer-events: none;
}
