/* ============================================================
   marketing-ai-pk.ru — дизайн-система (этап 3)
   Сдержанный B2B: сталь-синий акцент, Inter Variable,
   mobile-first. Никаких градиентов ради градиентов.
   ============================================================ */

/* --- Шрифт (self-hosted Inter Variable) --- */
@font-face {
  font-family: "InterVar";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "InterVar";
  src: url("/assets/fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* --- Дизайн-токены --- */
:root {
  /* Палитра */
  --ink: #101828;            /* основной текст */
  --ink-soft: #475467;       /* вторичный текст */
  --ink-faint: #667085;      /* мета-текст */
  --line: #e4e7ec;           /* разделители */
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --accent: #0f4c81;         /* сталь-синий */
  --accent-strong: #0c3b64;  /* hover */
  --accent-soft: #eaf1f7;    /* подложки */
  --flagship: #0f3a5f;       /* тёмная плашка флагмана */
  --flagship-ink: #d7e3ee;

  /* Шкала типографики */
  --fs-body: 1rem;
  --fs-lead: 1.125rem;
  --fs-h3: 1.0625rem;
  --fs-h2: clamp(1.375rem, 2.5vw, 1.75rem);
  --fs-h1: clamp(2rem, 4.5vw, 2.9rem);

  /* Сетка и ритм */
  --container: 1120px;
  --gutter: 20px;
  --sec-y: clamp(2.75rem, 6vw, 4.75rem);
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 6px 24px rgba(16, 24, 40, 0.08);
  --shadow-hover: 0 10px 32px rgba(16, 24, 40, 0.12);
}

/* --- База --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "InterVar", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Типографика --- */
h1, h2, h3 { color: var(--ink); line-height: 1.22; margin: 0 0 0.6em; }
h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: -0.022em;
}
h2 { font-size: var(--fs-h2); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.008em; }
p { margin: 0 0 0.9em; }
strong { font-weight: 650; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
code { font-size: 0.92em; background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; }

/* --- Сетка --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: var(--sec-y); }
.page-main { padding-bottom: var(--sec-y); }
.section-lead { color: var(--ink-soft); max-width: 46rem; }

/* --- Шапка --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 18px;
  padding-block: 12px; flex-wrap: wrap;
}
.brand { margin-right: auto; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub {
  display: block; font-size: 0.69rem; font-weight: 450;
  color: var(--ink-faint); letter-spacing: 0.02em;
}
.site-nav { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.site-nav > a {
  color: var(--ink-soft); font-size: 0.94rem; font-weight: 500;
  padding: 6px 2px; text-decoration: none;
}
.site-nav > a:hover { color: var(--ink); text-decoration: none; }
.site-nav > a[aria-current="page"] { color: var(--accent); font-weight: 650; }

.nav-dropdown { position: relative; }
.nav-dropdown summary {
  cursor: pointer; list-style: none;
  color: var(--ink-soft); font-size: 0.94rem; font-weight: 500; padding: 6px 2px;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown[open] summary, .nav-dropdown summary:hover { color: var(--ink); }
.nav-dropdown ul {
  list-style: none; margin: 0; padding: 6px;
  position: absolute; left: -6px; top: calc(100% + 4px); z-index: 60;
  min-width: 300px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
}
.nav-dropdown li + li { border-top: 1px solid var(--bg-soft); }
.nav-dropdown a {
  display: block; padding: 9px 12px; border-radius: 8px;
  color: var(--ink); font-size: 0.9rem; font-weight: 500; text-decoration: none;
}
.nav-dropdown a:hover { background: var(--accent-soft); text-decoration: none; }
.nav-dropdown a span { display: block; color: var(--ink-faint); font-size: 0.78rem; font-weight: 400; margin-top: 2px; }

.header-cta { display: flex; gap: 8px; }

/* --- Кнопки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px;
  font-size: 0.92rem; font-weight: 600; letter-spacing: -0.005em;
  text-decoration: none; transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
  cursor: pointer; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); color: #fff; }
.btn-ghost { color: var(--accent); border-color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); }
.btn-lg { padding: 13px 24px; font-size: 1rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* --- Hero --- */
.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); max-width: 50rem; }
.hero-lead { color: var(--ink-soft); font-size: var(--fs-lead); line-height: 1.65; max-width: 42rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 1.4rem 1rem; }
.hero-facts { color: var(--ink-faint); font-size: 0.84rem; }

/* --- Карточки --- */
.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; background: var(--bg);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.card:hover { border-color: #cfd8e3; box-shadow: var(--shadow); }
.card h3 { margin-bottom: 0.45em; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }
.card-flagship { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.card .card-link { display: inline-block; margin-top: 12px; font-size: 0.9rem; font-weight: 600; }

/* --- Списки, этапы, FAQ --- */
.check-list, .steps, .result-list { max-width: 46rem; padding: 0; list-style: none; }
.check-list li, .steps li, .result-list li { margin: 0 0 0.8em; }
.check-list li { padding-left: 26px; position: relative; }
.check-list li:before {
  content: ""; position: absolute; left: 2px; top: 0.52em;
  width: 12px; height: 6px; border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.steps, .result-list { counter-reset: step; }
.steps > li, .result-list > li {
  counter-increment: step; padding-left: 46px; position: relative;
}
.steps > li:before, .result-list > li:before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em;
}
.steps h3 { margin-bottom: 0.25em; }
.steps p, .result-list p { margin: 0; color: var(--ink-soft); }
.result-list { max-width: none; }

.faq { max-width: 46rem; }
.faq dt { font-weight: 650; margin-top: 1.2em; }
.faq dd { margin: 0.4em 0 0; color: var(--ink-soft); }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.75rem; font-weight: 650; letter-spacing: 0.01em;
  margin-bottom: 0.8em;
}
.meta-muted { color: var(--ink-faint); font-size: 0.88rem; max-width: 46rem; }

/* --- Параметры-«таблетки» --- */
.pill-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 1.2em 0; }
.pill {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px;
  background: var(--bg); font-size: 0.92rem; font-weight: 650; letter-spacing: -0.005em;
}

