/* ============================================
   Aschool для школ (aschool.pro) · b2b.css
   Стили секций продающего лендинга, которых нет в
   базовом components.css. Опирается на переменные
   бренда из main.css (--brand-*). Палитра не дублируется.
   ============================================ */

/* ── Hero highlight ─────────────────────────── */
.hero h1 .hl {
  color: var(--brand-red);
  white-space: nowrap;
}
@media (max-width: 560px) {
  .hero h1 .hl { white-space: normal; }
}

/* ── Feature icon (решение) ─────────────────── */
.feature-ic {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 14px;
}

/* ── Pain cards (боли директоров) ───────────── */
.pain-grid { align-items: stretch; }
.pain-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 22px 56px;
  box-shadow: var(--shadow);
}
.pain-card p { margin: 0; color: var(--text); }
.pain-card b { color: var(--brand-dark); }
.pain-x {
  position: absolute;
  left: 20px; top: 22px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(var(--brand-red-rgb), .12);
  color: var(--brand-red);
  font-size: 13px; font-weight: 700;
}
.pain-card-solution {
  background: rgba(var(--brand-orange-rgb), .07);
  border-color: rgba(var(--brand-orange-rgb), .35);
}
.pain-arrow {
  position: absolute;
  left: 20px; top: 22px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand-orange);
  color: #fff;
  font-size: 14px; font-weight: 700;
}
.pain-card-solution b { color: var(--brand-orange); }

/* ── Compare table (самостоятельно vs Aschool) ─ */
/* Desktop: обычная таблица. Mobile ≤720px: карточки строк
   без горизонтальной прокрутки страницы (без overflow-x:hidden). */
.compare-wrap {
  width: 100%;
  max-width: 100%;
}
.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 15px;
  table-layout: fixed;
}
.compare-table th, .compare-table td {
  padding: 15px 18px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  word-wrap: break-word;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.compare-table thead th {
  background: var(--brand-dark);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.compare-table tbody th {
  font-weight: 600;
  color: var(--brand-dark);
  width: 34%;
}
.compare-table tbody td { color: var(--text-m); }
.compare-table .compare-hl {
  background: rgba(var(--brand-orange-rgb), .08);
  color: var(--brand-orange);
  font-weight: 700;
}
.compare-table thead th.compare-hl {
  background: var(--brand-orange);
  color: #fff;
}
.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 720px) {
  .compare-wrap {
    overflow: visible;
  }
  .compare-table,
  .compare-table thead,
  .compare-table tbody,
  .compare-table tr,
  .compare-table th,
  .compare-table td {
    display: block;
    width: 100%;
    max-width: 100%;
  }
  .compare-table {
    border: none;
    background: transparent;
    overflow: visible;
    table-layout: auto;
  }
  .compare-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .compare-table tbody tr {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 14px;
    padding: 0;
    overflow: hidden;
  }
  .compare-table tbody tr:last-child {
    margin-bottom: 0;
  }
  .compare-table tbody th {
    width: 100%;
    padding: 14px 16px;
    background: var(--brand-dark);
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    border-bottom: none;
  }
  .compare-table tbody td {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 10px 12px;
    align-items: start;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    line-height: 1.45;
  }
  .compare-table tbody td:last-child {
    border-bottom: none;
  }
  .compare-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-m);
    font-size: 12.5px;
    line-height: 1.35;
  }
  .compare-table tbody td.compare-hl {
    background: rgba(var(--brand-orange-rgb), .08);
    color: var(--brand-orange);
  }
  .compare-table tbody td.compare-hl::before {
    color: var(--brand-orange);
  }
}

