/* ============================================================
   Kornox — design tokens, reset, base elements, shared components
   Dark graphite + orange. Loaded first on every page.
   ============================================================ */

:root {
    /* ========================================================
       BRAND — вся палитра меняется в этом блоке.
       Значения взяты из дизайн-системы Kornox CRM (web-crm).
       ======================================================== */
    --accent:        #007aff;                  /* основной акцент (iOS blue) */
    --accent-2:      #0062cc;                  /* нажатое состояние */
    --accent-light:  #4da3ff;                  /* светлая пара для градиента */
    --accent-soft:   rgba(0, 122, 255, .08);   /* фон акцентных плашек */
    --accent-ink:    #ffffff;                  /* текст на акцентных кнопках */

    --bg:            #ffffff;                  /* фон страницы */
    --bg-soft:       #f7f8fa;                  /* чередование секций */
    --panel:         #ffffff;                  /* карточки */
    --panel-2:       #ffffff;                  /* приподнятые панели, мокапы */
    --inset:         #f4f5f8;                  /* внутренние плашки в мокапах */
    --inset-2:       #eceef3;

    --ink:           #111111;                  /* заголовки */
    --text:          #36363a;                  /* основной текст */
    --muted:         #6b6b73;                  /* подписи */

    --line:          rgba(60, 60, 67, .1);
    --line-strong:   rgba(60, 60, 67, .16);

    --green:         #34c759;
    --green-soft:    rgba(52, 199, 89, .12);
    --red:           #ff3b30;
    --red-soft:      rgba(255, 59, 48, .1);
    --gold:          #ff9f0a;
    --gold-soft:     rgba(255, 159, 10, .12);
    --blue:          #007aff;
    --blue-soft:     rgba(0, 122, 255, .1);

    --font-display:  'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
    --font-body:     'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
    /* ======================== /BRAND ======================== */

    --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
    --radius-s: 12px;
    --radius: 16px;
    --radius-l: 24px;
    --radius-xl: 28px;
    --container: 1200px;
    /* Тени отключены (прозрачные). Чтобы вернуть — задайте здесь реальные значения. */
    --shadow-s: 0 0 0 0 rgba(0, 0, 0, 0);
    --shadow-m: 0 0 0 0 rgba(0, 0, 0, 0);
    --shadow-l: 0 0 0 0 rgba(0, 0, 0, 0);
}

/* ---------- Reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 90px;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 .5em;
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
}

h1 { font-size: clamp(2.1rem, 4.4vw, 3.3rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.3rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

ul, ol { margin: 0 0 1em; padding-left: 1.3em; }

img, svg, video { max-width: 100%; height: auto; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: 0; padding: 0; }

::selection { background: rgba(0, 122, 255, .2); }

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

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

/* ---------- Layout ---------- */

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.section { padding: 96px 0; }
.section-soft { background: var(--bg-soft); }
.section-tight { padding: 64px 0; }

.section-head {
    max-width: 760px;
    margin: 0 0 48px;
    text-align: left;
}

.section-head.center { margin: 0 auto 56px; text-align: center; }
.section-head.left { margin-left: 0; text-align: left; }

.section-head .lede { max-width: 640px; }

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--accent);
}

.lede { font-size: 1.12rem; color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

@media (max-width: 980px) {
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .section { padding: 64px 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.2;
    border: 1px solid transparent;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease, filter .15s ease;
    white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-primary:hover {
    background: var(--accent-2);
    color: var(--accent-ink);
}

.btn-ghost {
    background: #fff;
    color: var(--ink);
    border-color: var(--line-strong);
}

.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }

.btn-line {
    padding: 0;
    border: 0;
    color: var(--accent);
    font-weight: 600;
    border-radius: 0;
}

.btn-line::after { content: "→"; transition: transform .15s ease; }
.btn-line:hover::after { transform: translateX(3px); }

.btn-dark {
    background: #fff;
    color: var(--accent);
}

.btn-dark:hover { color: var(--accent-2); }

.btn-ghost-on-accent {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, .55);
}

.btn-ghost-on-accent:hover { border-color: #fff; color: #fff; }

.btn-lg { padding: 16px 32px; font-size: 1.02rem; border-radius: 999px; }

/* ---------- Shared components ---------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-l);
    padding: 30px;
    transition: border-color .2s ease, transform .2s ease;
}

.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--accent-2);
}

.chip-green { background: var(--green-soft); color: var(--green); }
.chip-gold { background: var(--gold-soft); color: var(--gold); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-blue { background: var(--blue-soft); color: var(--blue); }

.ico-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    flex: none;
}

.ico-tile svg { width: 22px; height: 22px; }

/* Feature list checkmarks */
.check-list { list-style: none; padding: 0; margin: 0 0 1.2em; }

.check-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 10px;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23007aff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/11px no-repeat;
}

/* FAQ (native details/summary) */
.faq-list { max-width: 780px; margin: 0; }

.faq-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-item summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: "+";
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--muted);
    transition: transform .2s ease;
    flex: none;
}

.faq-item[open] summary::after { transform: rotate(45deg); color: var(--accent); }

.faq-item .faq-a { padding: 0 22px 18px; color: var(--text); }

/* CTA band (orange finale above the footer) */
.cta-band { padding: 40px 0 96px; }

.cta-band-inner {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #007aff 0%, #2f8fff 60%, #5ac8fa 100%);
    padding: 72px 40px;
    text-align: center;
    color: rgba(255, 255, 255, .85);
}

.cta-band-inner::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(600px 300px at 15% 0%, rgba(255, 255, 255, .28), transparent 60%),
        radial-gradient(600px 300px at 85% 100%, rgba(0, 40, 90, .18), transparent 60%);
    pointer-events: none;
}

.cta-band-inner > * { position: relative; }

.cta-band-inner h2 { color: #fff; margin-bottom: .4em; }

.cta-band-inner p { max-width: 560px; margin: 0 auto 28px; font-weight: 500; }

.cta-band-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.cta-note { margin-top: 18px; font-size: .85rem; color: rgba(255, 255, 255, .75); }

.cta-note a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.cta-note a:hover { color: #eaf4ff; }

/* Reveal-on-scroll */
.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal.in { opacity: 1; transform: none; }

.reveal-group > * {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .6s ease, transform .6s ease;
}

.reveal-group.in > * { opacity: 1; transform: none; }

.reveal-group.in > *:nth-child(2) { transition-delay: .08s; }
.reveal-group.in > *:nth-child(3) { transition-delay: .16s; }
.reveal-group.in > *:nth-child(4) { transition-delay: .24s; }
.reveal-group.in > *:nth-child(5) { transition-delay: .32s; }
.reveal-group.in > *:nth-child(6) { transition-delay: .4s; }

/* Utility */
.tac { text-align: center; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
