/*
 * style.css — Глобальные стили zafrm.ru
 * Дизайн: Deep Teal · Источник: platform-ai-full.html · ТЗ v9
 * Хедер · Футер · TG-виджет · Модальное окно · Хлебные крошки · Блок статей
 *
 * Подключается в head.php один раз.
 * Страницы добавляют свои стили через отдельный <link> или <style>.
 */

/* ── CSS-ПЕРЕМЕННЫЕ (ТЗ: фирменный стиль Deep Teal) ── */
:root {
  --teal:       #0d4f6c;   /* основной — хедер, заголовки, тёмные блоки */
  --teal-mid:   #0e7490;   /* вторичный — ссылки, иконки, метки */
  --teal-dark:  #0a3a52;   /* тёмный фон — hero, CTA-секции */
  --cyan:       #22d3c8;   /* акцент — кнопки, теги, пульс, em в заголовках */
  --cyan-light: #7ae8e2;   /* hover состояния */
  --cyan-pale:  #e0f7f6;   /* лёгкий фон блоков */
  --bg:         #f0f7f8;   /* фон страницы */
  --white:      #ffffff;   /* фон секций */
  --border:     #cce4ea;   /* рамки карточек */
  --muted:      #64748b;   /* второстепенный текст */
  --text:       #0f172a;   /* основной текст */
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Montserrat', sans-serif; /* ТЗ: единственный шрифт, кириллица */
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

/* ── УТИЛИТЫ ── */
.inner { max-width: 1400px; margin: 0 auto; padding: 0 48px; }
.s-label {
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal-mid); margin-bottom: 14px; display: block;
}
.s-h2 {
  font-size: 46px; font-weight: 800; color: var(--teal);
  line-height: 1.15; margin-bottom: 18px; letter-spacing: -.02em;
}
.s-lead {
  font-size: 20px; color: var(--muted); line-height: 1.65;
  max-width: 720px; margin-bottom: 56px;
}
.s-lead strong { color: var(--text); font-weight: 600; }

/* Пульсирующая точка */
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:.2;} }
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); animation: blink 2s ease-in-out infinite;
  display: inline-block; flex-shrink: 0;
}


/* ════════════════════════════════
   ХЕДЕР (ТЗ §1 · platform-ai)
   ════════════════════════════════ */

.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: var(--teal); height: 64px;
  display: flex; align-items: center;
  transition: box-shadow .3s;
}
/* Sticky-режим (80px) */
.site-header.sticky { box-shadow: 0 4px 24px rgba(10,58,82,.45); }

.hdr {
  max-width: 1200px; margin: 0 auto; padding: 0 48px;
  width: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}

/* Логотип */
.hdr-logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; flex-shrink: 0;
}
.hdr-logo-text {
  font-size: 20px; font-weight: 800; color: #fff; letter-spacing: .01em;
}
.hdr-logo-text span { color: var(--cyan); } /* буква М */

/* Навигация */
.hdr-nav { display: flex; align-items: center; gap: 2px; }
.hdr-nav-item {
  position: relative;
  color: rgba(255,255,255,.75); font-size: 13px; font-weight: 500;
  padding: 6px 11px; border-radius: 6px; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  display: flex; align-items: center; gap: 3px;
  transition: background .15s, color .15s;
  border: none; background: none; font-family: 'Montserrat', sans-serif;
}
.hdr-nav-item:hover,
.hdr-nav-item.active { background: rgba(255,255,255,.10); color: #fff; }
.hdr-dd-arrow { opacity: .45; margin-left: 2px; flex-shrink: 0; }

/* Дропдаун */
.hdr-dd {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; min-width: 230px;
  z-index: 300; box-shadow: 0 10px 32px rgba(10,58,82,.16);
  animation: ddFade 150ms ease-out;
}
.has-dd:hover .hdr-dd,
.has-dd:focus-within .hdr-dd { display: block; }

@keyframes ddFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dd-grp {
  font-size: 9px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #94a3b8; padding: 5px 10px 3px;
}
.hdr-dd .dd-row {
  display: block; padding: 7px 10px; border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--teal) !important;
  text-decoration: none; transition: background .12s;
}
.hdr-dd .dd-row:hover,
.hdr-dd .dd-row.active { background: var(--cyan-pale); }
.hdr-dd .dd-row.accent { color: var(--cyan) !important; font-weight: 700; }
.dd-url {
  display: none;
}
.dd-div { height: 1px; background: var(--border); margin: 4px 6px; }

/* HOT-метки */
.hot-badge {
  font-size: 8px; font-weight: 800; letter-spacing: .03em;
  background: var(--cyan); color: var(--teal-dark);
  padding: 1px 5px; border-radius: 3px; margin-left: 2px;
}