/* ── Trust panel (лицензия / аккредитация) ──── */
.trust-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: stretch;
}
.trust-org, .trust-why {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.trust-org {
  border-color: rgba(var(--brand-blue-rgb), .30);
  border-top: 4px solid var(--brand-blue);
}
.trust-org h3 { margin: 0 0 4px; color: var(--brand-dark); }
.trust-reqs {
  list-style: none;
  margin: 18px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trust-reqs li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 15px;
}
.trust-reqs li span { color: var(--text-m); }
.trust-reqs li b {
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.trust-note {
  font-size: 13.5px;
  color: var(--text-m);
  margin: 0 0 18px;
  line-height: 1.55;
}
.trust-why h4 {
  color: var(--brand-blue);
  margin: 0 0 12px;
  font-size: 17px;
}
.trust-why p { margin: 0; color: var(--text); }
.trust-why b { color: var(--brand-dark); }

@media (max-width: 768px) {
  .trust-panel { grid-template-columns: 1fr; }
}

/* ── Stat cards — расширение ────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--brand-orange);
  line-height: 1.1;
  margin-bottom: 10px;
}
.stat-card p { margin: 0; color: var(--text-m); font-size: 15px; }

/* ── Цена бездействия (под болями) ──────────── */
.pain-cost {
  margin: 26px auto 0;
  max-width: 760px;
  text-align: center;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: rgba(var(--brand-red-rgb), .06);
  border: 1px solid rgba(var(--brand-red-rgb), .22);
  border-radius: var(--radius);
  padding: 18px 24px;
}
.pain-cost b { color: var(--brand-red); }

/* ── Калькулятор экономики ──────────────────── */
/* Партнёрское вознаграждение — визуально главная строка */
.calc-row-partner {
  background: rgba(var(--brand-orange-rgb), .10);
  border-radius: 10px;
  margin: 4px -8px;
  padding-left: 8px !important;
  padding-right: 8px !important;
}
.calc-row-partner span {
  color: var(--brand-dark);
  font-weight: 600;
}
.calc-row-partner b {
  color: var(--brand-orange);
  font-size: clamp(20px, 4vw, 26px);
  white-space: nowrap;
}
.calc-result b {
  white-space: nowrap;
}
.calc-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
  align-items: start;
}
.calc-result {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.calc-result { border-top: 4px solid var(--brand-orange); }
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 15px;
}
.calc-row span { color: var(--text-m); }
.calc-row b {
  color: var(--brand-dark);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* #calcAvgRow (js/main.js toggles the [hidden] attribute) — .calc-row above
   sets display:flex with author-level specificity equal to [hidden], which
   would otherwise beat the UA stylesheet's `[hidden]{display:none}` and keep
   the row visibly rendered even while hidden. Explicit reset restores the
   native hidden behaviour. */
.calc-row[hidden] { display: none; }
.calc-note {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-m);
  background: rgba(var(--brand-orange-rgb), .07);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

@media (max-width: 768px) {
  .calc-wrap { grid-template-columns: 1fr; }
}

/* ── Калькулятор — конструктор из 4 услуг (#calc) ───────────────────
   .calc-wrap-services (modifier on .calc-wrap) — сервисы построчно сверху,
   итоговая карточка (.calc-result) снизу, во всю ширину на любом брейкпоинте:
   с 4 строками сервисов двухколоночная база .calc-wrap выглядела бы
   неровно (короткая колонка итогов рядом с длинным списком). */
.calc-wrap.calc-wrap-services {
  grid-template-columns: 1fr;
  gap: 22px;
}
.calc-services {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.calc-service-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.calc-service-info {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calc-service-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-dark);
}
.calc-service-price {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-m);
}
.calc-service-input {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Touch target: a11y-auditor blocker — .calc-step-btn had no explicit
   size/padding at all. 44×44px meets the WCAG 2.5.5/2.5.8 minimum target
   size, both dimensions fixed via width/height + min-width/min-height so a
   long/short glyph or font metrics can't shrink the tappable box. */
.calc-step-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.calc-step-btn:hover {
  background: rgba(var(--brand-blue-rgb), .08);
  border-color: var(--brand-blue);
}
.calc-step-btn:active { transform: scale(.94); }
.calc-step-btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
.calc-service-count {
  width: 64px;
  height: 44px;
  padding: 0 4px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--brand-dark);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.calc-service-count::-webkit-outer-spin-button,
.calc-service-count::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-service-count:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
  border-color: var(--brand-blue);
}
.calc-service-result {
  flex: 1 0 auto;
  min-width: 96px;
  text-align: right;
  font-size: 17px;
  font-weight: 800;
  color: var(--brand-orange);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  .calc-service-row { flex-direction: column; align-items: stretch; }
  .calc-service-input { justify-content: center; }
  .calc-service-result { text-align: center; }
}

/* ── Карточки страхов ───────────────────────── */
.fear-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.fear-q {
  font-size: 17px;
  font-weight: 800;
  color: var(--brand-dark);
  margin: 0 0 12px;
  line-height: 1.35;
}
.fear-a {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-m);
}
.fear-a b { color: var(--brand-dark); }

/* ── Соцдоказательство (#proof) ─────────────── */
/* Только проверяемые факты. Стили цитаты-отзыва (.proof-quote/.proof-ava/
   .proof-who) удалены вместе с неподтверждённым отзывом — см. docs/CONTENT.md. */
.proof-fact {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
}
.proof-fact-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-blue);
  margin-bottom: 8px;
  line-height: 1.25;
}
.proof-fact p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--text-m); }

