/* ============ Переменные ============ */
:root {
  --color-bg: #141436;
  --color-bg-soft: #1b1b45;
  --color-bg-deep: #0b0b26;
  --color-surface: #1e2050;
  --color-surface-alt: #262865;

  --color-border: rgba(255, 255, 255, 0.12);

  --color-text: #f3f5fa;
  --color-text-muted: #a7acc9;

  --color-primary: #d2eef4;
  --color-primary-strong: #b3e3ed;
  --color-primary-hover: #8fd2e0;
  --color-primary-light: rgba(210, 238, 244, 0.14);

  --color-primary-dark: #e3a857;
  --color-accent: #e3a857;
  --color-danger: #ff8a75;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.4);
  --radius: 14px;
  --max-width: 1140px;
  --font-main: "Manrope", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 16px; font-weight: 700; color: var(--color-text); }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 16px; color: var(--color-text-muted); }

section { padding: 64px 0; }
section.soft { background: var(--color-bg-soft); }

.section-header { max-width: 720px; margin: 0 auto 40px; text-align: center; }
.section-header .eyebrow {
  display: inline-block;
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

/* ============ Кнопки ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--color-primary-strong); color: var(--color-bg); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--color-primary-hover); color: var(--color-bg); }
.btn-outline { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: var(--color-bg); }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 18px; font-size: 0.9rem; }

/* ============ Шапка ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 20, 54, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-text);
  white-space: nowrap;
}
.brand-badge {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #1e2050;
  color: var(--color-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
  padding: 6px;
  overflow: hidden;
}
.brand-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand small { display: block; font-weight: 500; color: var(--color-text-muted); font-size: 0.75rem; }

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  justify-content: center;
}
.main-nav a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover, .main-nav a.active { color: var(--color-primary); border-color: var(--color-primary); }

.header-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--color-text); margin: 4px 0; }

/* ============ Hero ============ */
.hero {
  padding: 72px 0;
  background: linear-gradient(180deg, rgba(210, 238, 244, 0.1) 0%, var(--color-bg) 100%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero .hero-name {
  display: block;
  color: var(--color-text);
  font-weight: 800;
  font-size: clamp(2.4rem, 5vw, 3.25rem);
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero .eyebrow {
  color: var(--color-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}
.hero .hero-title { font-size: clamp(2rem, 4vw, 2.75rem); margin: 12px 0 18px; }
.hero p.lead { font-size: 1.15rem; max-width: 520px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.hero-note { margin-top: 18px; font-size: 0.9rem; color: var(--color-text-muted); }

.photo-frame {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}
.photo-frame img { width: 100%; height: 100%; object-fit: cover; }

/* ============ Карточки ============ */
.grid {
  display: grid;
  gap: 24px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 26px;
  height: 100%;
}

.contact-info {
  display: flex;
  flex-direction: column;
}
.contact-info .card {
  flex: 1;
  height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.contact-info .card h3 {
  font-size: 1.5rem;
  font-weight: 700;
}
.contact-slogan {
  margin-top: auto;
  padding-top: 20px;
  text-align: right;
  font-style: italic;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-primary);
}
.card-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.card-icon-number {
  font-size: 1.6rem;
  font-weight: 800;
}

.services-top-row {
  display: grid;
  grid-template-columns: repeat(2, calc((100% - 48px) / 3));
  justify-content: center;
  gap: 24px;
}
.service-card {
  text-align: center;
}
.service-card h3 {
  font-size: 1.35rem;
}
.service-desc {
  font-size: 0.88rem;
  margin-bottom: 16px;
  min-height: 3.2em;
}
.service-line {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 6px;
}
.service-line:last-child { margin-bottom: 0; }
.service-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.service-price {
  color: var(--color-primary-dark);
  font-size: 1.35rem;
  font-weight: 800;
}

.list-check { list-style: none; padding: 0; margin: 0; }
.list-check li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 14px;
  color: var(--color-text);
}
.list-check-lg li {
  font-size: 1.15rem;
  font-weight: 400;
}
.list-check li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  width: 20px; height: 20px;
  background: var(--color-primary);
  color: var(--color-bg);
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex; align-items: center; justify-content: center;
}

/* ============ Таблицы ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--color-border); }
table { width: 100%; border-collapse: collapse; min-width: 560px; background: var(--color-surface); }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--color-border); }
thead th { background: var(--color-primary-strong); color: var(--color-bg); font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-alt); }
td.price, th.price { white-space: nowrap; font-weight: 700; color: var(--color-primary-dark); }
.cell-yes { color: var(--color-primary); font-weight: 700; }
.cell-no { color: var(--color-danger); font-weight: 700; }

/* ============ Шаги процесса ============ */
.steps {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  counter-reset: step;
}
.step { position: relative; padding-top: 8px; }
.step-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-primary-strong);
  color: var(--color-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  margin-bottom: 14px;
}

/* ============ FAQ ============ */
.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--color-surface);
}
.faq-item summary {
  cursor: pointer;
  padding: 18px 22px;
  font-weight: 700;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--color-text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--color-primary);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 22px 20px; color: var(--color-text-muted); }