/* Правая часть хедера */
.hdr-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hdr-phone {
  color: rgba(255,255,255,.45); font-size: 12px; font-weight: 500;
  white-space: nowrap; text-decoration: none;
}
.hdr-phone:hover { color: rgba(255,255,255,.75); }

/* Кнопки */
.btn-ghost {
  padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1.5px solid rgba(255,255,255,.25); color: rgba(255,255,255,.8);
  background: transparent; cursor: pointer;
  font-family: 'Montserrat', sans-serif; text-decoration: none;
  transition: border-color .15s, color .15s;
  display: inline-flex; align-items: center;
}
.btn-ghost:hover { border-color: rgba(255,255,255,.55); color: #fff; }

.btn-cyan {
  padding: 8px 18px; border-radius: 6px; font-size: 12px; font-weight: 700;
  background: var(--cyan); color: var(--teal-dark); border: none; cursor: pointer;
  font-family: 'Montserrat', sans-serif; transition: background .15s;
  white-space: nowrap;
}
.btn-cyan:hover { background: var(--cyan-light); }

/* Бургер */
.burger {
  display: none; flex-direction: column; gap: 4px; cursor: pointer;
  padding: 4px; background: none; border: none;
}
.burger span {
  width: 20px; height: 2px; background: rgba(255,255,255,.8);
  border-radius: 2px; display: block;
}

/* Мобильное меню */
.mob-nav {
  display: none; position: fixed; top: 64px; left: 0; right: 0;
  z-index: 199; background: var(--teal);
  padding: 8px 20px 20px; box-shadow: 0 8px 24px rgba(10,58,82,.3);
}
.mob-nav.open { display: block; }

.mob-item {
  display: flex; justify-content: space-between; align-items: center;
  color: rgba(255,255,255,.8); font-size: 14px; font-weight: 500;
  padding: 12px; border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none; width: 100%;
  background: none; border-left: none; border-right: none; border-top: none;
  font-family: 'Montserrat', sans-serif; cursor: pointer;
}
.mob-item:hover { background: rgba(255,255,255,.05); }
.mob-dd-arrow { font-size: 9px; color: rgba(255,255,255,.25); }

.mob-sub { background: rgba(0,0,0,.12); padding: 4px 0; }
.mob-sub[hidden] { display: none; }
.mob-sub-item {
  display: block; font-size: 13px; color: rgba(255,255,255,.6);
  padding: 9px 28px; text-decoration: none;
}
.mob-sub-item--accent { color: var(--cyan); font-weight: 600; }

.mob-hot {
  font-size: 8px; background: var(--cyan); color: var(--teal-dark);
  padding: 1px 5px; border-radius: 3px; font-weight: 800;
}
.mob-phone {
  display: block; font-size: 12px; color: rgba(255,255,255,.35);
  padding: 10px 12px 4px; text-decoration: none;
}
.mob-btns { display: flex; gap: 8px; padding: 12px 0 4px; }


/* ════════════════════════════════
   ХЛЕБНЫЕ КРОШКИ (ТЗ §3)
   ════════════════════════════════ */

.breadcrumb { background: var(--white); border-bottom: 1px solid var(--border); }
.bc-inner   { max-width: 1200px; margin: 0 auto; padding: 10px 48px; }
.bc-row {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--cyan-pale); border-radius: 6px;
  padding: 6px 12px; font-size: 12px;
}
.bc-row a      { color: var(--teal-mid); font-weight: 600; text-decoration: none; }
.bc-row a:hover { text-decoration: underline; color: var(--teal); }
.bc-sep { color: var(--border); font-size: 9px; }
.bc-cur { color: var(--teal); font-weight: 600; }


/* ════════════════════════════════
   ФУТЕР (ТЗ §11 · platform-ai)
   ════════════════════════════════ */

.site-footer {
  background: #071e2d;  /* ТЗ: фон #071e2d */
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  margin-bottom: 24px;
}

/* Колонка бренда */
.fbrand-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; margin-bottom: 16px;
}
.fbrand {
  font-size: 22px; font-weight: 800; color: #fff; letter-spacing: .01em;
}
.fbrand span { color: var(--cyan); }

.ftagline {
  font-size: 13px; color: rgba(255,255,255,.42);
  line-height: 1.65; margin-bottom: 8px; max-width: 260px;
}
.fco {
  font-size: 11px; color: rgba(255,255,255,.2); margin-bottom: 16px;
}
.fco a { color: rgba(255,255,255,.35); text-decoration: none; }
.fco a:hover { color: var(--cyan); }

