/* =========================================================================
   МАКС Гид — единая дизайн-система
   Help-портал по мессенджеру MAX (независимый проект, рунет)
   Бренд: «Тихая техподдержка» — слейт + морская волна (teal) + сигнальный
   зелёный для статуса «решено». Светлая тема, мобайл-фёрст, читаемость
   уровня хорошей базы знаний.
   ========================================================================= */

/* ---- Шрифт: Manrope (Google), кириллица, 2 начертания (400/700) -------- */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;700&display=swap');

/* ------------------------------- Токены --------------------------------- */
:root {
  /* Палитра */
  --ink:        #16232e;   /* основной текст — глубокий слейт */
  --ink-soft:   #4a5b68;   /* вторичный текст */
  --ink-muted:  #71828f;   /* подписи, мета */
  --line:       #dde5ea;   /* границы */
  --line-soft:  #eef3f6;   /* тонкие разделители */
  --paper:      #ffffff;   /* карточки */
  --bg:         #f4f7f9;   /* фон страницы */
  --bg-tint:    #eaf1f4;   /* мягкая заливка-акцент */

  --brand:      #1f7a8c;   /* морская волна — основной бренд */
  --brand-700:  #16606f;   /* нажатие/hover */
  --brand-100:  #d7ebef;   /* фон-плашка бренда */
  --accent:     #2f9e6f;   /* сигнальный зелёный — «решено/ок» */
  --accent-100: #dff1e8;
  --warn:       #c4711b;   /* внимание */
  --warn-100:   #f7ebda;

  /* Радиусы, тени, ритм */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --shadow:    0 1px 2px rgba(22,35,46,.05), 0 6px 20px rgba(22,35,46,.06);
  --shadow-sm: 0 1px 2px rgba(22,35,46,.06);
  --ring:  0 0 0 3px rgba(31,122,140,.35);

  --maxw: 1120px;
  --gap:  clamp(16px, 3vw, 28px);

  --font: "Manrope", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ------------------------------- Сброс ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: clip; }       /* обязательно: без горизонтальной прокрутки */

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------------------------- Типографика -------------------------------- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.35rem, 1rem + 1.6vw, 1.85rem); letter-spacing: -.01em; margin-top: 1.6em; }
h3 { font-size: clamp(1.12rem, .95rem + .8vw, 1.3rem); margin-top: 1.4em; }
p  { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin: .3em 0; }
strong { font-weight: 700; }
small { font-size: .85em; color: var(--ink-muted); }

.lead { font-size: 1.15rem; color: var(--ink-soft); }

/* ------------------------------ Раскладка ------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 28px); }

main { display: block; padding: clamp(24px, 5vw, 48px) 0 64px; }

.section { margin-block: clamp(32px, 6vw, 56px); }

.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
}

/* ---------------------------- Хлебные крошки ---------------------------- */
.breadcrumbs {
  font-size: .9rem;
  color: var(--ink-muted);
  padding: 14px 0 0;
}
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .2em .55em; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; gap: .55em; margin: 0; }
.breadcrumbs li + li::before { content: "/"; color: var(--line); }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs [aria-current="page"] { color: var(--ink); }

