/* Фирстиль v2 для всех страниц (23.10.2026) — слой поверх style.css, подключён в base.html после него.
   Цвета, шрифты и формы — с новой главной (home-v2.css) и доски «Фирстиль сайта» на холсте.
   Разметку и тексты страниц не трогаем: только переопределяем токены и вид общих компонентов.
   Правила бренда: красный — только то, что ведёт к записи; на ярко-зелёном #76B82A текста нет,
   зелёные фоны — #4C7F11 с белым текстом; жёлтого нет; заголовки и цифры — ARCO. */

:root {
  --bg: #FFFFFF;
  --bg-2: #FFF3EB;
  --bg-alt: #FFF3EB;
  --dark: #1B1B1B;
  --dark-2: #2B2522;
  --text-muted: #4A4542;
  --text-faint: #6B635E;   /* #7A736E давал 4,3:1 на молочном — ниже WCAG AA */
  --border: #EFE4DB;
  --border-soft: #EFE4DB;

  /* Кнопки и текст «Записаться»: белый на #F43447 — 3,9:1, ниже WCAG AA (4,5:1).
     Насыщенный красный бренда (#D42638) даёт 5,1:1, поэтому он и есть --red. */
  --red: #D42638;
  --red-hover: #B81E2F;
  --red-active: #9E1828;
  --red-badge-bg: #FDE4E6;
  --red-badge-text: #B81E2F;

  --green: #4C7F11;
  --green-bg: #EDF6E1;
  --green-text: #3F6A0E;   /* текст на #EDF6E1: #4C7F11 давал 4,3:1 */
  --neutral-line: #EFE4DB;
  --neutral-soft: #FFF3EB;

  --teal-hover: #00726F;
  --teal-badge-text: #00726F;
  --coral-badge-text: #A8361A;   /* #C23F1F на #FDE5E0 — 4,3:1 */

  /* жёлтого в фирстиле нет: «внимание / рекомендуем» — красным оттенком, «эмоции» — оранжевым */
  --yellow: #F43447;
  --yellow-badge-bg: #FDE4E6;
  --yellow-badge-text: #B81E2F;
  --amber: #E86E1E;
  --amber-hover: #C95A10;
  --amber-badge-bg: #FDEBDD;
  --amber-badge-text: #B4500C;

  --radius-sm: 16px;
  --radius-md: 22px;
  --radius-lg: 36px;
  --radius-card: 22px;

  --v2-milk: #FFF3EB;
  --v2-line: #EFE4DB;
  --v2-green-accent: #76B82A;
}

body { background: #FFFFFF; }

/* ---------- Заголовки: ARCO ---------- */
main .page-hero h1,
main .service-hero h1,
main .section-title,
main .article-body h2,
main .akcia-title,
main .cases-teaser-title,
main .cases-page-cta p,
main .category-head-titles h2,
main > section h1 {
  font-family: var(--font-accent);
  font-weight: 400;
  letter-spacing: .01em;
}
main .page-hero h1 { font-size: clamp(32px, 4vw, 54px); line-height: 1.04; max-width: 900px; margin-left: auto; margin-right: auto; }
main .page-hero .hero-lead { max-width: 620px; margin-left: auto; margin-right: auto; }
main .service-hero h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.06; }
main .section-title { font-size: clamp(28px, 3.2vw, 44px); line-height: 1.08; }
main .article-body h2 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.1; margin-top: 1.6em; }
main .akcia-title { line-height: 1.1; }
main .akcia--featured .akcia-title { font-size: clamp(24px, 2.4vw, 32px); }
main .akcia-title,
main .article-body h2 { color: var(--dark); }
/* Юридические тексты остаются в Montserrat — их читают, а не просматривают */
main .legal-doc h2, main .sveden-content h2 { font-family: var(--font-head); font-weight: 700; }

.section-kicker { color: var(--green-text); font-weight: 700; letter-spacing: .06em; }
.hero-lead, .section-lead { color: var(--text-muted); }

/* ---------- Шапки страниц: молочный фон + пазл ---------- */
.page-hero,
.service-hero {
  background: var(--v2-milk);
  position: relative;
  isolation: isolate;
}
.page-hero { padding: 64px 0 64px; }
.service-hero { padding: 32px 0 56px; }
/* хлебные крошки над молочной шапкой — тоже на молочном, во всю ширину */
.breadcrumb:has(+ .page-hero),
.breadcrumb:has(+ .service-hero) {
  background: var(--v2-milk);
  box-shadow: 0 0 0 100vmax var(--v2-milk);
  clip-path: inset(0 -100vmax);
  padding-bottom: 8px;
  margin-bottom: 0;
}
.page-hero + .section,
.service-hero + .section { padding-top: 64px; }
.service-hero + .section--tight { padding-top: 40px; }

