/* ─────────────────────────────────────────────────────────────
   site.css — лендинг CRM HUB (crmhub.md) + общие стили админки.
   Палитра = брендовые переменные CRM (src/index.css, тема «CRM HUB»).
   Без inline-стилей (CSP style-src 'self' + Google Fonts).
   ───────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --accent: 37 99 235;        /* #2563eb */
  --accent-hover: 29 78 216;  /* #1d4ed8 */
  --page-bg: 238 242 247;     /* #eef2f7 */
  --surface: 255 255 255;
  --text: 30 41 59;           /* #1e293b */
  --link: 30 64 175;          /* #1e40af */
  --success: 34 156 138;      /* #229c8a */
  --info: 91 179 238;         /* #5bb3ee — как «HUB» в логотипе */
  --danger: 217 83 79;
  --muted: 124 141 161;       /* #7c8da1 */
  --field-bg: 226 232 240;
  --border: 214 223 235;      /* #d6dfeb */
  --shadow-card: 0 1px 2px rgb(15 23 42 / .06), 0 8px 24px -12px rgb(15 23 42 / .12);
  --shadow-pop: 0 2px 6px rgb(15 23 42 / .08), 0 24px 48px -16px rgb(37 99 235 / .22);
  --radius: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'PT Sans', system-ui, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: rgb(var(--text));
  background: rgb(var(--page-bg));
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: rgb(var(--link)); text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0; }
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ── Атмосфера страницы: мягкие брендовые пятна + сетка-миллиметровка ── */
.bg-decor {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(720px 480px at 85% -5%, rgb(var(--info) / .16), transparent 65%),
    radial-gradient(640px 420px at -10% 25%, rgb(var(--accent) / .10), transparent 60%),
    radial-gradient(560px 420px at 50% 115%, rgb(var(--info) / .10), transparent 60%);
}
.bg-decor::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgb(var(--accent) / .045) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--accent) / .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 34%);
}

