:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1d2a26;
  --muted: #6b736d;
  --line: #e4e3dc;
  --brand: #0f6e56;
  --brand-dark: #0a4d3c;
  --brand-soft: #e1f5ee;
  --accent: #c4623a;
  --radius: 14px;
  --shadow: 0 10px 34px rgba(20, 40, 33, 0.10);
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: inherit; text-decoration: none; }

/* HEADER */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(246, 245, 241, 0.9);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800;
}
.nav { display: flex; align-items: center; gap: 26px; font-size: 15px; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav-phone { font-weight: 600; color: var(--brand) !important; }

/* HERO — центрированный */
.hero {
  background:
    radial-gradient(900px 460px at 50% -8%, var(--brand-soft), transparent 62%),
    var(--bg);
  padding: 54px 0 64px;
}
.hero-inner {
  max-width: 820px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; color: var(--brand-dark);
  background: #fff; border: 1px solid var(--line);
  padding: 7px 16px; border-radius: 999px; margin-bottom: 24px;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: #1d9e75; }
.hero-title {
  font-size: 52px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1;
}
.hero-title .accent { color: var(--brand); }
.hero-sub { font-size: 18px; color: var(--muted); max-width: 620px; margin: 22px 0 0; }

/* CHAT EMBED — стартует в 3 строки, растёт до экрана */
.chat-embed {
  width: 100%; max-width: 760px; margin: 34px auto 0;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow);
  padding: 18px; text-align: left;
  display: flex; flex-direction: column;
  transition: max-height 0.2s ease;
}
.chat-embed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.chat-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; flex: none; }
.chat-embed-title { font-size: 15px; font-weight: 600; color: var(--ink); }

/* лог скрыт до первого сообщения */
.chat-log { display: none; }
.chat-embed.is-active {
  min-height: 440px;
  max-height: calc(100vh - 130px);
}
.chat-embed.is-active .chat-log {
  display: flex; flex: 1 1 auto; min-height: 0; overflow-y: auto;
  flex-direction: column; gap: 10px;
  padding: 4px 4px 14px; margin-bottom: 4px;
}
.chat-embed.is-active .chat-embed-title { font-size: 13.5px; color: var(--muted); font-weight: 500; }

