:root {
    --bg: #fbfbf8;
    --surface: #ffffff;
    --tint: #f1f4ee;
    --ink: #0f1720;
    --muted: #5b6672;
    --line: #e4e6df;
    --accent: #12b76a;
    --accent-dark: #067647;
    --accent-soft: #e4f7ec;
    --dark: #0f1720;
    --dark-2: #18232f;
    --dark-line: #2a3846;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(15, 23, 32, 0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
    font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
a { color: inherit; }
ul, ol { list-style: none; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: min(1120px, 100% - 40px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 40px); }

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 26px;
    border: 2px solid var(--accent);
    border-radius: 999px;
    background: var(--accent);
    color: #04210f;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: #0fa35f; border-color: #0fa35f; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(18, 183, 106, .3); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: none; }
.btn-light { background: #fff; border-color: #fff; color: var(--ink); }
.btn-light:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn-small { padding: 9px 20px; font-size: .92rem; }
.btn-block { width: 100%; }

/* ===== Навигация ===== */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(251, 251, 248, .85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.3rem; letter-spacing: -.5px; text-decoration: none; }
.logo-mark {
    width: 22px; height: 22px; border-radius: 7px;
    background: linear-gradient(135deg, var(--accent), #7be0ae);
    box-shadow: inset -5px -5px 0 rgba(0, 0, 0, .12);
}
.nav-links { display: flex; gap: 28px; }
.nav-links a { white-space: nowrap; text-decoration: none; font-weight: 600; font-size: .95rem; color: var(--muted); transition: color .15s; }
.nav-links a:hover { color: var(--ink); }

/* ===== Hero ===== */
.hero { padding: 72px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 700;
    font-size: .85rem;
    margin-bottom: 20px;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.1; letter-spacing: -1.5px; font-weight: 800; }
.hl { background: linear-gradient(transparent 62%, #b7efd2 62%); }
.lead { margin-top: 22px; font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 32px; color: var(--muted); font-size: .95rem; }
.hero-facts b { color: var(--ink); }

.flow { display: flex; flex-direction: column; align-items: stretch; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.flow-node { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.flow-node b { display: block; font-size: .98rem; }
.flow-node small { color: var(--muted); font-size: .85rem; }
.flow-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); font-size: 1.2rem; }
.flow-link { position: relative; width: 2px; height: 22px; margin-left: 33px; background: repeating-linear-gradient(to bottom, var(--accent) 0 4px, transparent 4px 8px); }
.flow-link::after {
    content: ''; position: absolute; left: -3px; top: 0; width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); animation: drip 1.6s ease-in infinite;
}
.flow-link:nth-child(4)::after { animation-delay: .4s; }
.flow-link:nth-child(6)::after { animation-delay: .8s; }
@keyframes drip { from { top: -4px; opacity: 1; } to { top: 20px; opacity: 0; } }

/* ===== Секции ===== */
.section { padding: 88px 0; }
.section-tint { background: var(--tint); }
.section-head { max-width: 640px; margin-bottom: 44px; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); line-height: 1.15; letter-spacing: -1px; font-weight: 800; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 1.05rem; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-ico { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 18px; border-radius: 14px; background: var(--accent-soft); font-size: 1.4rem; }
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .97rem; }

/* ===== Демо ===== */
.section-dark { background: var(--dark); color: #fff; }
.section-dark .section-head p { color: #a7b3c0; }

.demo { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
.demo-form { padding: 24px; background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: var(--radius); position: sticky; top: 88px; }
.demo-form h3 { margin-bottom: 18px; font-size: 1.1rem; }
.demo-form label { display: block; margin-bottom: 14px; }
.demo-form label span { display: block; margin-bottom: 6px; font-size: .85rem; font-weight: 600; color: #a7b3c0; }
.demo-form input, .demo-form select {
    width: 100%; padding: 12px 14px;
    background: var(--dark); color: #fff;
    border: 1px solid var(--dark-line); border-radius: 10px;
    font: inherit; font-size: .98rem;
}
.demo-form input:focus, .demo-form select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18, 183, 106, .25); }
.form-error { margin-bottom: 12px; color: #ff9b9b; font-size: .9rem; }
.hint { margin-top: 12px; color: var(--muted); font-size: .88rem; }
.demo-form .hint { color: #8795a3; text-align: center; }

.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.step { min-width: 0; background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: var(--radius); overflow: hidden; transition: border-color .3s, box-shadow .3s; }
.step:nth-child(-n+2) { grid-column: 1 / -1; }
.step header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--dark-line); }
.step h4 { flex: 1; font-size: .98rem; }
.step-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--dark-line); font-size: .8rem; font-weight: 700; }
.chip { padding: 3px 10px; border-radius: 999px; background: var(--dark-line); color: #a7b3c0; font-size: .75rem; font-weight: 700; }
.step-body { padding: 16px; min-height: 120px; }
.placeholder { color: #6f7d8b; font-size: .92rem; }

.step.running { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(18, 183, 106, .18); }
.step.running .chip { background: #3b4a12; color: #f3e27a; }
.step.done .chip { background: rgba(18, 183, 106, .2); color: #5be2a0; }
.step.done .step-num { background: var(--accent); color: #04210f; }

.payload { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; color: #c7d2dd; line-height: 1.7; word-break: break-word; }
.payload i { font-style: normal; color: #5be2a0; }

.table-wrap { overflow-x: auto; }
.sheet { width: 100%; border-collapse: collapse; font-size: .9rem; white-space: nowrap; }
.sheet th { text-align: left; padding: 8px 12px; color: #8795a3; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--dark-line); }
.sheet td { padding: 9px 12px; border-bottom: 1px solid var(--dark-line); }
.sheet tr:last-child td { border-bottom: 0; }
.sheet .new td { animation: flash 1.6s ease-out; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.status.s-new { background: rgba(243, 226, 122, .16); color: #f3e27a; }
.status.s-work { background: rgba(18, 183, 106, .2); color: #5be2a0; }
@keyframes flash { from { background: rgba(18, 183, 106, .35); } to { background: transparent; } }

.tg { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.tg-msg { padding: 10px 14px; background: #24323f; border-radius: 4px 14px 14px 14px; font-size: .92rem; line-height: 1.5; animation: pop .3s ease-out; }
.tg-msg b { color: #7ec4ff; }
.tg-msg time { display: block; margin-top: 4px; text-align: right; color: #7f8f9e; font-size: .72rem; }
.tg-msg.me { align-self: flex-end; background: #2b6a4a; border-radius: 14px 4px 14px 14px; }
.tg-btn {
    padding: 9px 14px; border: 0; border-radius: 10px;
    background: #31485c; color: #8fd0ff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
    transition: background .15s;
}
.tg-btn:hover:not(:disabled) { background: #3b5a72; }
.tg-btn:disabled { color: #6f8294; cursor: default; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mail { background: #fff; color: var(--ink); border-radius: 10px; padding: 14px 16px; font-size: .92rem; animation: pop .3s ease-out; }
.mail dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .84rem; }
.mail dt { color: var(--muted); }
.mail dd { word-break: break-word; }
.mail p + p { margin-top: 8px; }

.demo-result { min-height: 1.6em; margin-top: 22px; text-align: center; color: #5be2a0; font-weight: 700; }

/* ===== Как мы работаем ===== */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: none; }
.how li { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.how-num { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; }
.how h3 { margin-bottom: 8px; font-size: 1.12rem; }
.how p { color: var(--muted); font-size: .97rem; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.tools span { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9rem; font-weight: 600; color: var(--muted); }

/* ===== Калькулятор ===== */
.calc { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: stretch; }
.calc-inputs, .calc-out { padding: 32px; border-radius: var(--radius); }
.calc-inputs { background: var(--surface); border: 1px solid var(--line); }
.range { margin-bottom: 26px; }
.range label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-weight: 600; }
.range output { color: var(--accent-dark); font-weight: 800; }
input[type="range"] { width: 100%; height: 6px; border-radius: 999px; background: var(--line); appearance: none; -webkit-appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.calc-out { display: flex; flex-direction: column; justify-content: center; gap: 28px; background: var(--dark); color: #fff; }
.out-main span, .out-row span { display: block; color: #a7b3c0; font-size: .92rem; }
.out-main b { display: block; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; letter-spacing: -1px; color: #5be2a0; }
.out-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 24px; border-top: 1px solid var(--dark-line); }
.out-row b { font-size: 1.4rem; }

/* ===== Цены ===== */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.plan-main { border: 2px solid var(--accent); box-shadow: var(--shadow); }
.badge { position: absolute; top: -13px; left: 28px; padding: 4px 14px; border-radius: 999px; background: var(--accent); color: #04210f; font-size: .8rem; font-weight: 800; }
.plan h3 { font-size: 1.3rem; }
.plan-for { color: var(--muted); font-size: .92rem; }
.price { margin: 18px 0; font-size: 2.1rem; font-weight: 800; letter-spacing: -1px; }
.plan ul { flex: 1; display: grid; gap: 10px; margin-bottom: 28px; }
.plan li { position: relative; padding-left: 28px; font-size: .97rem; }
.plan li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--accent-dark); font-weight: 800; }
.note { margin-top: 24px; text-align: center; color: var(--muted); font-size: .88rem; }

/* ===== FAQ ===== */
.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.faq summary { position: relative; padding: 18px 56px 18px 22px; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 500; color: var(--accent-dark); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 22px 20px; color: var(--muted); }

/* ===== Финал ===== */
.final { background: var(--accent); color: #04210f; }
.final-inner { text-align: center; }
.final p { margin: 12px 0 28px; font-size: 1.1rem; }

.footer { padding: 28px 0; background: var(--dark); color: #8795a3; font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer a { color: #fff; }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .nav-links { display: none; }
    .hero-grid, .demo, .calc { grid-template-columns: 1fr; }
    .hero-visual { max-width: 460px; }
    .demo-form { position: static; }
    .cards, .how, .plans { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .nav-links { display: none; }
    .hero { padding: 44px 0 56px; }
    .section { padding: 60px 0; }
    .cards, .how, .plans, .steps { grid-template-columns: 1fr; }
    .step:nth-child(-n+2) { grid-column: auto; }
    .calc-inputs, .calc-out { padding: 24px; }
    .step-body { padding: 12px; }
    .sheet { font-size: .84rem; }
    .sheet th, .sheet td { padding: 8px 6px; }
    .plan-main { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