/* ============ CTA-баннер ============ */
.cta-banner {
  background: var(--color-primary-strong);
  color: var(--color-bg);
  border-radius: 24px;
  padding: 48px;
  text-align: center;
}
.cta-banner h2, .cta-banner p { color: var(--color-bg); }
.cta-banner .btn-outline { color: var(--color-bg); border-color: var(--color-bg); }
.cta-banner .btn-outline:hover { background: var(--color-bg); color: var(--color-primary-strong); }

/* ============ Форма ============ */
.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; font-size: 0.92rem; color: var(--color-text); }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-surface-alt);
  color: var(--color-text);
}
.form-group input::placeholder, .form-group textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 1;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--color-surface);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-note { font-size: 0.82rem; color: var(--color-text-muted); margin-top: 10px; }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-weight: 600; }
.alert-success { background: rgba(45, 212, 191, 0.12); color: #6ee8d9; border: 1px solid rgba(45, 212, 191, 0.35); }
.alert-error { background: rgba(255, 138, 117, 0.12); color: var(--color-danger); border: 1px solid rgba(255, 138, 117, 0.35); }

.contact-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.contact-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-text);
}
.badge-online {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
.badge-online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fbb6a; }

/* ============ Подвал ============ */
.site-footer { background: var(--color-bg-deep); color: var(--color-text-muted); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.site-footer h4 { color: #fff; font-size: 1rem; }
.site-footer a { color: var(--color-text-muted); }
.site-footer a:hover { color: var(--color-primary); }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============ Утилиты ============ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.page-hero { padding: 48px 0 8px; }
.breadcrumb { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 8px; }

/* ============ Документы ============ */
.documents-content { padding-top: 24px; }
.document-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
  margin: 0 auto 30px;
}
.document-choice {
  display: flex;
  min-height: 76px;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  color: var(--color-text);
  background: var(--color-surface);
  text-align: center;
  font-weight: 700;
  font-family: var(--font-main);
  font-size: 1rem;
  line-height: 1.35;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease, border-color .2s ease, color .2s ease;
}
.document-choice:hover { background: var(--color-primary-light); border-color: var(--color-primary-strong); transform: translateY(-2px); }
.document-choice[aria-pressed="true"] { color: var(--color-bg); background: var(--color-primary-strong); border-color: var(--color-primary-strong); }
.document-choice:focus-visible { outline: 3px solid var(--color-primary-strong); outline-offset: 3px; }
.document-viewer-panel {
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}
.document-viewer-panel.is-empty { min-height: 300px; display: grid; place-items: center; }
.document-empty-state { text-align: center; }
.document-empty-state[hidden] { display: none; }
.document-empty-icon { display: grid; width: 58px; height: 58px; place-items: center; margin: 0 auto 14px; border-radius: 15px; color: var(--color-primary); background: var(--color-primary-light); }
.document-empty-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.document-empty-state h2 { margin-bottom: 8px; }
.document-empty-state p { margin: 0; }
.document-preview-title { min-height: 1.3em; margin: 0 0 18px; color: var(--color-text); text-align: center; font-size: clamp(1.2rem, 2.3vw, 1.7rem); }
.document-preview-frame {
  width: 100%;
  height: min(76vh, 780px);
  min-height: 430px;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #e9ebf1;
  box-shadow: var(--shadow-soft);
  scrollbar-color: var(--color-primary-strong) var(--color-bg-soft);
}
.document-preview {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
}
.document-page { display: block; width: min(100%, 850px); height: auto; flex: 0 0 auto; background: #fff; box-shadow: 0 3px 14px rgba(15, 20, 48, .18); }
.document-download-active { display: flex; width: fit-content; margin: 20px auto 0; }
.document-preview-stage { min-width: 0; }
@media (prefers-reduced-motion: reduce) {
  .document-choice { transition: none; }
}

/* ============ Тест на медиабельность ============ */
.mediation-test-section { padding-top: 48px; }
.mediation-test-card {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}
.mediation-test-heading { margin: 0 auto 28px; text-align: center; }
.mediation-test-heading h2 { margin: 0; }
.test-stage { opacity: 1; transform: translateY(0); transition: opacity .24s ease, transform .24s ease; }
.test-stage.is-entering, .test-stage.is-leaving { opacity: 0; transform: translateY(8px); }
.test-intro-description { max-width: 820px; margin: 0 auto; color: var(--color-text); text-align: center; font-size: 1.05rem; }
.test-duration { margin: 16px 0 0; color: var(--color-text-muted); text-align: center; font-size: 1rem; }
.test-start-row { display: flex; justify-content: center; margin-top: 22px; }
.mediation-test-card .test-start-button { min-width: 190px; padding: 12px 32px; border-radius: 16px; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.25; }
.test-start-button:hover { box-shadow: 0 0 26px rgba(179, 227, 237, .28); }
.test-progress-shell { margin-bottom: 18px; }
.test-progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--color-text-muted); font-size: .88rem; font-weight: 700; }
.test-progress-track { height: 7px; margin-bottom: 0; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .1); }
.test-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--color-primary-strong); transition: width 1s ease-in-out; }
.test-question-content { opacity: 1; transition: opacity .2s ease; }
.test-question-content.is-changing { opacity: 0; }
.test-question-title { margin-bottom: 18px; font-size: clamp(1.15rem, 2.4vw, 1.45rem); }
.test-options { display: grid; gap: 10px; }
.test-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .025);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.test-option:hover { border-color: rgba(210, 238, 244, .52); transform: translateY(-1px); }
.test-option.is-selected { border-color: var(--color-primary-strong); background: var(--color-primary-light); }
.test-option:focus-within { outline: 2px solid var(--color-primary-strong); outline-offset: 2px; }
.test-option input { width: 18px; height: 18px; margin: 5px 0 0; flex: 0 0 auto; accent-color: var(--color-primary-strong); }
.test-option-text { color: var(--color-text); font-size: 1.1rem; line-height: 1.55; }
.test-navigation { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.test-navigation .btn { min-width: 132px; }
.mediation-test-card .btn:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.test-results-label { margin: -6px 0 20px; color: var(--color-text); text-align: center; font-size: 1.15rem; font-weight: 700; }
.test-result-card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
}
.test-results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.test-result-card h3 { margin: 0 0 4px; font-size: 1.1rem; }
.test-result-card p { margin: 0; font-size: .94rem; }
.test-score { margin-bottom: 6px; color: var(--color-primary-strong); font-size: 2.1rem; font-weight: 800; line-height: 1.1; }
.test-score span { color: var(--color-text-muted); font-size: 1rem; font-weight: 600; }
.test-result-range { display: inline-block; margin-bottom: 10px; color: var(--color-primary); font-size: .84rem; font-weight: 700; }
@media (prefers-reduced-motion: reduce) {
  .test-stage, .test-question-content, .test-option, .test-progress-track span { transition: none; }
}

/* ============ Адаптив ============ */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero .photo-frame { max-width: 380px; margin: 0 auto; }
  .services-top-row { grid-template-columns: repeat(2, 1fr); }
  .mediation-test-card { max-width: 100%; }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    order: 3;
    padding: 12px 0 4px;
  }
  .main-nav.open { display: flex; }
  .header-inner { flex-wrap: wrap; }
  .nav-toggle { display: block; order: 2; }
  .header-cta .btn span.long { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .services-top-row { grid-template-columns: 1fr; }
  .document-picker { grid-template-columns: 1fr; }
  .document-preview-frame { height: 70vh; min-height: 360px; }
  .document-preview { padding: 12px; gap: 10px; }
  .document-viewer-panel { padding: 16px 10px 12px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .test-results-grid { grid-template-columns: 1fr; }
  .test-start-row { align-items: center; }
  .test-navigation .btn { min-width: 0; flex: 1; padding: 12px 14px; }
  .test-option { padding: 13px 12px; }
  section { padding: 44px 0; }
  .cta-banner { padding: 32px 20px; }
  .form-card { padding: 22px; }
}