/* ── Шапка ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(var(--page-bg) / .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.scrolled { border-color: rgb(var(--border)); box-shadow: 0 4px 16px -8px rgb(15 23 42 / .10); }
.site-header .container { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: rgb(var(--text)); }
.logo img { height: 40px; width: auto; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a { color: rgb(var(--text) / .78); font-weight: 700; font-size: 15px; transition: color .15s; }
.nav a:hover { color: rgb(var(--accent)); }
.header-cta { margin-left: 8px; }

/* ── Кнопки ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; cursor: pointer;
  font: 700 15px/1 'PT Sans', sans-serif;
  padding: 13px 22px;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, rgb(var(--accent)), rgb(var(--accent-hover)));
  box-shadow: 0 8px 20px -8px rgb(var(--accent) / .55);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgb(var(--accent) / .6); }
.btn-primary:active { transform: translateY(0); }
.btn-lg { padding: 16px 30px; font-size: 17px; border-radius: 12px; }
.btn-ghost { background: rgb(var(--accent) / .09); color: rgb(var(--accent)); }
.btn-ghost:hover { background: rgb(var(--accent) / .16); }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }

/* ── Hero ── */
.hero { padding: 72px 0 40px; overflow: hidden; }
.hero .container { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); gap: 48px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgb(var(--accent) / .10); color: rgb(var(--accent));
  border: 1px solid rgb(var(--accent) / .22);
  border-radius: 999px; padding: 7px 16px;
  font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
}
.badge::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--info)); box-shadow: 0 0 0 4px rgb(var(--info) / .25); }
.hero h1 {
  font-size: clamp(34px, 4.6vw, 52px);
  margin: 20px 0 18px;
  letter-spacing: -.015em;
}
.hero h1 .accent-word {
  background: linear-gradient(120deg, rgb(var(--accent)), rgb(var(--info)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .subtitle { font-size: 19px; color: rgb(var(--text) / .72); max-width: 46ch; margin: 0 0 30px; }
.hero-cta-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cta-note { color: rgb(var(--muted)); font-size: 14.5px; }

/* появление hero каскадом */
@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.2,.7,.2,1) forwards; }
  .hero-copy > *:nth-child(2) { animation-delay: .08s; }
  .hero-copy > *:nth-child(3) { animation-delay: .16s; }
  .hero-copy > *:nth-child(4) { animation-delay: .24s; }
  .hero-visual { opacity: 0; transform: translateY(20px) rotate(-1deg); animation: rise .7s .2s cubic-bezier(.2,.7,.2,1) forwards; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ── Мини-канбан в hero: витрина продукта чистым CSS ── */
.hero-visual { position: relative; }
.mock-window {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  padding: 14px 14px 18px;
  transform: rotate(-1deg);
}
.mock-titlebar { display: flex; align-items: center; gap: 6px; padding: 2px 6px 12px; }
.mock-titlebar i { width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--border)); }
.mock-titlebar i:first-child { background: rgb(var(--danger) / .55); }
.mock-titlebar i:nth-child(2) { background: rgb(var(--accent) / .45); }
.mock-titlebar i:nth-child(3) { background: rgb(var(--success) / .55); }
.mock-titlebar span { margin-left: 8px; font-size: 12.5px; color: rgb(var(--muted)); font-weight: 700; }
.mock-board { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.mock-col { background: rgb(var(--page-bg) / .8); border-radius: 12px; padding: 9px; }
.mock-col-title { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; padding: 2px 4px 8px; }
.mock-col-title b { color: rgb(var(--text) / .8); }
.mock-col-title span { color: rgb(var(--muted)); }
.mock-col:nth-child(1) .mock-col-title b { color: rgb(var(--accent)); }
.mock-col:nth-child(2) .mock-col-title b { color: rgb(var(--info)); }
.mock-col:nth-child(3) .mock-col-title b { color: rgb(var(--success)); }
.mock-card {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 2px rgb(15 23 42 / .05);
}
.mock-line { height: 8px; border-radius: 4px; background: rgb(var(--field-bg)); margin: 6px 0; }
.mock-line.w60 { width: 60%; }
.mock-line.w80 { width: 80%; }
.mock-line.w45 { width: 45%; }
.mock-chip { display: inline-block; height: 16px; border-radius: 999px; padding: 0 8px; font-size: 10.5px; line-height: 16px; font-weight: 700; }
.mock-chip.blue { background: rgb(var(--accent) / .12); color: rgb(var(--accent)); }
.mock-chip.sky { background: rgb(var(--info) / .16); color: rgb(29 118 176); }
.mock-chip.green { background: rgb(var(--success) / .14); color: rgb(var(--success)); }
/* карточка «перетаскивается» */
.mock-card.dragging {
  transform: rotate(2.5deg) translateY(-2px);
  box-shadow: 0 10px 22px -8px rgb(var(--accent) / .4);
  border-color: rgb(var(--accent) / .5);
  animation: drag 5s ease-in-out infinite;
}
@keyframes drag { 0%, 100% { transform: rotate(2.5deg) translateY(-2px); } 50% { transform: rotate(1deg) translateY(-8px); } }
/* плавающие чипы статистики поверх окна */
.float-chip {
  position: absolute;
  display: flex; flex-direction: column; gap: 2px;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 12px;
  padding: 10px 16px;
  box-shadow: var(--shadow-pop);
  animation: floaty 6s ease-in-out infinite;
}
.float-chip b { font-size: 18px; color: rgb(var(--accent)); }
.float-chip span { font-size: 12px; color: rgb(var(--muted)); font-weight: 700; }
.float-chip.tr { top: -18px; right: -10px; }
.float-chip.bl { bottom: -16px; left: -14px; animation-delay: 1.6s; }
.float-chip.bl b { color: rgb(var(--success)); }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ── Полоса цифр ── */
.stats { padding: 44px 0 8px; }
.stats .container {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 26px 20px;
}
.stat { text-align: center; padding: 4px 10px; }
.stat + .stat { border-left: 1px solid rgb(var(--border)); }
.stat b { display: block; font-size: 30px; letter-spacing: -.01em; color: rgb(var(--accent)); }
.stat span { color: rgb(var(--muted)); font-size: 14px; font-weight: 700; }

/* ── Секции ── */
.section { padding: 76px 0 12px; }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.section-head h2 { font-size: clamp(27px, 3.4vw, 38px); letter-spacing: -.01em; }
.section-head p { color: rgb(var(--text) / .66); font-size: 17px; margin: 12px 0 0; }
.kicker {
  display: inline-block; margin-bottom: 12px;
  color: rgb(var(--accent)); font-weight: 700; font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase;
}

/* появление при скролле (класс ставит site.js через IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s cubic-bezier(.2,.7,.2,1); }
.reveal.shown { opacity: 1; transform: none; }

/* ── Возможности ── */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-card);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); border-color: rgb(var(--accent) / .35); }
.feature .icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgb(var(--accent) / .14), rgb(var(--info) / .18));
  color: rgb(var(--accent));
  margin-bottom: 16px;
}
.feature .icon svg { width: 24px; height: 24px; }
.feature h3 { font-size: 18.5px; margin-bottom: 8px; }
.feature p { margin: 0; color: rgb(var(--text) / .68); font-size: 15px; }

