/* ========== FCN — Страница для рекламодателей ========== */

.adv-hero {
    padding: 48px 0 32px;
    text-align: center;
}

.adv-hero h1 { margin-bottom: 12px; }
.adv-hero p {
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    font-size: 1.05rem;
}

/* Преимущества */
.adv-benefits {
    background: var(--bg-secondary);
}

.adv-benefits-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .adv-benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .adv-benefits-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Как это работает */
.adv-steps {
    background: var(--bg-primary);
}

.adv-steps .steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 1024px) {
    .adv-steps .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Статистика */
.adv-stats {
    background: var(--bg-secondary);
}

.adv-stats-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 700px;
    margin: 0 auto;
}

.adv-stats-grid .stat {
    flex: 1 1 160px;
    max-width: 200px;
}

/* CTA для рекламодателей */
.adv-cta {
    background: var(--bg-primary);
}

.adv-cta-inner {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.adv-cta-inner h2 {
    margin-bottom: 16px;
}

.adv-cta-inner p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.adv-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

/* ========== Схема работы CPA-сети ========== */

.adv-cpa-scheme {
    background:
        radial-gradient(ellipse 70% 55% at 50% 0%, rgba(230, 57, 70, 0.07) 0%, transparent 65%),
        radial-gradient(ellipse 40% 30% at 10% 90%, rgba(201, 168, 76, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 90% 90%, rgba(201, 168, 76, 0.05) 0%, transparent 50%),
        var(--bg-secondary);
}

.cpa-diagram {
    max-width: 1060px;
    margin: 0 auto;
}

/* ---- Арка КЛИЕНТЫ ---- */
.cpa-clients-arc {
    text-align: center;
    margin-bottom: 2px;
}

.cpa-clients-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* SVG-дуга КЛИЕНТЫ */
.cpa-arc-svg {
    width: 62%;
    height: 32px;
    display: block;
    margin: 0 auto;
    overflow: visible;
    stroke: rgba(255, 255, 255, 0.32);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cpa-arc-svg path {
    fill: none;
}

.cpa-arc-svg polygon {
    fill: rgba(255, 255, 255, 0.32);
    stroke: none;
}

[data-theme="light"] .cpa-arc-svg {
    stroke: rgba(0, 0, 0, 0.38);
}

[data-theme="light"] .cpa-arc-svg polygon {
    fill: rgba(0, 0, 0, 0.38);
}

/* ---- Основная схема ---- */
.cpa-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 12px;
}

/* ---- Пилюли (источники трафика / продукты) ---- */
.cpa-pills {
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex-shrink: 0;
    width: 182px;
}

.cpa-pills--left { align-items: flex-end; }
.cpa-pills--right { align-items: flex-start; }

.cpa-pill {
    display: inline-block;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    text-transform: uppercase;
}

.cpa-pill--red {
    background: rgba(230, 57, 70, 0.85);
    border: 1px solid rgba(230, 57, 70, 0.5);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .cpa-pill--red {
    background: #E63946;
    color: #fff;
    border-color: #C62D38;
}

.cpa-pill--gold {
    background: rgba(201, 168, 76, 0.18);
    border: 1px solid rgba(201, 168, 76, 0.4);
    color: var(--gold);
}

[data-theme="light"] .cpa-pill--gold {
    background: rgba(201, 168, 76, 0.15);
    border-color: rgba(201, 168, 76, 0.5);
    color: #8A6A10;
}

.cpa-pill--blue {
    background: rgba(42, 171, 238, 0.13);
    border: 1px solid rgba(42, 171, 238, 0.3);
    color: #5BC4F5;
}

[data-theme="light"] .cpa-pill--blue {
    background: rgba(42, 171, 238, 0.1);
    border-color: rgba(42, 171, 238, 0.35);
    color: #1078AC;
}

/* ---- Ноды (Веб-мастер, Партнёр) ---- */
.cpa-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.cpa-node-icon {
    background: #1C1C22;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.cpa-node-icon svg {
    width: 58px;
    height: 58px;
    display: block;
}

.cpa-node-name {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    color: var(--text-primary);
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---- Flex-column сетка ---- */
.cpa-inner {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Строка дуг: один SVG на всю ширину */
.cpa-arc-wrapper {
    width: 100%;
}

.cpa-arc-labels {
    display: flex;
    margin-bottom: 4px;
}

.cpa-arc-labels .cpa-conn-label:first-child {
    flex: 0 0 50%;
    text-align: right;
    padding-right: 8%;
}

.cpa-arc-labels .cpa-conn-label:last-child {
    flex: 0 0 50%;
    text-align: left;
    padding-left: 8%;
}

.cpa-arcs-svg {
    width: 100%;
    height: 75px;
    display: block;
    overflow: visible;
    stroke: rgba(255, 255, 255, 0.32);
    fill: rgba(255, 255, 255, 0.32);
}

.cpa-arcs-svg path { fill: none; }

[data-theme="light"] .cpa-arcs-svg {
    stroke: rgba(0, 0, 0, 0.38);
    fill: rgba(0, 0, 0, 0.38);
}

/* Строка нод: WM | FCN | Партнёр */
.cpa-nodes-row {
    display: flex;
    align-items: center;
}

.cpa-node--wm,
.cpa-node--partner {
    flex: 1;
}

.cpa-inner .cpa-fcn-pill {
    flex-shrink: 0;
}

/* Деньги */
.cpa-money-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px 0;
}


.cpa-conn-label {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
}


/* ---- FCN-пилюля ---- */
.cpa-fcn-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 13px 22px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-full);
    box-shadow:
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    white-space: nowrap;
    flex-shrink: 0;
}

[data-theme="light"] .cpa-fcn-pill {
    background: #2A2A34;
    border-color: #3A3A46;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .cpa-fcn-pill span {
    color: #F0F0F2;
}

.cpa-fcn-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.cpa-fcn-pill span {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.06em;
}

/* ---- Нижний ряд: ₽ ← / FCN / ₽ ← ---- */

.cpa-money {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* SVG стрелки ← для денежных потоков (золотые) */
.cpa-money-svg {
    width: 30px;
    height: 9px;
    flex-shrink: 0;
    display: block;
    overflow: visible;
    stroke: rgba(201, 168, 76, 0.7);
    fill: rgba(201, 168, 76, 0.7);
}

.cpa-money-svg line {
    fill: none;
}

.cpa-ruble {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 14px rgba(201, 168, 76, 0.5);
    flex-shrink: 0;
    line-height: 1;
}

.cpa-fcn-sublabel {
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ---- Адаптив ---- */
@media (max-width: 960px) {
    .cpa-pills { width: 150px; }
    .cpa-pill { font-size: 0.62rem; padding: 4px 10px; }
    .cpa-fcn-pill { padding: 11px 18px; }
    .cpa-flow { gap: 6px; }
}

@media (max-width: 700px) {
    .cpa-flow {
        flex-direction: column;
        gap: 20px;
    }

    .cpa-pills {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        width: auto;
    }

    .cpa-pills--left,
    .cpa-pills--right { align-items: center; }

    .cpa-inner {
        width: 100%;
        max-width: 400px;
    }

    .cpa-arc-labels .cpa-conn-label:first-child { padding-right: 5%; }
    .cpa-arc-labels .cpa-conn-label:last-child  { padding-left: 5%; }

    .cpa-nodes-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
    }

    .cpa-inner .cpa-fcn-pill {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .cpa-node--wm,
    .cpa-node--partner {
        flex: 0 0 auto;
    }

    .cpa-node-icon svg { width: 56px; height: 56px; }
}

/* ========== Вариант A: единый SVG ========== */

.va-diagram { max-width: 1060px; margin: 0 auto; }

.cpa-single-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

.cpa-s-arc {
    fill: none;
    stroke: rgba(255,255,255,0.32);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.cpa-s-arr { fill: rgba(255,255,255,0.32); }

.cpa-s-top-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    fill: rgba(255,255,255,0.55);
    text-transform: uppercase;
    font-family: inherit;
}

.cpa-s-conn-label {
    font-size: 7.5px;
    font-weight: 600;
    letter-spacing: 0.07em;
    fill: rgba(255,255,255,0.5);
    text-transform: uppercase;
    font-family: inherit;
}

.cpa-s-node-bg {
    fill: #1C1C22;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 1;
}

.cpa-s-node-name {
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.13em;
    fill: rgba(255,255,255,0.9);
    text-transform: uppercase;
    font-family: inherit;
}

.cpa-s-fcn-bg {
    fill: #1E1E28;
    stroke: rgba(255,255,255,0.18);
    stroke-width: 1.5;
}

.cpa-s-fcn-text {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.06em;
    fill: rgba(255,255,255,0.95);
    font-family: inherit;
}

.cpa-s-money-line {
    stroke: rgba(201,168,76,0.7);
    stroke-width: 1.5;
}

.cpa-s-money-arr { fill: rgba(201,168,76,0.7); }

.cpa-s-ruble {
    font-size: 17px;
    font-weight: 700;
    fill: #C9A84C;
    font-family: inherit;
}

.cpa-s-sublabel {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.22em;
    fill: rgba(255,255,255,0.28);
    text-transform: uppercase;
    font-family: inherit;
}

.cpa-s-pill-gold {
    fill: rgba(201,168,76,0.18);
    stroke: rgba(201,168,76,0.4);
    stroke-width: 0.8;
}

.cpa-s-pill-gold-t {
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.05em;
    fill: #C9A84C;
    text-transform: uppercase;
    font-family: inherit;
}

.cpa-s-pill-blue {
    fill: rgba(42,171,238,0.13);
    stroke: rgba(42,171,238,0.3);
    stroke-width: 0.8;
}

.cpa-s-pill-blue-t {
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.05em;
    fill: #5BC4F5;
    text-transform: uppercase;
    font-family: inherit;
}

[data-theme="light"] .cpa-s-arc   { stroke: rgba(0,0,0,0.32); }
[data-theme="light"] .cpa-s-arr   { fill: rgba(0,0,0,0.32); }
[data-theme="light"] .cpa-s-top-label  { fill: rgba(0,0,0,0.55); }
[data-theme="light"] .cpa-s-conn-label { fill: rgba(0,0,0,0.45); }
[data-theme="light"] .cpa-s-node-bg   { fill: #f2f2f5; stroke: rgba(0,0,0,0.12); }
[data-theme="light"] .cpa-s-node-name { fill: rgba(0,0,0,0.85); }
[data-theme="light"] .cpa-s-fcn-bg    { fill: #2A2A34; }
[data-theme="light"] .cpa-s-sublabel  { fill: rgba(0,0,0,0.28); }
[data-theme="light"] .cpa-s-pill-gold { fill: rgba(201,168,76,0.15); stroke: rgba(201,168,76,0.5); }
[data-theme="light"] .cpa-s-pill-gold-t { fill: #8A6A10; }
[data-theme="light"] .cpa-s-pill-blue   { fill: rgba(42,171,238,0.1); stroke: rgba(42,171,238,0.35); }
[data-theme="light"] .cpa-s-pill-blue-t { fill: #1078AC; }

/* ========== Старые варианты (не используются) ========== */

.alt-variant-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 4px;
}

/* ---- Вариант 1: пошаговые карточки ---- */

.v1-diagram {
    max-width: 1060px;
    margin: 0 auto;
}

.v1-clients-row {
    text-align: center;
}

.v1-clients-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--text-secondary);
    margin-bottom: 2px;
    text-transform: uppercase;
}

.v1-clients-arc {
    width: 50%;
    margin: 0 auto;
    height: 28px;
    border-top: 1.5px solid rgba(255, 255, 255, 0.32);
    border-left: 1.5px solid rgba(255, 255, 255, 0.32);
    border-right: 1.5px solid rgba(255, 255, 255, 0.32);
    border-radius: 50% 50% 0 0;
    position: relative;
}

.v1-clients-arc::before,
.v1-clients-arc::after {
    content: '';
    position: absolute;
    bottom: -5px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid rgba(255, 255, 255, 0.32);
}

.v1-clients-arc::before { left: -3px; }
.v1-clients-arc::after  { right: -3px; }

[data-theme="light"] .v1-clients-arc {
    border-color: rgba(0, 0, 0, 0.32);
}
[data-theme="light"] .v1-clients-arc::before,
[data-theme="light"] .v1-clients-arc::after {
    border-top-color: rgba(0, 0, 0, 0.32);
}

.v1-flow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 10px;
}

.v1-node {
    flex-shrink: 0;
    align-items: center;
}

.v1-node-money {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.05em;
    margin-top: 4px;
}

.v1-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.v1-arrow-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
}

.v1-arrow-line {
    width: 60px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.32);
    position: relative;
}

.v1-arrow-line::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid rgba(255, 255, 255, 0.32);
}

[data-theme="light"] .v1-arrow-line {
    background: rgba(0, 0, 0, 0.32);
}
[data-theme="light"] .v1-arrow-line::after {
    border-left-color: rgba(0, 0, 0, 0.32);
}

.v1-fcn { flex-shrink: 0; }

/* ── Форма заявки рекламодателя ──────────────────────────────────── */

.adv-form {
    background: var(--bg-primary);
}

.adv-form-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 48px;
    max-width: 840px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}

