/* ==========================================================================
   Публичная часть POS Plugin: лендинг, инструкция, документы, вход
   Поверх Bootstrap 4. Палитра и размеры — в переменных.
   ========================================================================== */

:root {
    --s-bg: #ffffff;
    --s-bg-soft: #f6f7f9;
    --s-border: #e6e8ec;
    --s-text: #0f172a;
    --s-text-2: #475569;
    --s-muted: #64748b;
    --s-brand: #f14635;          /* Kaspi */
    --s-brand-dark: #d8331f;
    --s-brand-soft: #fff1ee;
    --s-primary: #2563eb;
    --s-primary-dark: #1d4ed8;
    --s-success: #12b76a;
    --s-warning-soft: #fff7e6;
    --s-radius: 16px;
    --s-radius-sm: 10px;
    --s-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
    --s-shadow-lg: 0 24px 60px rgba(15, 23, 42, .12);
    --s-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --s-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --s-container: 1120px;
}

/* ---------- База ---------- */

body.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: var(--s-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--s-text);
    background: var(--s-bg);
    -webkit-font-smoothing: antialiased;
}

.site a { color: var(--s-primary); }
.site a:hover { color: var(--s-primary-dark); }
.site h1, .site h2, .site h3, .site h4, .site h5, .site h6 { font-weight: 700; letter-spacing: -.02em; color: var(--s-text); }
.site img { max-width: 100%; height: auto; }
.site code {
    padding: 2px 6px;
    font-family: var(--s-mono);
    font-size: .86em;
    color: var(--s-text);
    background: var(--s-bg-soft);
    border-radius: 6px;
    word-break: break-word;
}

.site-container { width: 100%; max-width: var(--s-container); margin: 0 auto; padding: 0 20px; }
.site-main { flex: 1; }
.icon { flex-shrink: 0; vertical-align: middle; }

/* ---------- Шапка ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, .85);
    border-bottom: 1px solid var(--s-border);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
}
.site-header .site-container { display: flex; align-items: center; gap: 24px; height: 64px; }

.site .site-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    color: var(--s-text);
    text-decoration: none;
    letter-spacing: -.02em;
}
.site-logo-mark { display: grid; place-items: center; width: 30px; height: 30px; }
.site-logo-tag {
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--s-brand);
    border-radius: 6px;
    letter-spacing: 0;
}

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.site .site-nav-link {
    padding: 8px 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--s-text-2);
    border-radius: 8px;
    text-decoration: none;
    transition: color .15s, background .15s;
}
.site .site-nav-link:hover { color: var(--s-text); background: var(--s-bg-soft); }
.site .site-nav-link.is-active { color: var(--s-text); font-weight: 600; }

.site-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    margin-left: auto;
    padding: 0;
    color: var(--s-text);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 860px) {
    .site-menu-btn { display: grid; place-items: center; }
    .site-nav {
        position: absolute;
        top: 64px;
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 12px 20px 20px;
        background: #fff;
        border-bottom: 1px solid var(--s-border);
        box-shadow: 0 12px 24px rgba(15, 23, 42, .08);
    }
    .site-menu-open .site-nav { display: flex; }
    .site-nav .btn { margin-top: 8px; }
}

/* ---------- Кнопки ---------- */

.site .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--s-radius-sm);
    transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.site .btn:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, .2); }
.site .btn-lg { padding: 14px 24px; font-size: 16px; }
.site .btn-sm { padding: 7px 12px; font-size: 14px; }

