:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #14171f;
  --muted: #656d7c;
  --border: #e6e8ef;
  --brand: #2952e3;
  --brand-dark: #1f3fc4;
  --brand-light: #eef1fe;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warn: #d97706;
  --warn-light: #fef3c7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 23, 31, 0.04), 0 8px 24px rgba(20, 23, 31, 0.06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.01em; }
a { color: var(--brand); }

/* Единственный источник центрирования — .wrap. Дочерним элементам внутри
   НЕЛЬЗЯ задавать margin-шорткод (margin: X 0), это обнуляет left/right
   auto и ломает центрирование. Только margin-top / margin-bottom. */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.narrow-form { max-width: 440px; margin: 0 auto; padding: 56px 24px; }

/* -------------------------------------------------- header */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.site-header nav { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.site-header nav a { color: var(--text); text-decoration: none; font-size: 0.93rem; font-weight: 500; }
.site-header nav a:hover { color: var(--brand); }
.site-header nav a.btn-small:hover { color: #fff; }

/* -------------------------------------------------- buttons */
.btn, .btn-small, .btn-outline, .btn-danger, .link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow .15s ease;
}
.btn { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(41, 82, 227, 0.28); }
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-small { background: var(--brand); color: #fff; padding: 8px 14px; font-size: 0.85rem; }
.btn-small:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.link-btn { background: none; color: var(--muted); padding: 0; font-weight: 500; text-decoration: underline; }

/* -------------------------------------------------- hero */
.hero {
  padding-top: 76px;
  padding-bottom: 56px;
  text-align: center;
  background:
    radial-gradient(560px 280px at 18% 0%, rgba(41, 82, 227, 0.12), transparent 60%),
    radial-gradient(560px 280px at 82% 10%, rgba(41, 82, 227, 0.08), transparent 60%);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-light); color: var(--brand-dark);
  padding: 6px 14px; border-radius: 999px; font-size: 0.82rem; font-weight: 700;
  margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); margin-bottom: 16px; max-width: 780px; margin-left: auto; margin-right: auto; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin-left: auto; margin-right: auto; margin-bottom: 28px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust-row {
  display: flex; gap: 28px; justify-content: center; flex-wrap: wrap;
  margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.88rem; font-weight: 600;
}

/* -------------------------------------------------- sections / grids */
section.section { padding-top: 56px; padding-bottom: 56px; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 10px; }
.section-head p { color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.grid-6 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }

.solution-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.solution-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .1s ease;
}
.solution-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.solution-card h3 { margin: 0; font-size: 0.95rem; line-height: 1.35; padding-right: 20px; }
.solution-card .cat-tag { font-size: 0.7rem; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: 0.03em; }
.solution-arrow { position: absolute; right: 16px; bottom: 14px; color: var(--muted); font-weight: 700; }
.solution-card:hover .solution-arrow { color: var(--brand); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; font-size: 1.05rem; }
.card-icon { font-size: 1.6rem; margin-bottom: 10px; display: block; }

.chip {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 22px 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); font-weight: 700; box-shadow: var(--shadow);
  transition: border-color .15s ease, transform .1s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.chip .chip-emoji { font-size: 1.8rem; }

.price { font-size: 1.7rem; font-weight: 800; color: var(--brand); margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.steps { padding-left: 0; list-style: none; counter-reset: step; display: flex; flex-direction: column; gap: 18px; }
.steps li { position: relative; padding-left: 46px; }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-light); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.9rem;
}
.checklist { padding-left: 20px; }
.checklist li { margin-bottom: 8px; }

/* -------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.9rem; }
.form input, .form textarea, .form select {
  font: inherit; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.form input:focus, .form textarea:focus, .form select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.flash-list { padding-top: 16px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 8px; font-size: 0.9rem; font-weight: 600; }
.flash-success { background: var(--success-light); color: #14532d; }
.flash-error { background: var(--danger-light); color: #7f1d1d; }

.row-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.row-buttons { display: flex; gap: 10px; }

.status-badge { display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; background: #eceef4; color: #374151; white-space: nowrap; }
.status-paid_held, .status-in_transit { background: var(--brand-light); color: var(--brand-dark); }
.status-confirmed { background: var(--success-light); color: #14532d; }
.status-disputed, .status-escalated { background: var(--warn-light); color: #78350f; }
.status-cancelled { background: var(--danger-light); color: #7f1d1d; }

.deal-table { width: 100%; border-collapse: collapse; margin-top: 16px; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.deal-table th, .deal-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.deal-table th { background: var(--bg); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); }

.notice { padding: 14px 16px; border-radius: 10px; padding-top: 14px; padding-bottom: 14px; font-size: 0.9rem; }
.notice-info { background: var(--brand-light); color: var(--brand-dark); }

.ai-card { border-left: 4px solid var(--brand); }
.actions { display: flex; flex-direction: column; gap: 14px; }
.share-box input { width: 100%; padding: 11px; border: 1px solid var(--border); border-radius: 10px; font: inherit; background: var(--bg); }

.dispute-card { border-left: 4px solid var(--warn); }
.dispute-toggle summary { cursor: pointer; color: var(--danger); font-weight: 700; }

.chat-card { }
.chat-messages { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; }
.chat-msg { background: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 0.9rem; }
.chat-msg.flagged { border: 1px solid var(--warn); }
.flag-note { color: var(--warn); font-size: 0.8rem; padding-top: 4px; }
.chat-form { display: flex; gap: 8px; }
.chat-form input { flex: 1; padding: 11px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }

.events-log { font-size: 0.85rem; }
.events-log summary { cursor: pointer; color: var(--muted); }
.events-log ul { padding-left: 18px; }

/* -------------------------------------------------- articles / knowledge base */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.article-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 8px; }
.article-card:hover { border-color: var(--brand); }
.article-card .cat-tag { font-size: 0.75rem; font-weight: 800; color: var(--brand); text-transform: uppercase; letter-spacing: 0.03em; }
.article-card h3 { margin: 0; font-size: 1.05rem; }
.article-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.article-body { font-size: 1.02rem; }
.article-body h2 { margin-top: 36px; font-size: 1.4rem; }
.article-body h3 { margin-top: 24px; font-size: 1.15rem; }
.article-body p { margin: 14px 0; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 6px; }
.breadcrumbs { font-size: 0.85rem; color: var(--muted); padding-bottom: 8px; }
.breadcrumbs a { color: var(--muted); }
.category-pills { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 32px; }
.category-pill { background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; text-decoration: none; color: var(--text); font-size: 0.88rem; font-weight: 600; }
.category-pill.active, .category-pill:hover { border-color: var(--brand); color: var(--brand); }
.pagination { display: flex; gap: 8px; justify-content: center; padding-top: 32px; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border); text-decoration: none; color: var(--text); font-size: 0.9rem; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

/* -------------------------------------------------- footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding-top: 40px; padding-bottom: 40px; font-size: 0.88rem; color: var(--muted); background: var(--card); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 28px; padding-bottom: 24px; }
.footer-grid h4 { color: var(--text); font-size: 0.85rem; margin-bottom: 12px; }
.footer-grid a { display: block; color: var(--muted); text-decoration: none; padding-bottom: 8px; }
.footer-grid a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; }
.site-footer a.inline { display: inline; }

@media (max-width: 640px) {
  .hero { padding-top: 48px; padding-bottom: 36px; }
  section.section { padding-top: 40px; padding-bottom: 40px; }
}
