/* ============================================================
   Пакет от Х5 — демо. Фирменная палитра X5 (зелёный #0a8240).
   Без внешних CDN, системные шрифты.
   ============================================================ */

:root {
  --x5-green: #0a8240;
  --x5-green-dark: #086a34;
  --x5-green-light: #e7f5ec;
  --x5-green-tint: #f3faf5;
  --x5-accent: #ff6a13;        /* оранжевый акцент X5 для плашки */
  --ink: #14211a;
  --ink-soft: #4a5a52;
  --muted: #7a8a82;
  --line: #e3eae6;
  --bg: #ffffff;
  --bg-alt: #f5f8f6;
  --card: #ffffff;
  --shadow-sm: 0 1px 3px rgba(20, 40, 30, 0.08);
  --shadow-md: 0 8px 28px rgba(20, 50, 35, 0.12);
  --shadow-lg: 0 24px 64px rgba(10, 60, 35, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

a { color: var(--x5-green); text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; }
.main-nav { display: flex; gap: 28px; }
.main-nav a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.main-nav a:hover { color: var(--x5-green); border-color: var(--x5-green); }

/* ---------- Секции ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 720px; margin-bottom: 36px; }
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--x5-green);
  background: var(--x5-green-light);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.section h2 { font-size: 32px; line-height: 1.15; margin: 0 0 12px; letter-spacing: -.02em; }
.section-sub { font-size: 16px; color: var(--ink-soft); margin: 0; }

/* ============================================================
   СЕКЦИЯ 1 — ГЕРОЙ
   ============================================================ */
.hero {
  background:
    radial-gradient(1200px 480px at 85% -10%, var(--x5-green-light), transparent 60%),
    linear-gradient(180deg, #ffffff, var(--x5-green-tint));
  padding-top: 64px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-copy h1 {
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: -.025em;
  margin: 12px 0 16px;
}
.lead { font-size: 17px; color: var(--ink-soft); margin: 0 0 28px; max-width: 520px; }

/* Селектор персон */
.persona-block { margin-bottom: 22px; }
.persona-label {
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px;
}
.persona-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.persona-btn {
  font: inherit;
  cursor: pointer;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.persona-btn:hover { border-color: var(--x5-green); color: var(--x5-green-dark); }
.persona-btn.is-active {
  background: var(--x5-green);
  border-color: var(--x5-green);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.persona-btn .pb-emoji { font-size: 15px; line-height: 1; }
.persona-hint {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 12px 0 0;
  min-height: 20px;
}

/* Тумблер A/B */
.ab-toggle-block { display: flex; flex-direction: column; gap: 8px; }
.ab-toggle-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ab-toggle {
  display: inline-flex;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.ab-opt {
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  transition: all .15s;
}
.ab-opt:hover { color: var(--x5-green-dark); }
.ab-opt.is-active { background: var(--x5-green); color: #fff; }

/* ---------- Мокап телефона ---------- */
.hero-phone { display: flex; justify-content: center; }
.phone {
  position: relative;
  width: 340px;
  max-width: 100%;
  background: #0e1512;
  border-radius: 46px;
  padding: 14px;
  box-shadow: var(--shadow-lg);
  border: 2px solid #222b27;
}
.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 26px;
  background: #0e1512;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 3;
}
.phone-screen {
  background: #fbfdfc;
  border-radius: 34px;
  overflow: hidden;
  height: 660px;
  display: flex;
  flex-direction: column;
}
.app-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.status-icons { display: inline-flex; gap: 4px; }
.status-icons .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); opacity: .55; }
.app-topbar {
  padding: 6px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.app-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 22px;
}
.app-title { font-size: 19px; margin: 4px 2px 14px; letter-spacing: -.01em; }

/* Блок объяснения (SHAP) */
.explanation {
  background: var(--x5-green-light);
  border: 1px solid #cdead8;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
  color: var(--x5-green-dark);
  line-height: 1.45;
}
.explanation .explanation-loading { color: var(--muted); }
.explanation strong { color: var(--x5-green-dark); }

/* Карточки тарифов (в телефоне) */
.tariff-cards { display: flex; flex-direction: column; gap: 12px; }
.tariff-card {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 14px 14px;
  background: #fff;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.tariff-card.is-selected {
  border-color: var(--x5-green);
  background: linear-gradient(180deg, var(--x5-green) 0%, var(--x5-green-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tariff-card.is-selected .tc-perks li { color: rgba(255,255,255,0.92); }
.tariff-card.is-selected .tc-perks li::before { color: #fff; }
.tariff-card.is-selected .tc-price-period { color: rgba(255,255,255,0.78); }
.tariff-card.is-selected .tc-score { color: rgba(255,255,255,0.9); }

.tc-badge {
  position: absolute;
  top: -11px;
  left: 14px;
  background: var(--x5-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 4px 11px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(255,106,19,0.35);
  white-space: nowrap;
}
.tc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tc-name { font-size: 16px; font-weight: 800; margin: 0; }
.tc-price { font-size: 20px; font-weight: 800; white-space: nowrap; }
.tc-price-period { font-size: 12px; font-weight: 600; color: var(--muted); }
.tc-perks { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.tc-perks li { font-size: 12.5px; color: var(--ink-soft); padding-left: 18px; position: relative; line-height: 1.35; }
.tc-perks li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--x5-green); font-weight: 800;
}
.tc-score {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-score-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.08);
  overflow: hidden;
}
.tariff-card.is-selected .tc-score-bar { background: rgba(255,255,255,0.25); }
.tc-score-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--x5-green);
  transition: width .4s ease;
}
.tariff-card.is-selected .tc-score-fill { background: #fff; }

.reco-error {
  margin-top: 12px;
  font-size: 12.5px;
  color: #b4451c;
  background: #fff2eb;
  border: 1px solid #ffd9c4;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
}

/* ============================================================
   ГРАФИКИ (секции 2 и 3)
   ============================================================ */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 36px;
}
.charts-grid--two { grid-template-columns: repeat(2, 1fr); }
.chart-card {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.chart-card img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #fafbfa;
  min-height: 120px;
}
.chart-card figcaption {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
}

/* ============================================================
   ТАБЛИЦЫ
   ============================================================ */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.table-status { padding: 22px; font-size: 14px; color: var(--muted); }
.table-status.is-error { color: #b4451c; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.data-table thead th {
  text-align: left;
  background: var(--x5-green-tint);
  color: var(--x5-green-dark);
  font-weight: 700;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.data-table th.num, .data-table td.num { text-align: right; }
.data-table tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--x5-green-tint); }
.data-table .model-name { font-weight: 700; color: var(--ink); }
.data-table .val-model { font-weight: 800; color: var(--x5-green-dark); }
.data-table .val-baseline { color: var(--muted); }
.data-table .delta-pos { color: var(--x5-green-dark); font-weight: 700; }
.data-table .group-start td { border-top: 2px solid var(--line); }

.significance-note {
  margin: 0;
  padding: 12px 18px;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--x5-green-tint);
  border-top: 1px solid var(--line);
}
.significance-note::before { content: "✓ "; color: var(--x5-green); font-weight: 800; }

/* ============================================================
   ПОДВАЛ
   ============================================================ */
.site-footer {
  background: var(--ink);
  color: #c8d4ce;
  padding: 36px 0;
}
.footer-inner { display: flex; flex-direction: column; gap: 14px; }
.site-footer img { filter: brightness(0) invert(1); opacity: .92; }
.disclaimer { font-size: 13.5px; max-width: 720px; margin: 0; color: #9fb0a8; line-height: 1.5; }

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-copy h1 { font-size: 34px; }
  .hero-phone { order: -1; }
  .charts-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .section { padding: 52px 0; }
  .container { padding: 0 18px; }
  .main-nav { display: none; }
  .section h2 { font-size: 26px; }
  .hero-copy h1 { font-size: 28px; }
  .charts-grid, .charts-grid--two { grid-template-columns: 1fr; }
  .phone { width: 300px; }
  .phone-screen { height: 600px; }
  .data-table { font-size: 13px; }
  .data-table thead th, .data-table tbody td { padding: 11px 12px; }
}

/* ============================================================
   ИНДИКАТОР РИСКА ОТТОКА (модель прогноза оттока)
   ============================================================ */
.churn-risk {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.35;
  border: 1px solid var(--line);
}
.churn-risk.risk-low {
  background: var(--x5-green-tint);
  color: var(--ink-soft);
  border-color: var(--x5-green-light);
}
.churn-risk.risk-medium {
  background: #fff6e9;
  color: #8a5a12;
  border-color: #ffe0b2;
}
.churn-risk.risk-high {
  background: #fdeceb;
  color: #a1281f;
  border-color: #f6c9c5;
  font-weight: 500;
}

/* ============================================================
   АДАПТИВНЫЕ ПРИВИЛЕГИИ (сегмент → партнёрские скидки)
   ============================================================ */
.privileges {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--x5-green-tint);
  border: 1px solid var(--x5-green-light);
}
.pv-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.pv-seg-icon { font-size: 22px; line-height: 1; }
.pv-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pv-seg { font-size: 14px; font-weight: 600; color: var(--ink); }
.pv-partners { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pv-partners li {
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
}
.pv-partner { font-size: 13px; color: var(--ink); font-weight: 500; }
.pv-perk { font-size: 13px; color: var(--x5-green-dark); font-weight: 700; }
.pv-note { margin-top: 8px; font-size: 11px; color: var(--muted); font-style: italic; }

/* ============================================================
   ЭКОНОМИКА — блок вывода
   ============================================================ */
.econ-conclusion {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.econ-conclusion h3 { margin: 0 0 10px; font-size: 16px; color: var(--x5-green-dark); }
.econ-conclusion p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