.fsocial { display: flex; gap: 8px; }
.fsoc {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none;
  transition: opacity .15s; border: none;
}
.fsoc:hover { opacity: .75; }
.fsoc-tg { background: #29a8e0; }
.fsoc-vk { background: #4c75a3; }
.fsoc-ig { background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }

/* Колонки ссылок */
.fcol-label {
  font-size: 10px; font-weight: 700; letter-spacing: .10em; text-transform: uppercase;
  color: rgba(255,255,255,.28); margin-bottom: 14px;
}
.flinks  { display: flex; flex-direction: column; gap: 8px; }
.flink   { font-size: 13px; color: rgba(255,255,255,.55); text-decoration: none; transition: color .15s; }
.flink:hover { color: var(--cyan-light); }
.flink.dim   { color: rgba(255,255,255,.22); font-size: 12px; }
.flink.dim:hover { color: rgba(255,255,255,.5); }
.fsep { height: 1px; background: rgba(255,255,255,.07); margin: 4px 0; }

/* Контакты */
.fcontact {
  display: flex; gap: 8px; font-size: 13px;
  color: rgba(255,255,255,.55); margin-bottom: 8px;
}
.fcontact .lbl {
  font-size: 9px; color: rgba(255,255,255,.22); width: 32px; flex-shrink: 0;
  padding-top: 2px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.fcontact a { color: rgba(255,255,255,.55); text-decoration: none; }
.fcontact a:hover { color: var(--cyan-light); }

/* Нижняя строка */
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0; font-size: 11px; color: rgba(255,255,255,.18);
  flex-wrap: wrap; gap: 8px;
}
.flegal { display: flex; gap: 20px; }
.flegal a {
  font-size: 11px; color: rgba(255,255,255,.18); text-decoration: none;
}
.flegal a:hover { color: rgba(255,255,255,.45); }


/* ════════════════════════════════
   TG-ВИДЖЕТ (ТЗ §12)
   ════════════════════════════════ */

.tg-widget {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column;
  align-items: flex-end; gap: 10px;
}
.wbubble {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 12px 12px 0 12px; padding: 14px 16px;
  font-size: 12px; font-family: 'Montserrat', sans-serif;
  color: var(--text); max-width: 230px; line-height: 1.55;
  box-shadow: 0 4px 20px rgba(13,79,108,.12);
  display: none; position: relative;
}
.wbubble.shown { display: block; }
.wclose {
  position: absolute; top: 8px; right: 8px;
  width: 20px; height: 20px; border-radius: 4px;
  background: var(--cyan-pale); border: none; cursor: pointer;
  font-size: 14px; color: var(--teal-mid); line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.wbubble-link {
  display: block; margin-top: 8px;
  font-size: 12px; font-weight: 700; color: var(--cyan); text-decoration: none;
}
.wbubble-link:hover { color: var(--teal-mid); }
.wbtn {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--cyan); display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 18px rgba(34,211,200,.40);
  text-decoration: none; transition: background .15s;
}
.wbtn:hover { background: var(--cyan-light); }


/* ════════════════════════════════
   МОДАЛЬНОЕ ОКНО (ТЗ §13)
   ════════════════════════════════ */

.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(7,30,45,.65); z-index: 9998;
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white); border-radius: 16px;
  width: 100%; max-width: 460px; padding: 40px 36px 36px;
  position: relative; box-shadow: 0 24px 64px rgba(10,58,82,.30);
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--cyan-pale); border: none; cursor: pointer;
  font-size: 18px; color: var(--teal-mid);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--border); color: var(--teal); }

.modal h2 {
  font-size: 24px; font-weight: 800; color: var(--teal);
  margin-bottom: 8px; line-height: 1.25;
  font-family: 'Montserrat', sans-serif;
}
.modal-sub {
  font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 24px;
  font-family: 'Montserrat', sans-serif;
}
.mfld { position: relative; margin-bottom: 10px; }
.mfld input, .mfld select {
  width: 100%; height: 50px;
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 0 40px 0 14px;
  font-family: 'Montserrat', sans-serif; font-size: 14px; color: var(--text);
  outline: none; box-sizing: border-box; transition: border-color .2s;
  background: var(--white);
}
.mfld input:focus, .mfld select:focus { border-color: var(--cyan); }
.mfld input::placeholder { color: #94a3b8; }
.req {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  color: #ef4444; font-size: 15px; font-weight: 700; pointer-events: none;
}
.mcheck {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 14px 0 18px; font-size: 12px; color: var(--muted);
  line-height: 1.5; font-family: 'Montserrat', sans-serif;
}
.mcheck input { width: 16px; height: 16px; accent-color: var(--cyan); flex-shrink: 0; margin-top: 1px; cursor: pointer; }
.mcheck a { color: var(--teal-mid); }
.msubmit {
  width: 100%; height: 52px; background: var(--cyan);
  border: none; border-radius: 10px;
  font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--teal-dark); cursor: pointer; transition: background .15s;
}
.msubmit:hover { background: var(--cyan-light); }