/* ------------------------------- Шапка ---------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 64px;
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 28px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); font-size: 1.15rem; letter-spacing: -.01em; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 130%);
  display: grid; place-items: center;
  color: #fff; font-size: .95rem; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.brand__name b { color: var(--brand); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  color: var(--ink-soft); font-weight: 700; font-size: .96rem;
  padding: 8px 12px; border-radius: var(--r-sm); white-space: nowrap;
}
.nav a:hover { color: var(--brand-700); background: var(--bg-tint); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--brand-700); background: var(--brand-100); }

.header-cta { margin-left: 8px; }

/* мобильная навигация: горизонтальный скролл, кнопка остаётся видимой */
@media (max-width: 760px) {
  .site-header__inner { flex-wrap: wrap; min-height: 56px; padding-block: 8px; gap: 8px 14px; }
  .nav {
    order: 3; margin-left: 0; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .header-cta { margin-left: auto; order: 2; }
}

/* ------------------------------- Кнопки --------------------------------- */
.btn {
  --b: var(--brand); --bh: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: inherit; font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer;
  background: var(--b); color: #fff;
  box-shadow: var(--shadow-sm);
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--bh); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--accent { --b: var(--accent); --bh: #25855c; }
.btn--ghost {
  background: transparent; color: var(--brand-700);
  border-color: var(--line); box-shadow: none;
}
.btn--ghost:hover { background: var(--bg-tint); color: var(--brand-700); }
.btn--sm { padding: 9px 15px; font-size: .92rem; }
.btn--lg { padding: 15px 28px; font-size: 1.08rem; }

/* ------------------------------- Карточки ------------------------------- */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: clamp(18px, 3vw, 26px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
a.card { color: inherit; display: block; }
a.card:hover { text-decoration: none; box-shadow: var(--shadow); border-color: #cdd9e0; transform: translateY(-2px); }
.card__eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); margin-bottom: .4em; }

/* Плашки/бейджи статуса */
.badge {
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .82rem; font-weight: 700; line-height: 1;
  padding: 5px 11px; border-radius: 999px;
  background: var(--bg-tint); color: var(--ink-soft);
}
.badge--ok   { background: var(--accent-100); color: #1f6e4c; }
.badge--warn { background: var(--warn-100);  color: var(--warn); }
.badge--info { background: var(--brand-100); color: var(--brand-700); }

/* Заметка / callout */
.note {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: var(--paper);
  border-radius: var(--r-sm);
  padding: 14px 18px; margin: 1.2em 0;
}
.note--ok   { border-left-color: var(--accent); }
.note--warn { border-left-color: var(--warn); }
.note p:last-child { margin-bottom: 0; }

/* ------------------------------- Таблицы -------------------------------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); }
table { width: 100%; border-collapse: collapse; font-size: .96rem; }
caption { text-align: left; padding: 12px 16px; color: var(--ink-muted); font-size: .9rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th { background: var(--bg-tint); color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfd; }

/* ----------------------------- FAQ-аккордеон ---------------------------- */
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 18px;
  overflow: clip;
}
.faq details[open] { border-color: #cdd9e0; box-shadow: var(--shadow-sm); }
.faq summary {
  list-style: none; cursor: pointer;
  font-weight: 700; color: var(--ink);
  padding: 16px 34px 16px 0; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 2px; top: 50%;
  width: 11px; height: 11px; margin-top: -7px;
  border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted);
  transform: rotate(45deg); transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq summary:hover { color: var(--brand-700); }
.faq details > *:not(summary) { margin-top: 0; }
.faq details p:first-of-type { padding-top: 2px; }
.faq details p:last-child { padding-bottom: 16px; margin-bottom: 0; }

/* --------------------------------- Hero --------------------------------- */
.hero {
  background:
    radial-gradient(120% 140% at 100% 0%, var(--brand-100) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-tint) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.hero .container { padding-block: clamp(36px, 7vw, 72px); }
.hero h1 { max-width: 18ch; }
.hero .lead { max-width: 54ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ------------------------------- Подвал --------------------------------- */
.site-footer {
  background: #102029; color: #c3d0d8;
  margin-top: 64px;
  border-top: 3px solid var(--brand);
}
.site-footer a { color: #cfe0e6; }
.site-footer a:hover { color: #fff; }
.site-footer__inner {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding: clamp(36px, 6vw, 56px) clamp(16px, 4vw, 28px) 28px;
}
.site-footer__top { display: grid; gap: 28px 40px; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 760px) { .site-footer__top { grid-template-columns: 1fr; } }
.site-footer__brand .brand { color: #fff; }
.site-footer__brand .brand__name b { color: #5ec7d6; }
.site-footer p { color: #9fb1bb; margin: .6em 0 0; font-size: .95rem; }
.footer-col h4 { color: #fff; font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; margin: 0 0 .8em; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: .45em 0; }
.site-footer__bottom {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; align-items: center;
  font-size: .87rem; color: #8ea2ad;
}
.disclaimer { max-width: 70ch; line-height: 1.55; }

/* ------------------------- Доступность / фокус -------------------------- */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn:focus-visible, .nav a:focus-visible, a.card:focus-visible { outline-offset: 3px; box-shadow: var(--ring); }

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  z-index: 100; transition: top .15s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* Утилиты */
.center { text-align: center; }
.muted  { color: var(--ink-muted); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1em; }

/* ----------------- Уменьшенная анимация (доступность) ------------------- */
@media (prefers-reduced-motion: reduce) {
  * , *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}


/* ===== Липкая мобильная CTA-плашка (конверсия на оффер) ===== */
.sticky-cta{position:fixed;left:0;right:0;bottom:0;z-index:60;display:flex;gap:10px;align-items:center;padding:10px 14px;padding-bottom:calc(10px + env(safe-area-inset-bottom,0px));background:rgba(255,255,255,.97);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-top:1px solid var(--border,#e2e8f0);box-shadow:0 -6px 22px -12px rgba(0,0,0,.3)}
.sticky-cta__btn{flex:1;text-align:center;margin:0}
.sticky-cta__close{flex:none;width:38px;height:38px;border:0;background:transparent;color:var(--muted,#64748b);font-size:20px;line-height:1;cursor:pointer;border-radius:8px}
.sticky-cta__close:hover{background:var(--bg-tint,#eef2f4)}
.sticky-cta.is-hidden{display:none}
body{padding-bottom:76px}
@media (min-width:768px){.sticky-cta{display:none}body{padding-bottom:0}}
@media (prefers-reduced-motion:reduce){.sticky-cta{-webkit-backdrop-filter:none;backdrop-filter:none}}