@media (min-width: 1180px) {
  .page-hero::after {
    content: "";
    position: absolute;
    right: max(32px, calc((100vw - 1240px) / 2));
    bottom: 28px;
    width: 170px;
    height: 140px;
    background: url("../img/brand/pz-cluster.svg") center / contain no-repeat;
    transform: rotate(-6deg);
    z-index: -1;
    pointer-events: none;
  }
  .page-hero::before {
    content: "";
    position: absolute;
    left: max(24px, calc((100vw - 1240px) / 2 - 20px));
    top: 36px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 12px solid #F43447;
    box-sizing: border-box;
    z-index: -1;
    pointer-events: none;
  }
}
.page-hero { margin-bottom: 34px; }

/* фото в шапке услуги: скругление как у деталей. Если фото нет (серая заглушка с подписью) —
   заглушку прячем, текст шапки занимает всю ширину, а справа за контейнером — пазл. */
.service-hero-photo { border-radius: var(--radius-lg); }
.service-hero-photo:not(:has(*)) { display: none; }
.service-hero-inner:not(:has(.service-hero-photo > *)) { grid-template-columns: 1fr; }
.service-hero-inner:not(:has(.service-hero-photo > *)) > div:first-child { max-width: 720px; }
@media (min-width: 1280px) {
  .service-hero:not(:has(.service-hero-photo > *))::after {
    content: "";
    position: absolute;
    right: max(32px, calc((100vw - 1240px) / 2));
    top: 40px;
    width: 230px;
    height: 176px;
    background: url("../img/brand/pz-placeholder.svg") center / contain no-repeat;
    transform: rotate(5deg);
    z-index: -1;
    pointer-events: none;
  }
}

/* цена в шапке — ARCO, как на главной */
.route-price, .price-tag { font-family: var(--font-accent); font-weight: 400; letter-spacing: .01em; }
.service-price { font-size: 22px; }

/* ---------- Ритм секций ---------- */
.section { padding: 80px 0; }
.section--tight { padding-top: 16px; padding-bottom: 0; }
.section-alt { background: var(--v2-milk); }
@media (max-width: 899px) {
  .section { padding: 48px 0; }
  .page-hero { padding: 40px 0 36px; margin-bottom: 0; }
  .service-hero { padding: 20px 0 36px; }
  .page-hero + .section, .service-hero + .section { padding-top: 40px; }
}

