/* ==========================================================================
   Баланс и Право — Дизайн-система (направление «Деловой консалтинг»)
   Шрифты: Literata (заголовки) + Sofia Sans (текст интерфейса)
   ========================================================================== */

:root {
  --color-bg: #faf9f6;
  --color-surface: #ffffff;
  --color-surface-soft: #f4f3ef;
  --color-surface-tint: #f0fdf4;
  --color-text: #1c1917;
  --color-muted: #57534e;
  --color-line: #e7e5e4;
  --color-line-hover: #cbd5e1;
  --color-line-dark: #1c1917;
  --color-border-subtle: #f5f5f4;
  --color-accent: #0f766e;
  --color-accent-hover: #115e59;
  --color-accent-soft: #ccfbf1;
  --color-status-success: #047857;
  --color-status-wait: #b45309;

  /* Токены мессенджеров и статусов */
  --color-tg-bg: #f0f9ff;
  --color-tg-border: #bae6fd;
  --color-tg-text: #0369a1;
  --color-tg-hover: #e0f2fe;

  --color-wa-bg: #f0fdf4;
  --color-wa-border: #bbf7d0;
  --color-wa-text: #15803d;
  --color-wa-hover: #dcfce7;

  --color-badge-work-bg: #fef3c7;
  --color-badge-work-text: #92400e;
  --color-badge-success-bg: #dcfce7;
  --color-badge-success-text: #166534;

  --font-display: 'Literata', Georgia, serif;
  --font-body: 'Sofia Sans', system-ui, sans-serif;

  --content: 1140px;
  --space-section: clamp(56px, 7vw, 96px);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

/* Оптимизация композитинга и производительности прокрутки */
[id] { scroll-margin-top: 8rem; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font: 400 17px/1.65 var(--font-body);
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
  color: var(--color-text);
}

h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 700;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(26px, 3.8vw, 38px);
  font-weight: 600;
  margin-bottom: 16px;
}

h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

p {
  text-wrap: pretty;
  margin: 0 0 16px;
  color: var(--color-muted);
}

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

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* ==========================================================================
   Шапка
   ========================================================================== */

.site-header {
  border-bottom: 2px solid var(--color-line-dark);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.header-container {
  max-width: var(--content);
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrapper {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.1;
}

.brand-caption {
  font-size: 12px;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--color-accent);
}

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

/* ==========================================================================
   Кнопки
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, opacity .15s ease;
  border: 1px solid transparent;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-surface);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-secondary {
  background: transparent;
  border-color: var(--color-line-dark);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-surface-soft);
}

.btn-tg {
  background: var(--color-tg-bg);
  border-color: var(--color-tg-border);
  color: var(--color-tg-text);
}

.btn-tg:hover {
  background: var(--color-tg-hover);
}

.btn-wa {
  background: var(--color-wa-bg);
  border-color: var(--color-wa-border);
  color: var(--color-wa-text);
}

.btn-wa:hover {
  background: var(--color-wa-hover);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 14px;
}

/* ==========================================================================
   Секции и разметка
   ========================================================================== */

.section {
  padding: var(--space-section) 0;
}

.section-bordered {
  border-top: 1px solid var(--color-line);
}

.section-soft {
  background: var(--color-surface-soft);
}

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

.section-head {
  margin-bottom: 40px;
  max-width: 760px;
}

/* ==========================================================================
   Первый экран (Hero)
   ========================================================================== */

.hero {
  padding: clamp(40px, 6vw, 80px) 0;
}

.hero-lead {
  font-size: 19px;
  max-width: 720px;
  margin-bottom: 32px;
  color: var(--color-muted);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.hero-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  border-top: 1px solid var(--color-line);
  padding-top: 36px;
}

.pillar-item {
  border-left: 2px solid var(--color-accent);
  padding-left: 16px;
}

.pillar-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.pillar-desc {
  font-size: 15px;
  margin: 0;
  color: var(--color-muted);
}

/* ==========================================================================
   Сетка услуг
   ========================================================================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-card-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin-bottom: 10px;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
}

.service-list li {
  font-size: 15px;
  color: var(--color-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.service-list li svg {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--color-accent);
}

.service-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

/* ==========================================================================
   Тарифы
   ========================================================================== */

.tariffs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.tariff-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tariff-name {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tariff-sub {
  font-size: 15px;
  color: var(--color-muted);
  margin-bottom: 20px;
}

.tariff-price {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-line);
  padding-bottom: 16px;
}

.tariff-price span {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-muted);
}