.adv-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.adv-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.adv-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.adv-form-group label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.adv-form-group input,
.adv-form-group textarea {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    padding: 12px 16px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.adv-form-group input:focus,
.adv-form-group textarea:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.15);
}

.adv-form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.adv-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.adv-form-note {
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin: 0;
}

.adv-form-status {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
}

.adv-form-status.success {
    background: rgba(46, 160, 67, 0.12);
    border: 1px solid rgba(46, 160, 67, 0.3);
    color: #4caf6e;
}

.adv-form-status.error {
    background: rgba(230, 57, 70, 0.12);
    border: 1px solid rgba(230, 57, 70, 0.3);
    color: var(--red-light);
}

.adv-form-honeypot {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

@media (max-width: 768px) {
    .adv-form-card { padding: 24px 20px; }
    .adv-form-row { grid-template-columns: 1fr; }
    .adv-form-footer { flex-direction: column; align-items: flex-start; }
}

/* ---- Вариант 4: Mermaid ---- */

.v4-diagram {
    max-width: 800px;
    margin: 0 auto;
}

.v4-diagram .mermaid {
    display: flex;
    justify-content: center;
}

@media (max-width: 700px) {
    .v1-flow {
        flex-direction: column;
        gap: 16px;
    }

    .v1-clients-arc { width: 80%; }

    .v1-arrow-line { width: 40px; }
}

/* ========== С нами уже работают ========== */

.adv-partners {
    background: var(--bg-primary);
}

.logos-marquee-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 40px;
}

.logos-marquee {
    display: flex;
    overflow: hidden;
    position: relative;
}

/* Затухание краёв через псевдоэлементы — надёжнее mask-image (нет мерцания при GPU-композитинге) */
.logos-marquee::before,
.logos-marquee::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10%;
    min-width: 80px;
    z-index: 2;
    pointer-events: none;
    flex-shrink: 0;
}

.logos-marquee::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary) 0%, transparent 100%);
}

.logos-marquee::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary) 0%, transparent 100%);
}

.logos-marquee:hover .logos-track {
    animation-play-state: paused;
}

.logos-track {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
    /* отрицательный delay: полоска уже "в движении" при загрузке страницы */
    animation: logos-scroll 36s linear -18s infinite;
    will-change: transform;
    backface-visibility: hidden;
}

.logos-marquee--reverse .logos-track {
    animation-direction: reverse;
    animation-duration: 46s;
    animation-delay: -23s;
}

/* 4 копии логотипов → анимируем на -25% (= 1 копия), цикл бесшовный */
@keyframes logos-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-25%); }
}

.logo-card {
    flex-shrink: 0;
    width: 148px;
    height: 84px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: border-color 0.2s;
}

[data-theme="light"] .logo-card {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.07);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.logo-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
}