.site .btn-primary { color: #fff; background: var(--s-primary); border-color: var(--s-primary); }
.site .btn-primary:hover { color: #fff; background: var(--s-primary-dark); border-color: var(--s-primary-dark); }
.site .btn-primary:disabled { background: var(--s-primary); border-color: var(--s-primary); opacity: .45; }

.site .btn-brand { color: #fff; background: var(--s-brand); border-color: var(--s-brand); box-shadow: 0 6px 16px rgba(241, 70, 53, .25); }
.site .btn-brand:hover { color: #fff; background: var(--s-brand-dark); border-color: var(--s-brand-dark); transform: translateY(-1px); }

.site .btn-light { color: var(--s-text); background: #fff; border-color: var(--s-border); }
.site .btn-light:hover { color: var(--s-text); background: var(--s-bg-soft); border-color: #d5d9e0; }

.site .btn-dark { color: #fff; background: var(--s-text); border-color: var(--s-text); }
.site .btn-dark:hover { color: #fff; background: #1e293b; }

/* ---------- Первый экран ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 88px;
    background:
        radial-gradient(600px 360px at 85% 20%, rgba(241, 70, 53, .16), transparent 70%),
        radial-gradient(500px 320px at 10% 90%, rgba(37, 99, 235, .10), transparent 70%),
        var(--s-bg);
}
.hero::before {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(var(--s-border) 1px, transparent 1px), linear-gradient(90deg, var(--s-border) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 65%);
    mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 65%);
    opacity: .6;
    content: "";
}
.hero .site-container { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 6px 12px 6px 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--s-text-2);
    background: #fff;
    border: 1px solid var(--s-border);
    border-radius: 999px;
    box-shadow: var(--s-shadow);
}
.hero-eyebrow b {
    padding: 2px 8px;
    font-size: 12px;
    color: var(--s-brand);
    background: var(--s-brand-soft);
    border-radius: 999px;
}

.site .hero h1 {
    margin: 0 0 20px;
    font-size: clamp(34px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.035em;
}
.hero h1 em { font-style: normal; color: var(--s-brand); }
.hero-lead { max-width: 560px; margin: 0 0 32px; font-size: 19px; color: var(--s-text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 28px; font-size: 14px; color: var(--s-muted); }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note .icon { color: var(--s-success); }

.hero-visual { position: relative; display: grid; place-items: center; min-height: 380px; }
.hero-visual::before {
    position: absolute;
    width: 78%;
    aspect-ratio: 1;
    background: linear-gradient(140deg, #fff 0%, var(--s-brand-soft) 100%);
    border: 1px solid #fde1dc;
    border-radius: 40%;
    transform: rotate(-8deg);
    content: "";
}
.hero-visual > img { position: relative; width: 86%; max-width: 420px; filter: drop-shadow(0 30px 40px rgba(15, 23, 42, .2)); }

.hero-chip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--s-border);
    border-radius: 14px;
    box-shadow: var(--s-shadow-lg);
    animation: hero-float 6s ease-in-out infinite;
}
.hero-chip small { display: block; font-size: 12px; font-weight: 400; color: var(--s-muted); }
.hero-chip-iiko { top: 8%; left: 0; }
.hero-chip-iiko img { width: 54px; }
.hero-chip-paid { right: 0; bottom: 12%; animation-delay: -3s; }
.hero-chip-paid .hero-chip-dot {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: #fff;
    background: var(--s-success);
    border-radius: 50%;
}
@keyframes hero-float { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .hero-chip { animation: none; } }

@media (max-width: 860px) {
    .hero { padding: 40px 0 56px; }
    .hero .site-container { grid-template-columns: 1fr; gap: 24px; }
    .hero-visual { min-height: 300px; }
    .hero-lead { font-size: 17px; }
}

/* ---------- Секции ---------- */

.section { padding: 80px 0; }
.section-soft { background: var(--s-bg-soft); }
.section-head { max-width: 640px; margin: 0 auto 40px; text-align: center; }
.site .section-head h2 { margin: 0 0 12px; font-size: clamp(28px, 3.4vw, 38px); }
.section-head p { margin: 0; font-size: 18px; color: var(--s-text-2); }
.section-kicker { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 700; color: var(--s-brand); text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 860px) { .section { padding: 56px 0; } }

/* Шаги «как это работает» */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step {
    position: relative;
    padding: 28px;
    background: #fff;
    border: 1px solid var(--s-border);
    border-radius: var(--s-radius);
    box-shadow: var(--s-shadow);
}
.step::before {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 18px;
    font-weight: 800;
    color: var(--s-brand);
    background: var(--s-brand-soft);
    border-radius: 12px;
    counter-increment: step;
    content: counter(step);
}
.site .step h3 { margin: 0 0 8px; font-size: 19px; }
.step p { margin: 0; color: var(--s-text-2); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* Совместимость + цена */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.panel {
    padding: 32px;
    background: #fff;
    border: 1px solid var(--s-border);
    border-radius: var(--s-radius);
    box-shadow: var(--s-shadow);
}
.site .panel h3 { margin: 0 0 16px; font-size: 22px; }

.checklist { margin: 0; padding: 0; list-style: none; }
.checklist li { position: relative; padding: 8px 0 8px 32px; border-top: 1px solid var(--s-border); }
.checklist li:first-child { border-top: 0; }
.checklist li::before {
    position: absolute;
    top: 13px;
    left: 0;
    width: 20px;
    height: 20px;
    background: var(--s-success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
    border-radius: 50%;
    content: "";
}

.price-panel {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: radial-gradient(400px 240px at 100% 0%, rgba(241, 70, 53, .55), transparent 70%), var(--s-text);
    border: 0;
}
.site .price-panel h3 { color: #fff; }
.price-value { margin: 8px 0 4px; font-size: 52px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.price-value small { font-size: 18px; font-weight: 500; color: rgba(255, 255, 255, .7); letter-spacing: 0; }
.price-panel p { color: rgba(255, 255, 255, .75); }
.price-panel { display: flex; flex-direction: column; }
.price-panel .btn { align-self: flex-start; margin-top: auto; }
.price-panel p { margin-bottom: 24px; }

/* Выноска-предупреждение */
.callout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 24px 0;
    padding: 16px 18px;
    color: var(--s-text);
    background: var(--s-warning-soft);
    border: 1px solid #fde4b5;
    border-radius: var(--s-radius-sm);
}
.callout .icon { margin-top: 2px; color: #dc6803; }
.callout p { margin: 0; }
.callout-danger { background: var(--s-brand-soft); border-color: #fcd3cc; }
.callout-danger .icon { color: var(--s-brand); }

/* Призыв к действию */
.cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 40px;
    background: linear-gradient(120deg, var(--s-brand-soft), #eef4ff);
    border-radius: 24px;
}
.site .cta h2 { margin: 0 0 6px; font-size: 28px; }
.cta p { margin: 0; color: var(--s-text-2); }

/* ---------- Внутренние страницы ---------- */

.page-hero {
    padding: 48px 0 32px;
    background: linear-gradient(180deg, var(--s-bg-soft), var(--s-bg));
    border-bottom: 1px solid var(--s-border);
}
.site .page-hero h1 { max-width: 820px; margin: 0; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.15; }
.page-hero p { max-width: 720px; margin: 12px 0 0; font-size: 18px; color: var(--s-text-2); }
.page-body { padding: 40px 0 72px; }

/* Текстовые страницы (инструкция, оферта, политика) */
.prose { max-width: 820px; color: var(--s-text-2); }
.prose > *:first-child { margin-top: 0; }
.site .prose h2, .site .prose h3 { margin: 48px 0 16px; font-size: 26px; color: var(--s-text); scroll-margin-top: 88px; }
.site .prose h4 { margin: 28px 0 12px; font-size: 19px; scroll-margin-top: 88px; }
.site .prose h6 { margin: 20px 0 4px; font-size: 16px; }
.prose p, .prose li { line-height: 1.7; }
.prose img { display: block; margin: 8px 0; border: 1px solid var(--s-border); border-radius: 12px; box-shadow: var(--s-shadow); }
.prose pre, .prose .code-block {
    display: block;
    padding: 16px 18px;
    font-family: var(--s-mono);
    font-size: 13px;
    line-height: 1.7;
    color: #e2e8f0;
    background: #0f172a;
    border-radius: 12px;
    overflow-x: auto;
    white-space: pre;
}

/* Юридические документы: многоуровневая нумерация 1. / 1.1. */
.legal ol { padding-left: 0; list-style: none; counter-reset: li; }
.legal ol ol { margin-top: 8px; padding-left: 28px; }
.legal li { margin: 8px 0; }
.legal li::before { margin-right: 6px; font-weight: 600; color: var(--s-text); counter-increment: li; content: counters(li, ".") ". "; }
.legal > ol > li { margin-top: 32px; font-weight: 700; color: var(--s-text); }
.legal > ol > li > ol { font-weight: 400; color: var(--s-text-2); }

/* Оглавление инструкции */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; }
.doc-toc { position: sticky; top: 88px; font-size: 14px; }
.doc-toc-title { margin-bottom: 10px; font-size: 12px; font-weight: 700; color: var(--s-muted); text-transform: uppercase; letter-spacing: .08em; }
.doc-toc ol { margin: 0; padding: 0; list-style: none; }
.doc-toc ol ol { padding-left: 14px; }
.site .doc-toc a {
    display: block;
    padding: 5px 10px;
    color: var(--s-text-2);
    border-left: 2px solid var(--s-border);
    text-decoration: none;
}
.site .doc-toc a:hover { color: var(--s-text); border-left-color: var(--s-brand); }
@media (max-width: 960px) {
    .doc-layout { grid-template-columns: 1fr; gap: 24px; }
    .doc-toc { position: static; padding: 16px; background: var(--s-bg-soft); border-radius: 12px; }
}

/* Сегментированный переключатель (вкладки инструкции) */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 20px; padding: 4px; background: var(--s-bg-soft); border-radius: 12px; }
.site .segmented .nav-link {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--s-text-2);
    border-radius: 9px;
    text-decoration: none;
}
.site .segmented .nav-link.active { color: var(--s-text); background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }

/* Версии */
.versions { margin: 0; padding: 0; list-style: none; }
.versions li { padding: 14px 0; border-top: 1px solid var(--s-border); }
.versions li:first-child { border-top: 0; }
.versions b { color: var(--s-text); }
.versions time { margin-left: 8px; font-size: 14px; color: var(--s-muted); }

/* FAQ */
.faq { display: grid; gap: 12px; max-width: 860px; }
.faq-item { background: #fff; border: 1px solid var(--s-border); border-radius: var(--s-radius); box-shadow: var(--s-shadow); scroll-margin-top: 88px; }
.faq-item summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    font-weight: 600;
    color: var(--s-text);
    cursor: pointer;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 20px no-repeat;
    transition: transform .2s;
    content: "";
}
.faq-item[open] summary::after { transform: rotate(180deg); }
.faq-body { padding: 0 24px 24px; color: var(--s-text-2); }
.faq-body ol { padding-left: 20px; }
.video { position: relative; max-width: 640px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Формы входа и регистрации ---------- */

.site-auth {
    display: grid;
    place-items: start center;
    padding: 56px 20px 80px;
    background:
        radial-gradient(500px 300px at 80% 0%, rgba(241, 70, 53, .10), transparent 70%),
        radial-gradient(500px 300px at 0% 100%, rgba(37, 99, 235, .08), transparent 70%),
        var(--s-bg-soft);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 36px;
    background: #fff;
    border: 1px solid var(--s-border);
    border-radius: 20px;
    box-shadow: var(--s-shadow-lg);
}
.auth-card-wide { max-width: 640px; }
.site .auth-card h1 { margin: 0 0 6px; font-size: 26px; }
.auth-sub { margin: 0 0 24px; color: var(--s-muted); }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 24px; padding-top: 20px; font-size: 14px; border-top: 1px solid var(--s-border); }
.auth-links a { text-decoration: none; }

.site label, .site .form_label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; color: var(--s-text); }
.site .form-group { margin-bottom: 16px; }
.site .form-control {
    height: auto;
    padding: 11px 14px;
    font-size: 15px;
    color: var(--s-text);
    background: #fff;
    border: 1px solid #d5d9e0;
    border-radius: var(--s-radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
.site .form-control:focus { border-color: #93b4f8; box-shadow: 0 0 0 4px rgba(37, 99, 235, .12); }
.site .error, .site .form-error { margin-top: 6px; font-size: 14px; color: #d92d20; }
.site .error:empty { display: none; }
.site .form-hint { display: block; margin-top: 6px; font-size: 13px; color: var(--s-muted); }
.site .btn-block { width: 100%; }

.site .alert { padding: 12px 16px; font-size: 15px; border: 1px solid transparent; border-radius: var(--s-radius-sm); }
.site .alert-success { color: #065f46; background: #ecfdf3; border-color: #abefc6; }
.site .alert-danger { color: #912018; background: #fef3f2; border-color: #fecdca; }
.site .alert-info, .site .alert-primary { color: #1e3a8a; background: #eff6ff; border-color: #bfdbfe; }

/* Страница оплаты клиентом */
.pay-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 14px; font-weight: 600; border-radius: 999px; }
.pay-status-danger { color: #b42318; background: #fef3f2; }
.pay-status-warning { color: #b54708; background: #fffaeb; }
.pay-status-success { color: #067647; background: #ecfdf3; }
.pay-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 20px 0; padding: 16px 18px; background: var(--s-bg-soft); border-radius: 12px; }
.pay-total strong { font-size: 28px; letter-spacing: -.02em; }
.pay-dealer { margin-top: 24px; padding-top: 20px; font-size: 14px; color: var(--s-text-2); border-top: 1px solid var(--s-border); }

/* ---------- Подвал ---------- */

.site-footer { padding: 32px 0; font-size: 14px; color: var(--s-muted); background: var(--s-bg-soft); border-top: 1px solid var(--s-border); }
.site-footer .site-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer-company { display: flex; flex-direction: column; gap: 2px; }
.site-footer-company b { color: var(--s-text); }
.site-footer-links { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 20px; }
.site .site-footer a { color: var(--s-text-2); text-decoration: none; }
.site .site-footer a:hover { color: var(--s-text); }

/* Промо-материалы */
.promo-card { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: center; }
.promo-card img { border-radius: 12px; box-shadow: var(--s-shadow); }
@media (max-width: 860px) { .promo-card { grid-template-columns: 1fr; } }