/* ════════════════════════════════
   БЛОК СТАТЕЙ «Читайте по теме» (ТЗ §5в)
   Привязка тегов:
     /debitorka    → тег: дебиторка, должники
     /arenda       → тег: аренда, арендаторы
     /plan-fakt    → тег: план-факт, бюджетирование
     /platezhi     → тег: платежи, согласование, казначейство
     /platform-ai  → тег: AI, автоматизация
     /findirektor  → тег: финдиректор, управленческий учёт
   Условие: показывать только при ≥3 статьях с тегом
   ════════════════════════════════ */

.articles-block        { padding: 0 0 80px; }
.articles-block__inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; }

.articles-block__header { margin-bottom: 28px; }
.articles-block__label  {
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--teal-mid); margin-bottom: 6px;
}
.articles-block__title  { font-size: 28px; font-weight: 800; color: var(--teal); }

.articles-block__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}

.article-card {
  background: var(--white); border-radius: 12px;
  border: 1px solid var(--border); padding: 24px;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .2s, border-color .2s;
}
.article-card:hover {
  box-shadow: 0 6px 24px rgba(13,79,108,.10);
  border-color: var(--cyan);
}

.article-card__tag {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--teal-mid);
}
.article-card__title {
  font-size: 15px; font-weight: 700; color: var(--teal);
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.article-card__desc {
  font-size: 13px; color: var(--muted); line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.article-card__footer {
  display: flex; align-items: center; justify-content: space-between; margin-top: 6px;
}
.article-card__time { font-size: 11px; color: #94a3b8; }
.article-card__read {
  font-size: 12px; font-weight: 700; color: var(--cyan); text-decoration: none;
}
.article-card__read:hover { color: var(--teal-mid); }

.articles-block__more     { text-align: center; margin-top: 28px; }
.articles-block__more-btn {
  display: inline-block; font-size: 13px; font-weight: 600;
  color: var(--teal-mid); text-decoration: none;
  border: 1.5px solid var(--border); border-radius: 8px; padding: 10px 24px;
  transition: border-color .15s, color .15s;
}
.articles-block__more-btn:hover { border-color: var(--teal-mid); color: var(--teal); }


/* ════════════════════════════════
   INLINE CTA (используется на страницах)
   ════════════════════════════════ */

.inline-cta {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  padding: 32px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.icta-text { font-size: 17px; font-weight: 700; color: #fff; line-height: 1.35; }
.icta-text span { color: var(--cyan); }
.icta-sub  { font-size: 13px; color: rgba(255,255,255,.45); margin-top: 4px; }
.icta-form { display: flex; gap: 10px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }
.icta-input {
  padding: 12px 16px; border-radius: 8px;
  border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08); color: #fff;
  font-family: 'Montserrat', sans-serif; font-size: 13px;
  min-width: 220px; outline: none;
}
.icta-input::placeholder { color: rgba(255,255,255,.3); }
.icta-input:focus { border-color: var(--cyan); }
.icta-btn {
  padding: 13px 24px; border-radius: 8px;
  background: var(--cyan); color: var(--teal-dark);
  font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; white-space: nowrap; transition: background .15s;
}
.icta-btn:hover { background: var(--cyan-light); }


/* ════════════════════════════════
   АДАПТИВНОСТЬ
   ════════════════════════════════ */

@media (max-width: 1100px) {
  .hdr-phone { display: none; }
  .inner { padding: 0 32px; }
  .hdr  { padding: 0 32px; }
  .bc-inner { padding: 10px 32px; }
  .articles-block__inner { padding: 0 32px; }
  .inline-cta { padding: 28px 32px; }
}

@media (max-width: 768px) {
  /* Хедер */
  .hdr { padding: 0 20px; }
  .hdr-nav  { display: none; }
  .burger   { display: flex; }
  .hdr-logo-text { font-size: 18px; }

  /* Футер */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

  /* Статьи */
  .articles-block__grid { grid-template-columns: 1fr; }
  .articles-block__inner { padding: 0 20px; }

  /* Inline CTA */
  .inline-cta { flex-direction: column; gap: 20px; padding: 24px 20px; }
  .icta-input { min-width: 0; width: 100%; }

  /* Модал */
  .modal { padding: 28px 20px 24px; }

  /* Виджет */
  .tg-widget { bottom: 16px; right: 16px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