.tariff-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}

.tariff-features li {
  font-size: 15px;
  color: var(--color-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-subtle);
  text-wrap: pretty;
}

/* ==========================================================================
   Шаги работы
   ========================================================================== */

.steps-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

.flow-step {
  border-top: 2px solid var(--color-line-dark);
  padding-top: 18px;
}

.flow-step-num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 8px;
}

.flow-step-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

.flow-step-text {
  font-size: 14px;
  color: var(--color-muted);
  margin: 0;
}

/* ==========================================================================
   Вопросы и ответы (FAQ)
   ========================================================================== */

.faq-list {
  max-width: 840px;
  margin: 0 auto;
  border-top: 1px solid var(--color-line);
}

.faq-item {
  border-bottom: 1px solid var(--color-line);
}

.faq-toggle {
  width: 100%;
  text-align: left;
  padding: 20px 0;
  background: transparent;
  border: none;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-toggle svg {
  flex-shrink: 0;
  transition: transform .2s ease;
  color: var(--color-accent);
}

.faq-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.faq-content {
  padding-bottom: 20px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-muted);
  display: none;
}

.faq-content.open {
  display: block;
}

/* ==========================================================================
   Контакты и подвал
   ========================================================================== */

.contacts-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

@media (max-width: 800px) {
  .contacts-layout {
    grid-template-columns: 1fr;
  }
}

.contact-direct-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  padding: 28px;
}

.contact-row {
  margin-bottom: 20px;
}

.contact-row span {
  display: block;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 4px;
}

.contact-row strong {
  font-size: 17px;
  color: var(--color-text);
}

.site-footer {
  border-top: 1px solid var(--color-line);
  background: var(--color-bg);
  padding: 28px 0;
  font-size: 14px;
  color: var(--color-muted);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

/* ==========================================================================
   Адаптивность для мобильных экранов
   ========================================================================== */

@media (max-width: 768px) {
  .header-container { align-items: flex-start; flex-direction: column; }
  .main-nav { flex-wrap: wrap; column-gap: 16px; row-gap: 8px; }

  .header-actions .btn-secondary {
    display: none;
  }

  .segment-row {
    flex-direction: column;
  }

  .contacts-layout {
    gap: 24px;
  }
}

@media (max-width: 440px) {
  .header-container {
    padding: 12px 14px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-caption {
    font-size: 11px;
  }

  .header-actions .btn {
    padding: 6px 10px;
    font-size: 13px;
  }

  .container {
    padding: 0 14px;
  }

  .status-lookup-bar {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.main-nav a[aria-current="page"] {
  color: var(--color-accent-hover);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}
.site-directions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 28px;
}
.service-steps {
  max-width: 45rem;
}
.service-steps > div, .price-table tr {
  border-bottom: 1px solid var(--color-line);
}
.service-steps > div { padding: 14px 0; }
.service-steps dt { font-weight: 600; }
.service-steps dd { margin: 4px 0 0; }
.service-steps a { text-decoration: underline; }
.price-group + .price-group { margin-top: 32px; }
.price-table {
  width: 100%;
  max-width: 52rem;
  border-collapse: collapse;
}
.price-table caption {
  text-align: left;
  font: 600 1.35rem var(--font-display);
  margin-bottom: 10px;
}
.price-table th, .price-table td { padding: 12px 8px; text-align: left; }
.price-table th[scope="row"] { font-weight: 500; }
.price-table td { font-variant-numeric: tabular-nums; }
