:root {
    --bg: #ffffff;
    --bg-soft: #f8f9fa;
    --text: #1a1d23;
    --muted: #5b6472;

    --brand: #0056b3;
    --brand-dark: #003d80;
    --brand-hover: #004a9e;
    --brand-soft: #e6eef9;

    --cta: #ff6600;
    --cta-hover: #e65c00;

    --border: #e3e8f0;
    --radius: 14px;
    --shadow: 0 4px 16px rgba(20, 30, 60, .06);
    --shadow-blue: 0 10px 30px rgba(0, 86, 179, .18);

    --ok-bg: #ecfdf5;
    --ok-border: #a7f3d0;
    --ok-text: #065f46;
    --err-bg: #fef2f2;
    --err-border: #fecaca;
    --err-text: #991b1b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.hash { font-size: 12px; color: var(--muted); line-height: 1.5; word-break: break-all; }
.hash code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--text); }

/* ---------- Шапка ---------- */
.header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: var(--brand); }
.logo span { color: var(--cta); }
.nav { display: flex; gap: 22px; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--brand); text-decoration: none; }
.nav a.nav-active { color: var(--brand); font-weight: 600; }

.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; border-radius: 2px; }

/* ---------- Hero ---------- */
.hero {
    padding: 88px 0 80px;
    background: linear-gradient(135deg, rgb(0, 86, 179) 0%, rgb(0, 61, 128) 100%);
    color: #fff;
    border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: 44px; line-height: 1.15; letter-spacing: -.02em; margin: 0 auto 16px; max-width: 720px; color: #fff; text-align: center; }
.hero h1 em { font-style: normal; color: var(--cta); }
.hero .sub { font-size: 20px; color: rgba(255,255,255,.85); margin: 0 auto 12px; max-width: 640px; text-align: center; }
.hero .lead { font-size: 17px; color: rgba(255,255,255,.82); margin: 0 auto 28px; max-width: 480px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 720px; margin: 0 auto; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 22px; border-radius: 10px; font-size: 16px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .05s;
    min-height: 48px;
}
.btn-primary { background: var(--cta); color: #fff; }
.btn-primary:hover { background: var(--cta-hover); text-decoration: none; }
.btn-blue { background: var(--brand); color: #fff; }
.btn-blue:hover { background: var(--brand-hover); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); border-color: #fff; text-decoration: none; }
.btn[disabled], .btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Секции ---------- */
section { padding: 64px 0; }
section.soft { background: var(--bg-soft); }
.section-title { font-size: 30px; letter-spacing: -.015em; margin: 0 0 8px; }
.section-sub { color: var(--muted); margin: 0 0 36px; font-size: 17px; }

/* ---------- Возможности ---------- */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.feature .ico { font-size: 28px; line-height: 1; margin-bottom: 12px; }
.feature h3 { margin: 0 0 8px; font-size: 17px; }
.feature p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- Шаги ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step .num { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 14px; }
.step h3 { margin: 0 0 8px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.step .note { margin-top: 10px; font-size: 14px; color: var(--cta); font-weight: 500; }

/* ---------- Тарифы ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.plan.featured { border-color: var(--brand); box-shadow: var(--shadow-blue); position: relative; }
.plan .badge { position: absolute; top: -12px; left: 20px; background: var(--cta); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 5px 10px; border-radius: 999px; text-transform: uppercase; }
.plan h3 { margin: 0 0 6px; font-size: 18px; }
.plan .price { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 16px; color: var(--brand); }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
.plan li { padding: 7px 0 7px 26px; position: relative; color: var(--muted); font-size: 15px; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--cta); font-weight: 700; }

/* ---------- Загрузки ---------- */
.downloads { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.download { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.download h3 { margin: 0; font-size: 17px; }
.download p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.download .meta { font-size: 13px; color: var(--muted); }
.download .btn { align-self: flex-start; }

/* ---------- FAQ ---------- */
.faq details { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.faq details[open] { border-color: var(--brand); background: #fff; }
.faq summary { cursor: pointer; padding: 18px 20px; font-weight: 600; font-size: 16px; list-style: none; position: relative; padding-right: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--brand); }
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 20px 20px; color: var(--muted); font-size: 15px; }

/* ---------- Футер ---------- */
.footer { padding: 36px 0; border-top: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-col { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.footer-brand { font-weight: 700; font-size: 18px; color: var(--brand); margin-bottom: 4px; }
.footer-brand span { color: var(--cta); }
.footer-title { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--brand); }

@media (max-width: 640px) {
    .footer-inner { flex-direction: column; gap: 24px; }
    .footer-col { min-width: 0; }
}

/* ---------- Мобильная адаптация ---------- */
@media (max-width: 900px) {
    .features { grid-template-columns: repeat(2, 1fr); }
    .pricing  { grid-template-columns: 1fr; }
    .steps    { grid-template-columns: 1fr; }
    .downloads{ grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .header-inner { height: 58px; }
    .nav { display: none; }
    .nav.open { display: flex; flex-direction: column; position: absolute; top: 58px; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 16px 16px; gap: 4px; }
    .nav.open a { padding: 12px 8px; border-radius: 8px; font-size: 16px; color: var(--text); }
    .nav.open a:hover { background: var(--bg-soft); }
    .burger { display: block; }

    .hero { padding: 52px 0 48px; }
    .hero h1 { font-size: 30px; }
    .hero .sub { font-size: 17px; }
    .hero .lead { font-size: 15px; }

    section { padding: 44px 0; }
    .section-title { font-size: 24px; }
    .section-sub { font-size: 15px; margin-bottom: 26px; }

    .features { grid-template-columns: 1fr; }
    .feature { padding: 18px; }

    .btn { width: 100%; }
    .hero-actions { flex-direction: column; }

    .plan { padding: 22px; }
    .plan .price { font-size: 26px; }

    .faq summary { padding: 15px 16px; padding-right: 42px; font-size: 15px; }
    .faq .answer { padding: 0 16px 16px; font-size: 14px; }
}

/* ---------- Cookie ---------- */
.cookie-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9999;
    display: none; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 24px; background: #1f2937; color: #f9fafb;
    font-size: 14px; line-height: 1.4; box-shadow: 0 -2px 12px rgba(0,0,0,.2);
}
.cookie-banner.is-visible { display: flex; }
.cookie-banner__text { flex: 1 1 auto; }
.cookie-banner__text a { color: #93c5fd; text-decoration: underline; }
.cookie-banner__btn { flex: 0 0 auto; padding: 10px 20px; border: none; border-radius: 6px; background: #2563eb; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s; }
.cookie-banner__btn:hover { background: #1d4ed8; }

@media (max-width: 600px) {
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-banner__btn { width: 100%; }
}

/* ---------- Модальное окно баланса ---------- */
.modal { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.is-open { display: flex; }
.modal__overlay { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(2px); }
.modal__dialog { position: relative; background: #fff; border-radius: var(--radius); box-shadow: 0 20px 50px rgba(15,23,42,.25); width: 100%; max-width: 460px; padding: 28px 26px 24px; animation: modalIn .18s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal__close { position: absolute; top: 10px; right: 12px; width: 34px; height: 34px; border: none; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 8px; }
.modal__close:hover { background: var(--bg-soft); color: var(--text); }
.modal__title { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.modal__sub { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.modal__form { display: flex; flex-direction: column; gap: 12px; }
.modal__label { font-size: 14px; font-weight: 600; }
.modal__input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 16px; font-family: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
.modal__input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,86,179,.15); }
.modal__submit { width: 100%; margin-top: 4px; }
.modal__submit:disabled { opacity: .6; cursor: not-allowed; }
.modal__result { margin-top: 18px; padding: 16px; border-radius: 12px; background: var(--bg-soft); border: 1px solid var(--border); font-size: 15px; }
.modal__result.is-error { background: var(--err-bg); border-color: var(--err-border); color: var(--err-text); }
.balance-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; }
.balance-row + .balance-row { border-top: 1px dashed var(--border); }
.balance-row__label { color: var(--muted); }
.balance-row__value { font-weight: 700; font-size: 18px; color: var(--brand); }
.balance-row__value--labels { color: var(--cta); }
body.modal-open { overflow: hidden; }

/* ============================================================
   ДЕМО-СТРАНИЦА
   ============================================================ */

/* Заголовок страницы (компактный hero) */
.demo-hero {
    padding: 56px 0 40px;
    background: linear-gradient(135deg, rgb(0, 86, 179) 0%, rgb(0, 61, 128) 100%);
    color: #fff;
}
.demo-hero h1 {
    font-size: 34px; line-height: 1.2; letter-spacing: -.02em;
    margin: 0 0 10px; color: #fff;
}
.demo-hero h1 em { font-style: normal; color: var(--cta); }
.demo-hero p { margin: 0; max-width: 720px; color: rgba(255,255,255,.85); font-size: 17px; }

/* Сетка формы */
.demo-form-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.demo-form-card h2 { margin: 0 0 6px; font-size: 20px; }
.demo-form-card .hint { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.demo-field { margin-bottom: 14px; }
.demo-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.demo-input,
.demo-select {
    width: 100%; padding: 11px 13px;
    border: 1px solid var(--border); border-radius: 10px;
    font-size: 15px; font-family: inherit; color: var(--text); background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.demo-input:focus,
.demo-select:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, .15);
}
.demo-input.has-error,
.demo-select.has-error { border-color: var(--err-border); box-shadow: 0 0 0 3px rgba(153,27,27,.1); }
.demo-field-error { color: var(--err-text); font-size: 13px; margin-top: 6px; display: none; }
.demo-field-error.is-visible { display: block; }

.demo-select-description {
    font-size: 13px; color: var(--muted); margin-top: 6px; min-height: 1.2em;
}

.demo-actions {
    display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px;
}
.demo-actions .btn { min-height: 44px; padding: 11px 18px; font-size: 15px; }

.demo-form-alert {
    margin: 0 0 16px; padding: 12px 14px; border-radius: 10px;
    background: var(--err-bg); border: 1px solid var(--err-border); color: var(--err-text);
    font-size: 14px; display: none;
}
.demo-form-alert.is-visible { display: block; }

/* Блок «шаг»: Запрос / Ответ / Этикетка */
.demo-step { margin-bottom: 24px; }
.demo-step-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.demo-step-title {
    margin: 0; font-size: 16px; letter-spacing: -.01em;
    display: inline-flex; align-items: center; gap: 10px;
}
.demo-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--brand); color: #fff; font-size: 13px; font-weight: 700;
}
.demo-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 13px; font-weight: 600;
    background: var(--bg-soft); color: var(--muted);
    border: 1px solid var(--border);
}
.demo-status[data-kind="ok"]   { background: var(--ok-bg);  color: var(--ok-text);  border-color: var(--ok-border); }
.demo-status[data-kind="err"]  { background: var(--err-bg); color: var(--err-text); border-color: var(--err-border); }
.demo-status[data-kind="idle"] { background: var(--bg-soft); color: var(--muted); border-color: var(--border); }

.demo-pre {
    margin: 0; padding: 16px;
    background: #0f172a; color: #e2e8f0;
    border-radius: 12px; overflow: auto;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 13px; line-height: 1.55;
    max-height: 360px;
}
.demo-pre.empty { color: #94a3b8; font-style: italic; }

/* Заглушка этикетки */
.demo-label-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; min-height: 220px;
    border: 2px dashed var(--border); border-radius: 12px;
    color: var(--muted); font-size: 14px; text-align: center;
    background: var(--bg-soft); padding: 20px;
}
.demo-label-placeholder .ico { font-size: 34px; line-height: 1; opacity: .6; }
.demo-label-placeholder strong { color: var(--text); font-size: 15px; }

/* Рамка PDF внутри блока «Этикетка» */
.demo-label-frame {
    display: block;
    width: 100%;
    min-height: 560px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}

/* Действия под PDF */
.demo-label-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 12px;
}
.demo-label-meta {
    font-size: 13px;
    color: var(--muted);
}

/* Когда блок «Этикетка» переключён с плейсхолдера на PDF —
   убираем пунктирную рамку и фон. */
#demo-label-preview:not(.demo-label-placeholder) {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    min-height: 0;
}

/* Мелкая подсказка под блоком «Ответ API» (когда тело — PDF) */
.demo-pre-hint {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

@media (max-width: 640px) {
    .demo-label-frame { min-height: 420px; }
}

/* Мобильная адаптация демо */
@media (max-width: 640px) {
    .demo-hero { padding: 40px 0 28px; }
    .demo-hero h1 { font-size: 24px; }
    .demo-hero p { font-size: 15px; }
    .demo-form-card { padding: 18px; }
    .demo-pre { font-size: 12px; padding: 12px; }
    .demo-actions { flex-direction: column; }
    .demo-actions .btn { width: 100%; }
}