/* ── Тарифы ── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan {
  position: relative;
  display: flex; flex-direction: column;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 18px;
  padding: 30px 28px;
  box-shadow: var(--shadow-card);
  transition: transform .18s, box-shadow .18s;
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
.plan.highlight {
  border: 2px solid rgb(var(--accent));
  box-shadow: 0 24px 56px -20px rgb(var(--accent) / .38);
  background:
    linear-gradient(rgb(var(--surface)), rgb(var(--surface))) padding-box,
    linear-gradient(160deg, rgb(var(--accent)), rgb(var(--info))) border-box;
}
.plan-badge {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, rgb(var(--accent)), rgb(var(--info)));
  color: #fff; font-size: 12.5px; font-weight: 700;
  border-radius: 999px; padding: 5px 16px;
  box-shadow: 0 6px 14px -6px rgb(var(--accent) / .6);
  white-space: nowrap;
}
.plan h3 { font-size: 21px; }
.plan .plan-desc { color: rgb(var(--muted)); font-size: 14.5px; margin: 6px 0 18px; min-height: 44px; }
.plan .price { display: flex; align-items: baseline; gap: 8px; }
.plan .price b { font-size: 44px; letter-spacing: -.02em; color: rgb(var(--text)); }
.plan.highlight .price b { color: rgb(var(--accent)); }
.plan .price span { color: rgb(var(--muted)); font-size: 14px; font-weight: 700; }
.plan ul { list-style: none; margin: 20px 0 26px; padding: 0; flex: 1; }
.plan li { display: flex; gap: 10px; padding: 7px 0; font-size: 15px; color: rgb(var(--text) / .82); }
.plan li::before {
  content: ''; flex: none; width: 20px; height: 20px; margin-top: 1px;
  border-radius: 50%;
  background: rgb(var(--success) / .14) url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23229c8a' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4 10-10'/%3E%3C/svg%3E") center/12px no-repeat;
}
.plan .btn { width: 100%; }
.pricing-note { text-align: center; color: rgb(var(--muted)); font-size: 14.5px; margin-top: 26px; }

/* ── Форма обратной связи + контакты ── */
.feedback-wrap {
  display: grid; grid-template-columns: 42fr 58fr;
  background: rgb(var(--surface));
  border: 1px solid rgb(var(--border));
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.feedback-info {
  padding: 44px 40px;
  color: #fff;
  background:
    radial-gradient(420px 300px at 110% -10%, rgb(var(--info) / .5), transparent 65%),
    linear-gradient(160deg, rgb(var(--accent)), rgb(var(--accent-hover)) 70%);
  display: flex; flex-direction: column;
}
.feedback-info h2 { font-size: 28px; }
.feedback-info .form-subtitle { margin: 12px 0 30px; color: rgb(255 255 255 / .85); font-size: 16px; }
.contact-list { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 12px; font-size: 15.5px; }
.contact-list a { color: #fff; font-weight: 700; }
.contact-list .cicon {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgb(255 255 255 / .16);
}
.contact-list .cicon svg { width: 19px; height: 19px; }
.feedback-form { padding: 44px 40px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13.5px; font-weight: 700; color: rgb(var(--text) / .75); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid rgb(var(--border));
  background: rgb(var(--page-bg) / .6);
  border-radius: 10px;
  padding: 12px 14px;
  font: 400 15px 'PT Sans', sans-serif;
  color: rgb(var(--text));
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: rgb(var(--accent));
  background: rgb(var(--surface));
  box-shadow: 0 0 0 3px rgb(var(--accent) / .16);
}
/* honeypot: визуально нет, для ботов есть */
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-actions { margin-top: 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.form-error { color: rgb(var(--danger)); font-size: 14.5px; font-weight: 700; }
.form-success { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 60px 40px; gap: 14px; }
.form-success .ok-ring {
  width: 74px; height: 74px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgb(var(--success) / .12); color: rgb(var(--success));
  animation: pop .45s cubic-bezier(.2,.9,.3,1.4);
}
.form-success .ok-ring svg { width: 36px; height: 36px; }
.form-success p { font-size: 18px; font-weight: 700; margin: 0; max-width: 38ch; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Футер ── */
.site-footer { margin-top: 90px; border-top: 1px solid rgb(var(--border)); background: rgb(var(--surface) / .6); }
.site-footer .container {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding-top: 30px; padding-bottom: 34px;
}
.site-footer .logo img { height: 32px; }
.footer-text { color: rgb(var(--muted)); font-size: 14px; }
.footer-links { margin-left: auto; display: flex; gap: 22px; font-size: 14.5px; font-weight: 700; }

/* ── Адаптив ── */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-top: 44px; }
  .features-grid, .pricing-grid { grid-template-columns: 1fr 1fr; }
  .plan.highlight { order: -1; grid-column: 1 / -1; }
  .feedback-wrap { grid-template-columns: 1fr; }
  .stats .container { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .stat:nth-child(3) { border-left: 0; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  .features-grid, .pricing-grid { grid-template-columns: 1fr; }
  .float-chip.tr { top: -12px; right: 0; }
  .float-chip.bl { bottom: -12px; left: 0; }
  .feedback-info, .feedback-form { padding: 32px 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; }
}