/* ---------- Карточки: скругление 22, без теней, линия #EFE4DB ---------- */
.service-card, .article-card, .review-card, .document-card, .need-block, .case-card, .case-slide,
.trust-card, .trust-review, .akcia, .route-card, .service-symptom-card, .parent-care-card,
.specialist-card, .akcii-faq-item {
  border-radius: var(--radius-card);
  box-shadow: none;
}
.service-card, .article-card, .service-symptom-card, .akcia, .route-card, .parent-care-card {
  border: 2px solid var(--v2-line);
}
.service-card:hover, .article-card:hover, .route-card:hover, .parent-care-card:hover {
  box-shadow: none;
  border-color: #E7D8CB;
  transform: translateY(-3px);
}
/* на молочном фоне карточки белые и без линии */
.section-alt .service-card, .section-alt .article-card, .section-alt .service-symptom-card,
.section-alt .route-card, .section-alt .parent-care-card,
.service-hero .service-symptom-card { border-color: transparent; background: #FFFFFF; }
.service-card-foot { border-top: 2px dashed var(--v2-line); }

/* ---------- Акции ---------- */
.akcia { overflow: hidden; }
.akcia::before { width: 6px; }
.akcia--featured { box-shadow: none; border-width: 2px; }
.akcia-stage { font-weight: 700; letter-spacing: .06em; }
.akcii-hero .akcii-deadline { border-radius: 999px; }

/* ---------- FAQ ---------- */
.akcii-faq-item { border: 2px solid var(--v2-line); background: #FFFFFF; padding: 2px 22px; }
.section-alt .akcii-faq-item { border-color: transparent; }
.akcii-faq-item summary { font-size: 16px; padding: 18px 0; }
.akcii-faq-item summary::after { font-size: 22px; line-height: 1; }

/* ---------- Плашки и чипы ---------- */
.badge-pill, .article-tag, .route-pain-pill, .ctx-offer-badge { border-radius: 999px; }
.route-pain-pill { background: var(--green-bg); color: var(--green-text); font-weight: 600; }
.additional-service-pill { border-radius: 999px; border-width: 2px; }
.filters-row a, .filters-row button { border-radius: 999px; }

/* ---------- «Почему родители нам доверяют» ---------- */
.trust-section { background: var(--v2-milk); }
.trust-card { background: #FFFFFF; padding: 24px; }
.trust-leads { display: flex; flex-direction: column; gap: 16px; }
.trust-leads .trust-lead + .trust-lead { padding-top: 16px; border-top: 2px dashed var(--v2-line); }
.trust-kicker { color: var(--green-text); }
.trust-lead-name { font-size: 18px; }
/* учёная степень — фиолетовым, как плашка «Кандидат наук» у специалистов */
.trust-lead-badge, .specialist-phd {
  background: #EAE6F4;
  color: #5B4B9E;
}
.trust-fact b { font-family: var(--font-accent); font-weight: 400; font-size: 22px; letter-spacing: .01em; }
.trust-review-stars { color: #F43447; }
.trust-review { padding: 20px 22px; }

/* ---------- Текст страниц (о центре, статьи) ---------- */
.article-body { font-size: 17px; line-height: 1.65; }
.article-body a { color: var(--dark); text-decoration: underline; text-decoration-color: #F43447; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.article-body a:hover { color: #F43447; }
.article-body ul { padding-left: 0; list-style: none; }
.article-body ul li { position: relative; padding-left: 26px; margin-bottom: 10px; }
.article-body ul li::before {
  content: ""; position: absolute; left: 2px; top: .5em;
  width: 8px; height: 8px; border-radius: 50%; border: 3px solid #F43447; background: #FFFFFF;
}

/* ---------- Ссылки и мелочи ---------- */
.link-arrow { text-underline-offset: 4px; }
.legal-doc a { color: var(--dark); text-decoration-color: #F43447; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sveden-props { border-top-color: var(--v2-line); }
.sveden-props dt, .sveden-props dd { border-bottom-color: var(--v2-line); }
.search-page-form input { border-radius: 14px; border-width: 2px; border-color: var(--v2-line); }

@media (prefers-reduced-motion: reduce) {
  .service-card:hover, .article-card:hover, .route-card:hover, .parent-care-card:hover { transform: none; }
}

/* ==========================================================================
   Доступность, WCAG 2.1 AA (аудит 26.10.2026)
   ========================================================================== */

/* Текст только для экранных чтецов (подписи полей формы записи и т.п.) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* «Перейти к содержимому» — первая ссылка страницы, видна только при фокусе с клавиатуры */
.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 1000;
  padding: 10px 18px; border-radius: 999px;
  background: var(--dark); color: #FFFFFF; font-weight: 700; text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
main:focus { outline: none; }

/* Подвал: rgba(255,255,255,.35) на #2B2522 — 3,1:1 */
.footer-copy, .footer-legal-org { color: rgba(255, 255, 255, .62); }

/* Красная строка «Диагностика −50%»: зачёркнутая цена и чип «Записаться» были светлее фона */
.offer-recall-price s { opacity: 1; }
.offer-recall-cta,
.offer-recall:hover .offer-recall-cta,
.offer-recall:focus-visible .offer-recall-cta { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6); }
.offer-recall-cta { background: rgba(0, 0, 0, .16); }
.offer-recall:hover .offer-recall-cta,
.offer-recall:focus-visible .offer-recall-cta { background: rgba(0, 0, 0, .28); }
@media (max-width: 700px) {
  .offer-recall-cta { background: rgba(0, 0, 0, .16); }
}

/* «Результат» в историях: цвет акцента (#4C7F11) на его же тинте — 4,3:1; берём текстовый оттенок */
.case-label-result { color: var(--case-text, var(--green-text)); }

/* Бирюзовая плашка-призыв: белый на #009995 — 3,5:1 */
.cta-band-teal { background: var(--teal-hover); }
.cta-band-teal p { color: #FFFFFF; }

.article-body a:hover { color: var(--red); }

/* Телефоны ≤400px (360px — самые частые Android): логотип не сжимался, и кнопка меню
   уезжала за правый край, появлялась горизонтальная прокрутка. */
@media (max-width: 400px) {
  .header-topbar-inner > .logo { flex-shrink: 1; min-width: 0; overflow: hidden; }
  .header-topbar-inner > .logo .logo-img { height: auto; max-height: 28px; max-width: 100%; }
}

/* ---------- Посадочные: доверие на первом экране + квиз (29.10.2026) ---------- */
.hero-trust { margin-top: 22px; display: grid; gap: 10px; font-size: 14px; color: var(--text-muted); }
.hero-trust-leads { display: flex; align-items: center; gap: 12px; }
.hero-trust-leads b { color: var(--dark); font-weight: 600; }
.hero-trust-faces { display: inline-flex; flex-shrink: 0; }
.hero-trust-faces img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--white); }
.hero-trust-faces img + img { margin-left: -10px; }
.hero-trust-facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hero-trust-facts li { position: relative; }
.hero-trust-facts li + li::before { content: '·'; position: absolute; left: -10px; }
.hero-trust-facts a { color: inherit; text-decoration: none; }
.hero-trust-facts b { color: var(--dark); }
.service-price-note s { color: var(--text-faint); }

.diag-quiz { background: var(--green-bg); border-radius: var(--radius-card); padding: 28px 32px; }
.diag-quiz-kicker { display: inline-block; font-size: 13px; font-weight: 600; color: var(--green-text); text-transform: uppercase; letter-spacing: .04em; }
.diag-quiz-title { margin: 6px 0 18px; font-size: clamp(21px, 2.2vw, 28px); line-height: 1.2; }
.diag-quiz-q { margin: 0 0 12px; font-weight: 600; color: var(--dark); }
.diag-quiz-n { margin-right: 8px; font-weight: 500; color: var(--text-faint); }
.diag-quiz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.diag-quiz-opt {
  padding: 14px 16px; border: 1px solid var(--neutral-line); border-radius: var(--radius-xs);
  background: var(--white); color: var(--dark); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.diag-quiz-opt:hover, .diag-quiz-opt:focus-visible { border-color: var(--green-text); box-shadow: 0 0 0 2px rgba(76, 127, 17, .18); }
.diag-quiz-back { margin-top: 12px; padding: 4px 0; background: none; border: 0; font: inherit; font-size: 13px; color: var(--text-muted); text-decoration: underline; cursor: pointer; }
.diag-quiz-verdict { margin: 0 0 10px; font-size: 17px; line-height: 1.5; color: var(--dark); }
.diag-quiz-plan { margin: 0 0 18px; color: var(--text-muted); }
.diag-quiz-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.diag-quiz-alt { color: var(--green-text); font-weight: 600; }
.diag-quiz-form { margin-top: 4px; }
.diag-quiz-form-title { margin: 0 0 12px; font-weight: 600; color: var(--dark); }
.diag-quiz-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.diag-quiz-fields input {
  min-width: 0; border: 1px solid var(--neutral-line); border-radius: var(--radius-xs); padding: 14px 16px;
  background: var(--white); color: var(--dark); font: inherit; font-size: 16px;
}
.diag-quiz-fields input:focus-visible { outline: none; border-color: var(--green-text); box-shadow: 0 0 0 2px rgba(76, 127, 17, .18); }
.diag-quiz-fields input[aria-invalid="true"] { border-color: var(--red); }
.diag-quiz-error { margin: 10px 0 0; color: var(--red); font-size: 13px; }
.diag-quiz-error[hidden], .diag-quiz-done[hidden], .diag-quiz-form[hidden] { display: none; }
.diag-quiz-consent { text-align: left; margin: 10px 0 12px; }
.diag-quiz-done { padding: 16px 18px; border-radius: var(--radius-xs); background: var(--white); }
.diag-quiz-done:focus { outline: none; }
.diag-quiz-done-title { margin: 0 0 6px; font-weight: 700; font-size: 17px; color: var(--green-text); }
.diag-quiz-done p { margin: 0; }
.diag-quiz-done p + p { margin-top: 4px; color: var(--text-muted); }
.diag-quiz-step[hidden] { display: none; }
@media (max-width: 600px) {
  .diag-quiz { padding: 22px 18px; }
  .diag-quiz-options { grid-template-columns: 1fr; }
  .diag-quiz-cta .btn { width: 100%; justify-content: center; }
  .diag-quiz-fields { grid-template-columns: 1fr; }
  .diag-quiz-fields .btn { width: 100%; justify-content: center; }
  .hero-trust { font-size: 13px; }
  /* Длинные заголовки посадочных на телефоне занимали весь первый экран — кнопка уезжала вниз. */
  main .service-hero h1 { font-size: 26px; line-height: 1.12; }
  .service-hero .hero-lead { font-size: 15px; line-height: 1.45; }
}

/* Cookie-баннер на телефоне — одна строка, не закрывает кнопки записи (29.10.2026). */
.cookie-banner-short { display: none; }
@media (max-width: 600px) {
  .cookie-banner-long { display: none; }
  .cookie-banner-short { display: inline; }
  .cookie-banner-inner { padding: 6px 12px; }
  .cookie-banner-text { font-size: 12px; }
  .cookie-banner-btn { padding: 6px 14px; font-size: 13px; }
}