/* ── Срочность / дедлайн ────────────────────── */
.deadline-box {
  background: var(--brand-dark);
  border-radius: var(--radius-lg);
  padding: 34px;
  color: #fff;
}
.deadline-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-orange);
  margin-bottom: 12px;
}
.deadline-box h2 { color: #fff; font-size: clamp(20px, 3vw, 30px); margin-bottom: 12px; }
.deadline-main p { color: rgba(255,255,255,.78); margin-bottom: 10px; }
.deadline-math { font-size: 15px; }
.deadline-math b { color: #fff; }
.deadline-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}
.dl-step {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dl-when {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand-orange);
}
.dl-what { font-size: 14px; line-height: 1.4; color: rgba(255,255,255,.9); }
.dl-step-done {
  background: rgba(var(--brand-orange-rgb), .18);
  border-color: rgba(var(--brand-orange-rgb), .5);
}
.dl-step-done .dl-what { color: #fff; font-weight: 600; }

@media (max-width: 768px) {
  .deadline-timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deadline-box { padding: 26px 20px; }
}

/* ── Выбор сценария в форме ─────────────────── */
.intent-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 20px;
}
.intent-fieldset legend {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-dark);
  padding: 0;
  margin-bottom: 10px;
}
.intent-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.intent-opt { position: relative; cursor: pointer; display: block; }
.intent-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.intent-body {
  display: block;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color .18s, background .18s;
  height: 100%;
}
.intent-body b { display: block; color: var(--brand-dark); margin-bottom: 4px; font-size: 15px; }
.intent-body span { font-size: 13px; line-height: 1.45; color: var(--text-m); }
.intent-opt input:checked + .intent-body {
  border-color: var(--brand-orange);
  background: rgba(var(--brand-orange-rgb), .06);
}
.intent-opt input:focus-visible + .intent-body {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .intent-grid { grid-template-columns: 1fr; }
}

/* ── Documents section ──────────────────────── */
/* 2 карточки (было 4 — модалка и остальные 2 документа удалены, см.
   docs/REVISION_PLAN.md). repeat(2, …) само по себе уже не разрежено —
   2 карточки полностью заполняют обе колонки одной строкой — но на широком
   .container (1200px) каждая карточка растягивалась почти на 600px под одну
   строку заголовка. max-width + auto-центрирование держат карточки в
   компактной, предсказуемой ширине независимо от количества документов. */
.doc-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 680px) {
  .doc-grid { grid-template-columns: minmax(0, 1fr); }
}
.doc-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  min-height: 44px;
  box-shadow: 0 6px 20px rgba(var(--brand-dark-rgb), .06);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}
.doc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(var(--brand-dark-rgb), .12);
}
.doc-card:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
.doc-card-title { font-weight: 700; font-size: 16px; line-height: 1.35; }
.doc-card-meta { font-size: 13px; color: var(--text-m); }

/* ── Document viewer (popup для #documents/footer PDF) ────────
   Нативный <dialog>: showModal() кладёт элемент в top layer браузера —
   он автоматически перекрывает cookie-banner/mobile-nav без ручного
   z-index, а фон становится inert (Tab не уходит за пределы popup).
   PDF получает src только при открытии; при закрытии src сбрасывается
   в about:blank (см. js/document-viewer.js), чтобы не грузить оба файла
   заранее и не держать документ в памяти после закрытия. */
.doc-viewer-dialog {
  border: none;
  padding: 0;
  width: min(96vw, 1500px);
  max-width: 1500px;
  height: min(94vh, 94dvh);
  max-height: min(94vh, 94dvh);
  color: var(--text);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.doc-viewer-dialog[open] {
  display: flex;
  flex-direction: column;
}
.doc-viewer-dialog::backdrop {
  background: rgba(var(--brand-dark-rgb), .6);
}
.doc-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.doc-viewer-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.4;
  color: var(--brand-dark);
}
.doc-viewer-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: var(--text-m);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.doc-viewer-close:hover { background: var(--bg-light); color: var(--brand-dark); }
.doc-viewer-close:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}
.doc-viewer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: var(--bg-light);
}
.doc-viewer-frame {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 60vh;
  border: 0;
  background: #fff;
}
.doc-viewer-fallback-note {
  margin: 0;
  padding: 10px 22px;
  font-size: 13px;
  color: var(--text-m);
  text-align: center;
  flex-shrink: 0;
}
.doc-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.doc-viewer-actions .btn:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 2px;
}

@media (max-width: 680px) {
  .doc-viewer-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .doc-viewer-frame { min-height: 0; }
  .doc-viewer-actions { flex-direction: column; }
  .doc-viewer-actions .btn { width: 100%; text-align: center; min-height: 44px; }
}

@media (prefers-reduced-motion: no-preference) {
  .doc-viewer-dialog {
    transition: opacity .18s ease, transform .18s ease, overlay .18s ease allow-discrete, display .18s ease allow-discrete;
    opacity: 1;
    transform: none;
  }
  .doc-viewer-dialog:not([open]) {
    opacity: 0;
    transform: translateY(12px);
  }
  @starting-style {
    .doc-viewer-dialog[open] { opacity: 0; transform: translateY(12px); }
  }
}