/* --- Флагманский блок (тёмная панель) --- */
.section-flagship {
  border-radius: var(--radius-lg);
  background: var(--flagship);
  color: #fff;
  padding: clamp(1.75rem, 4vw, 3rem);
}
.section-flagship h2, .section-flagship .section-lead { color: #fff; }
.section-flagship .section-lead { color: var(--flagship-ink); max-width: none; }
.section-flagship .pill-list { margin: 1.4em 0 1.6em; }
.section-flagship .pill {
  background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.22); color: #fff;
}
.section-flagship .btn-primary { background: #fff; color: var(--flagship); }
.section-flagship .btn-primary:hover { background: #e9eef4; }

/* --- Блок фактов экспертизы --- */
.facts .card { background: var(--bg-soft); border-color: transparent; }
.facts .card:hover { border-color: var(--line); }
.facts .card h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }

/* --- Плашка-финал CTA --- */
.cta-band { border-top: 1px solid var(--line); margin-top: var(--sec-y); padding-top: var(--sec-y); }

/* --- Таблицы (календарь аудита и др.) --- */
.table-scroll { overflow-x: auto; max-width: 46rem; }
.data-table { border-collapse: collapse; width: 100%; min-width: 30rem; }
.data-table th, .data-table td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
  font-size: 0.94rem;
  vertical-align: top;
}
.data-table th { background: var(--bg-soft); font-weight: 650; }
.data-table td:first-child { white-space: nowrap; color: var(--ink-soft); }

/* Раздел «предмет анализа/проектирования» внутри карточки модуля */
.card-subject {
  margin-top: 0.7em;
  padding-top: 0.7em;
  border-top: 1px dashed var(--line);
  font-size: 0.88rem;
  line-height: 1.5;
}
.card-subject strong { display: block; margin-bottom: 0.2em; }

/* Явный якорный скролл: форма заявки на странице аудита не прячется под шапку */
:target { scroll-margin-top: 16px; }

/* --- Форма --- */
.lead-form { max-width: 34rem; display: grid; gap: 14px; margin-bottom: 2rem; }
.form-row { display: grid; gap: 5px; }
.lead-form label { font-size: 0.82rem; font-weight: 650; color: var(--ink-soft); }
.lead-form input, .lead-form textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit; color: var(--ink); background: var(--bg);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.lead-form input:hover, .lead-form textarea:hover { border-color: #cfd8e3; }
.lead-form input:focus, .lead-form textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.lead-form input[aria-invalid="true"] { border-color: var(--ink-soft); }
.form-consent {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.82rem; color: var(--ink-faint); line-height: 1.45;
}
.form-consent input { width: auto; margin-top: 3px; accent-color: var(--accent); }
.lead-form .form-error { color: #9a3324; font-size: 0.86rem; margin: 0; }
.lead-form .form-success { color: #1f6b3a; font-size: 0.92rem; font-weight: 550; margin: 0; }

/* Отдельное согласие (ст. 9 ФЗ-152): чекбокс + раскрывающийся полный текст */
.consent-block { display: grid; gap: 6px; }
.form-consent-details summary {
  cursor: pointer; list-style: none;
  font-size: 0.8rem; font-weight: 650; color: var(--ink-soft);
  padding: 2px 0;
}
.form-consent-details summary::-webkit-details-marker { display: none; }
.form-consent-details summary:hover { color: var(--accent); }
.form-consent-details[open] summary { color: var(--accent); }
.consent-text {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-soft); padding: 14px 16px; margin-top: 4px;
}
.consent-text p { font-size: 0.8rem; line-height: 1.55; color: var(--ink-soft); margin: 0 0 0.7em; }
.consent-text p:last-child { margin-bottom: 0; }

/* --- Футер --- */
.site-footer {
  background: var(--ink); color: #aab2be;
  padding: 2.5rem 0 2.75rem; margin-top: var(--sec-y);
}
.site-footer p { margin: 5px 0; font-size: 0.88rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #cfdce9; }
.footer-brand { font-weight: 650; color: #fff; font-size: 1rem; }
.draft-note { opacity: 0.65; color: #aab2be; }
.site-footer .container { max-width: var(--container); }

/* ============================================================
   Адаптив: mobile — первый breakpoint, дальше расширение
   ============================================================ */
@media (min-width: 640px) {
  .cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .hero-cta .btn { min-width: auto; }
}

@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .section-flagship .pill-list { gap: 14px; }
}

@media (max-width: 639px) {
  .header-cta { display: none; }          /* CTA живёт в hero каждой страницы */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .cta-band .btn { width: 100%; }
  .steps > li, .result-list > li { padding-left: 40px; }
  .steps > li:before, .result-list > li:before { width: 26px; height: 26px; font-size: 0.72rem; }
  .pill { flex: 1 1 calc(50% - 10px); text-align: center; padding: 12px 8px; }
  .nav-dropdown ul { min-width: 260px; }
}

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