.msg { max-width: 86%; padding: 11px 14px; border-radius: 15px; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { align-self: flex-start; background: #f3f5f1; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.msg.typing { color: var(--muted); font-style: italic; background: transparent; border: none; }

.chat-inputbar { display: flex; gap: 10px; align-items: stretch; }
.chat-inputbar textarea {
  flex: 1; border: 1px solid var(--line); border-radius: 13px;
  padding: 13px 15px; font-size: 15px; line-height: 1.45; outline: none;
  font-family: inherit; resize: none; min-height: 76px; max-height: 220px; overflow-y: auto;
  background: #fbfbf9;
}
.chat-inputbar textarea:focus { border-color: var(--brand); background: #fff; }
#chat-send {
  flex: none; align-self: stretch; min-width: 116px;
  background: var(--accent); color: #fff; border: none; border-radius: 13px;
  font-size: 16px; font-weight: 700; cursor: pointer; padding: 0 20px;
  transition: background 0.15s ease, transform 0.06s ease;
}
#chat-send:hover { background: #a84e2c; }
#chat-send:active { transform: scale(0.98); }
#chat-send:disabled { opacity: 0.55; cursor: default; }

.chat-quick { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.chat-quick button {
  font-size: 13.5px; color: var(--ink); background: #f2f1ec;
  border: 1px solid var(--line); padding: 9px 15px; border-radius: 999px; cursor: pointer;
  transition: all 0.14s ease;
}
.chat-quick button:hover { border-color: var(--brand); color: var(--brand); background: #fff; }
.chat-hint { font-size: 11.5px; color: var(--muted); text-align: center; padding-top: 10px; }
.chat-embed:not(.is-active) .chat-hint { display: none; }

/* КНОПКА И ПАНЕЛЬ ЗВОНКА */
.call-btn { margin-left:auto; flex:none; background:var(--accent); color:#fff; border:none; border-radius:999px;
  font-size:13.5px; font-weight:600; padding:8px 14px; cursor:pointer; transition:filter .15s ease; }
.call-btn:hover { filter:brightness(1.08); }
.call-overlay { position:fixed; inset:0; background:rgba(20,30,26,.5); display:flex; align-items:center; justify-content:center; padding:16px; z-index:60; }
.call-overlay[hidden] { display:none; }
.call-card { background:#fff; border-radius:22px; padding:28px 24px; width:100%; max-width:360px; text-align:center; position:relative; box-shadow:0 24px 60px rgba(20,40,33,.28); }
.call-x { position:absolute; top:14px; right:16px; background:none; border:none; font-size:18px; color:var(--muted); cursor:pointer; }
.call-av { width:96px; height:96px; border-radius:50%; margin:6px auto 14px; background-size:cover; background-position:center; background-color:var(--brand); box-shadow:0 0 0 0 rgba(196,98,58,.5); }
.call-av.speaking { animation:callpulse 1.2s infinite; }
@keyframes callpulse { 0%{box-shadow:0 0 0 0 rgba(196,98,58,.5)} 70%{box-shadow:0 0 0 16px rgba(196,98,58,0)} 100%{box-shadow:0 0 0 0 rgba(196,98,58,0)} }
.call-name { font-size:20px; font-weight:800; }
.call-status { font-size:14px; color:var(--muted); margin:6px 0 16px; min-height:20px; }
.call-log { text-align:left; max-height:240px; overflow-y:auto; display:flex; flex-direction:column; gap:8px; margin-bottom:18px; }
.call-log:empty { display:none; }
.call-log .cl { font-size:14px; padding:9px 12px; border-radius:12px; }
.call-log .cl.user { background:var(--brand); color:#fff; align-self:flex-end; max-width:85%; }
.call-log .cl.bot { background:#f3f5f1; border:1px solid var(--line); align-self:flex-start; max-width:90%; }
.call-mic { width:100%; background:var(--brand); color:#fff; border:none; border-radius:14px; font-size:16px; font-weight:700; padding:14px; cursor:pointer; transition:background .15s ease; }
.call-mic:hover { background:var(--brand-dark); }
.call-mic.rec { background:var(--accent); }
.call-mic:disabled { opacity:.6; cursor:default; }

/* HERO TRUST */
.hero-trust { list-style: none; display: flex; gap: 44px; padding: 0; margin: 40px 0 0; flex-wrap: wrap; justify-content: center; }
.hero-trust li { display: flex; flex-direction: column; align-items: center; }
.hero-trust strong { font-size: 26px; color: var(--brand-dark); }
.hero-trust span { font-size: 14px; color: var(--muted); }

/* SECTION HEAD */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 34px; }
.section-head h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; }
.section-head p { color: var(--muted); margin-top: 10px; font-size: 17px; }

/* OBJECTS */
.objects { padding: 70px 0; background: #fff; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 32px; }
.tab {
  font-size: 15px; font-weight: 600; color: var(--muted);
  background: #fff; border: 1px solid var(--line);
  padding: 10px 20px; border-radius: 999px; cursor: pointer; transition: all 0.15s ease;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-media { height: 160px; display: grid; place-items: center; position: relative; color: #fff; background-size: cover; background-position: center; }
.card-badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.92); color: var(--brand-dark); font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px; }
.card-media-icon { width: 52px; height: 52px; opacity: 0.95; }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 18px; font-weight: 700; }
.card-complex { font-size: 14px; color: var(--brand-dark); font-weight: 600; }
.card-meta { font-size: 13.5px; color: var(--muted); }
.card-deadline { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.card-desc { font-size: 14px; color: var(--muted); margin-top: 4px; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.card-price { font-size: 21px; font-weight: 800; color: var(--ink); }
.card-cta { font-size: 14px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border: none; padding: 9px 14px; border-radius: 9px; cursor: pointer; }
.card-cta:hover { background: var(--brand); color: #fff; }

/* HOW */
.how { padding: 70px 0 80px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.step-n { display: grid; place-items: center; width: 36px; height: 36px; background: var(--brand-soft); color: var(--brand-dark); border-radius: 10px; font-weight: 800; margin-bottom: 14px; }
.step h3 { font-size: 18px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* FOOTER */
.site-footer { border-top: 1px solid var(--line); background: #fff; }
.footer-inner { display: flex; justify-content: space-between; padding: 22px 20px; color: var(--muted); font-size: 14px; flex-wrap: wrap; gap: 8px; }

/* RESPONSIVE */
@media (max-width: 640px) {
  .hero-title { font-size: 38px; }
  .hero-sub { font-size: 16px; }
  .section-head h2 { font-size: 26px; }
  #chat-send { min-width: 92px; padding: 0 12px; font-size: 15px; }
  .chat-embed.is-active { max-height: calc(100vh - 90px); }
}
