/*
 * site.css — дизайн-система публичной части alerteon.com
 * Светлая минималистичная тема в духе Apple, графитовый акцент.
 * Отдельно от app/static/css/style.css (тёмная тема кабинета и базы знаний) —
 * личный кабинет и база знаний этот файл не подключают и не должны.
 * Эталон: продуктовая карта (product-map.html), утверждено 2026-09-20.
 */

:root {
  --ground: #ffffff;
  --surface: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --accent: #1d1d1f;
  --accent-ink: #ffffff;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --wrap: 940px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- обёртка ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- ссылки и фокус ---------- */
a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:hover { opacity: 0.75; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- шапка ---------- */
.topbar { border-bottom: 1px solid var(--line-soft); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
}
.mark { font-weight: 600; letter-spacing: -0.01em; font-size: 17px; color: var(--ink); text-decoration: none; }
.topnav { display: flex; gap: 22px; font-size: 15px; flex-wrap: wrap; }
.topnav a { color: var(--ink-2); text-decoration: none; }
.topnav a:hover { color: var(--ink); opacity: 1; text-decoration: none; }

/* ---------- типографическая шкала ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 20px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.07;
  letter-spacing: -0.025em;
  font-weight: 600;
  text-wrap: balance;
  max-width: 16ch;
}

.lede {
  margin: 24px 0 0;
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 56ch;
}

.thesis {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.35;
  letter-spacing: -0.015em;
  max-width: 30ch;
}
.thesis b { font-weight: 600; }
.thesis .quiet { color: var(--ink-3); }

h2 {
  margin: 0;
  font-size: clamp(24px, 3.4vw, 32px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 600;
  text-wrap: balance;
}

h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- герой ---------- */
.hero { padding-block: 88px 64px; }

/* ---------- секции с волосяными разделителями ---------- */
section { padding-block: 72px; border-top: 1px solid var(--line-soft); }
.section-head { margin-bottom: 36px; }
.section-note { margin: 12px 0 0; color: var(--ink-2); max-width: 60ch; }

/* ---------- строки-спецификации (линейка продуктов и т.п.) ---------- */
.ladder { display: grid; gap: 0; }
.row {
  display: grid;
  grid-template-columns: 200px 1fr 230px;
  gap: 32px;
  padding-block: 32px;
  border-top: 1px solid var(--line-soft);
  align-items: start;
}
.row:first-child { border-top: 1px solid var(--line); }
.row-name { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 6px; }
.row-kind {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.row-body p { margin: 0; color: var(--ink-2); }
.row-body .who { margin-top: 10px; color: var(--ink); }
.row-body .who span { color: var(--ink-3); }

.row-meta { display: grid; gap: 10px; }
.meta-line { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.meta-line dt { color: var(--ink-3); margin: 0; }
.meta-line dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 13px; }
.yes { color: var(--ink); }
.no { color: var(--ink-3); }
.row-link { margin-top: 6px; font-size: 14px; }

.ladder-note {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  max-width: 62ch;
}

/* ---------- таблицы ---------- */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
caption { text-align: left; color: var(--ink-2); padding-bottom: 16px; }
th, td { text-align: left; padding: 16px 20px 16px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th { border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
thead th:first-child { color: var(--ink-3); font-weight: 400; }
tbody th { font-weight: 400; color: var(--ink-2); font-size: 15px; }
td { font-size: 15px; }
td.num { font-family: var(--mono); font-size: 13px; }

/* ---------- шаги ---------- */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.step { border-top: 1px solid var(--line); padding-top: 16px; }
.step-n {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  display: block;
  margin-bottom: 8px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.step p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ---------- финальный блок / CTA ---------- */
.cta { background: var(--surface); border-top: 1px solid var(--line); }
.cta-inner { padding-block: 72px; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 13px 26px;
  border-radius: 980px;
  font-size: 16px;
  margin-top: 28px;
  text-decoration: none;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.cta-links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 20px; font-size: 15px; }

/* ---------- футер ---------- */
footer { padding-block: 40px; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line-soft); }
footer p { margin: 0 0 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 16px; padding: 0; list-style: none; }
.footer-links a { color: var(--ink-2); }

/* ---------- поля форм ---------- */
.field { display: grid; gap: 8px; margin-bottom: 20px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--ink-3); }
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
textarea,
select {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
}
textarea { resize: vertical; min-height: 120px; }
input::placeholder,
textarea::placeholder { color: var(--ink-3); }
input:hover,
textarea:hover,
select:hover { border-color: var(--ink-3); }

/* ---------- аккордеон FAQ ---------- */
.faq { display: grid; gap: 0; }
.faq-item { border-top: 1px solid var(--line-soft); }
.faq-item:first-child { border-top: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 22px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--mono);
  font-weight: 400;
  font-size: 20px;
  color: var(--ink-3);
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin: 0 0 24px; color: var(--ink-2); max-width: 62ch; }

/* ---------- карточки статей блога ---------- */
.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-soft); }
.article-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ground);
  padding: 28px;
  text-decoration: none;
  color: inherit;
}
.article-card:hover { background: var(--surface); }
.article-card .eyebrow { margin: 0; }
.article-card h3 { margin: 0; font-size: 19px; }
.article-card p { margin: 0; color: var(--ink-2); font-size: 15px; }
.article-card .article-link { margin-top: auto; padding-top: 8px; font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- цитаты и выделенные блоки ---------- */
blockquote {
  margin: 32px 0;
  padding-left: 24px;
  border-left: 2px solid var(--ink);
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.4;
  letter-spacing: -0.01em;
  max-width: 56ch;
}
blockquote cite { display: block; margin-top: 12px; font-style: normal; font-size: 14px; color: var(--ink-3); }

.callout {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 32px 0;
  max-width: 62ch;
}
.callout p { margin: 0; color: var(--ink-2); }
.callout p + p { margin-top: 12px; }
.callout b { color: var(--ink); }

/* ---------- адаптив ---------- */
@media (max-width: 860px) {
  .row { grid-template-columns: 1fr; gap: 16px; }
  .row-meta { border-top: 1px solid var(--line-soft); padding-top: 14px; }
  .flow { grid-template-columns: 1fr 1fr; }
  .article-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .hero { padding-block: 56px 44px; }
  section { padding-block: 56px; }
  .flow { grid-template-columns: 1fr; }
  .topbar-inner { flex-wrap: wrap; row-gap: 2px; padding-block: 14px; }
  .topnav { width: 100%; gap: 2px 16px; font-size: 14px; }
  .topnav a { display: inline-flex; align-items: center; min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- общий футер сайта ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 0; padding-block: 56px 40px; background: var(--surface); }
.footer-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-head { margin: 0 0 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.footer-col a { font-size: 15px; color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.footer-legal p { margin: 0; font-size: 13px; color: var(--ink-3); }

/* ---------- главная: сетка услуг с волосяными разделителями ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; }
.svc-item { border-top: 1px solid var(--line); padding-top: 20px; }
.svc-item h3 { margin-bottom: 8px; }
.svc-item p { margin: 0; color: var(--ink-2); }
@media (max-width: 720px) { .svc-grid { grid-template-columns: 1fr; } }

/* ---------- главная: калькулятор окупаемости ---------- */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.calc-form { display: grid; gap: 22px; align-content: start; }
.calc-field { display: grid; gap: 8px; }
.calc-field-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.calc-field-head span:first-child { color: var(--ink); }
.calc-field-head span:last-child { font-family: var(--mono); font-size: 13px; color: var(--ink-3); }

.range-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: var(--line); border-radius: 1px; outline: none; margin: 0; }
.range-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); cursor: pointer; }
.range-slider::-moz-range-thumb { width: 16px; height: 16px; border: none; border-radius: 50%; background: var(--ink); cursor: pointer; }
.range-slider::-moz-range-track { background: var(--line); height: 2px; }

.calc-results { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 16px; padding: 32px; }
.calc-results h3 { font-size: 16px; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.calc-group dl { display: grid; gap: 10px; margin: 0; }
.calc-group + .calc-group { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.meta-line dd.calc-highlight { font-size: 19px; font-weight: 700; }
.calc-note { margin: 20px 0 0; font-size: 12px; color: var(--ink-3); line-height: 1.5; }

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

/* ---------- главная: модалка после отправки заявки ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(29, 29, 31, 0.4); display: none; justify-content: center; align-items: center; padding: 24px; z-index: 999; }
.modal-card { background: var(--ground); border: 1px solid var(--line); border-radius: 16px; padding: 36px; max-width: 440px; width: 100%; }
.modal-card h3 { margin: 0 0 12px; }
.modal-card p { color: var(--ink-2); margin: 0 0 24px; }
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; gap: 28px; } }
