/* ===== Страница «Интеграции с CRM и 1С»: потоки данных ===== */

.int {
    --gold: #ce9248;
    --gold-light: #f3d3a3;
    --bronze: #b79654;
    --cream: #f1e3d3;
    --muted: #a79c8f;
    --ink: #1a1108;
    --line: rgba(255, 255, 255, .09);
    --wire: rgba(206, 146, 72, .28);
    --glow: 0 0 5px rgba(255, 255, 255, .8);
    --display: "EB Garamond", Georgia, serif;
    --ui: Montserrat, Arial, sans-serif;

    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    color: var(--cream);
    font-family: var(--ui);
    -webkit-user-select: text;
    user-select: text;
}

.int p {
    margin: 0;
}

/* --- общие элементы --- */
.int-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--gold-light);
}

.int-kicker__sig {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold);
}

.int-kicker__sig:after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1.5px solid var(--gold);
    animation: int-ping 2.2s ease-out infinite;
}

@keyframes int-ping {
    0%   { transform: scale(.4); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.int-h2 {
    max-width: 760px;
    margin: 12px 0 34px;
    font-family: var(--display);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 600;
    line-height: 1.1;
    color: var(--cream);
    text-align: left;
    text-wrap: balance;
}

.int-section {
    margin-top: 110px;
}

.int-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.int-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 28px;
    border-radius: 999px;
    font: 600 15px/1.2 var(--ui);
    text-decoration: none;
    transition: transform .3s ease, box-shadow .3s ease, color .3s;
}

.int-btn:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

.int-btn--gold {
    color: var(--ink);
    background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, #9c6528);
    box-shadow: 0 10px 30px -12px rgba(206, 146, 72, .9);
}

.int-btn--gold:hover {
    transform: translateY(-2px);
}

.int-btn--ghost {
    color: var(--cream);
    background: #000;
    box-shadow: var(--glow);
}

.int-btn--ghost:hover {
    color: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, .9);
}

/* --- первый экран: всё по центру --- */
.int-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    text-align: center;
}

.int-hero__title {
    max-width: 900px;
    margin: 18px 0 22px;
    font-family: var(--display);
    font-size: clamp(40px, 5.6vw, 70px);
    font-weight: 600;
    line-height: 1.02;
    color: var(--cream);
    text-wrap: balance;
}

.int-hero__title em {
    font-style: italic;
    background: linear-gradient(40deg, #fff, #d4a729);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.int .int-hero__lead {
    max-width: 640px;
    margin-bottom: 30px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--muted);
}

.int-hero .int-actions {
    justify-content: center;
}

/* схема потоков */
.int-hub {
    width: 100%;
    margin-top: 50px;
}

.int-hub svg {
    display: block;
    width: 100%;
    height: auto;
}

/* вертикальная схема для телефонов */
.int-hub .int-hub__m {
    display: none;
    max-width: 440px;
    margin: 0 auto;
}

.int-hub__m .int-node text {
    font-size: 14px;
}

.int-hub__m .int-node text.int-node__sub {
    font-size: 10px;
}

.int-core--m .int-core__pulse {
    transform-origin: 200px 310px;
}

.int-packet--l text {
    text-anchor: end;
}

.int-hub__lines path {
    fill: none;
    stroke: var(--wire);
    stroke-width: 2;
    stroke-dasharray: 2 8;
    stroke-linecap: round;
    animation: int-flow 1.6s linear infinite;
}

@keyframes int-flow {
    to { stroke-dashoffset: -20; }
}

.int-packet circle {
    fill: var(--gold-light);
    filter: drop-shadow(0 0 6px rgba(206, 146, 72, .95));
}

.int-packet text {
    fill: var(--gold-light);
    font: 600 13px var(--ui);
}

.int-node rect {
    fill: #000;
    stroke: rgba(255, 255, 255, .55);
    stroke-width: 1;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, .45));
}

.int-node text {
    fill: #fff;
    font: 700 16px var(--ui);
    text-anchor: middle;
}

.int-node text.int-node__sub {
    fill: var(--muted);
    font: 500 11px var(--ui);
}

.int-core text {
    fill: var(--ink);
    font: 700 20px var(--display);
    text-anchor: middle;
}

.int-core__pulse {
    fill: none;
    stroke: var(--gold);
    stroke-width: 2;
    transform-origin: 500px 220px;
    animation: int-core 2.6s ease-out infinite;
}

@keyframes int-core {
    0%   { transform: scale(1); opacity: .8; }
    100% { transform: scale(1.7); opacity: 0; }
}

/* --- путь заказа: метро --- */
.int-mode {
    display: inline-flex;
    padding: 4px;
    margin-bottom: 36px;
    border-radius: 999px;
    background: #000;
    box-shadow: var(--glow);
}

.int-mode__btn {
    padding: 10px 20px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: 600 14px var(--ui);
    cursor: pointer;
    transition: background .3s, color .3s;
}

.int-mode__btn[aria-pressed="true"] {
    color: var(--ink);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.int-mode__btn:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 2px;
}

.int-metro {
    --p: 0;
    position: relative;
}

.int-metro__track {
    position: absolute;
    top: 13px;
    left: calc(100% / 12);
    right: calc(100% / 12);
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
}

.int-metro__track:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: calc(var(--p) * 100%);
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bronze), var(--gold-light));
    box-shadow: 0 0 14px rgba(206, 146, 72, .7);
    transition: width .2s linear;
}

.int-metro__train {
    position: absolute;
    top: 50%;
    left: calc(var(--p) * 100%);
    width: 30px;
    height: 16px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 0 16px rgba(255, 255, 255, .9);
    transform: translate(-50%, -50%);
    transition: left .2s linear;
}

.int-metro__stations {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    list-style: none;
}

.int-metro__stations li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    text-align: center;
}

.int-metro__stations i {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    border-radius: 50%;
    border: 4px solid #333;
    background: #000;
    transition: border-color .4s, box-shadow .4s;
}

.int-metro__stations li.is-passed i {
    border-color: var(--gold);
    box-shadow: 0 0 14px rgba(206, 146, 72, .7);
}

.int-metro__stations b {
    font-size: 15px;
    line-height: 1.3;
    color: #fff;
}

.int-metro__how {
    font-size: 13px;
    color: var(--gold-light);
    transition: color .3s;
}

.int-metro[data-mode="manual"] .int-metro__how {
    color: #c98b7a;
}

.int-metro[data-mode="manual"] .int-metro__track:before {
    background: repeating-linear-gradient(90deg, #7c5a4a 0 8px, transparent 8px 14px);
    box-shadow: none;
}

.int-metro[data-mode="manual"] .int-metro__stations li.is-passed i {
    border-color: #7c5a4a;
    box-shadow: none;
}

/* --- коммутационная панель --- */
.int-patch {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    padding: 1px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    list-style: none;
    overflow: hidden;
    box-shadow: var(--glow);
}

.int-patch li {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 20px 22px 44px;
    background: #050505;
    transition: background .3s;
}

.int-patch li:hover {
    background: #0f0d0b;
}

.int-patch i {
    position: absolute;
    left: 20px;
    top: 26px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 8px var(--gold);
    animation: int-led 3s ease-in-out infinite;
}

.int-patch li:nth-child(3n) i { animation-delay: .7s; }
.int-patch li:nth-child(3n+1) i { animation-delay: 1.5s; }
.int-patch li:nth-child(4n) i { animation-delay: 2.2s; }

@keyframes int-led {
    0%, 100% { opacity: 1; }
    45%      { opacity: .35; }
    50%      { opacity: 1; }
    55%      { opacity: .35; }
}

.int-patch small {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.int-patch b {
    font-size: 17px;
    color: #fff;
}

.int-patch__free {
    background: repeating-linear-gradient(135deg, #0a0806 0 10px, #110d09 10px 20px) !important;
}

.int-patch__free i {
    background: transparent;
    box-shadow: inset 0 0 0 2px var(--gold);
    animation: none;
}

.int-patch__free b {
    color: var(--gold-light);
}

/* --- таблица этапов --- */
.int-table {
    border-top: 1px solid rgba(206, 146, 72, .5);
}

.int-table__row {
    display: grid;
    grid-template-columns: 200px minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    line-height: 1.55;
    color: var(--muted);
}

.int-table__head {
    padding: 12px 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold);
}

.int-table__step {
    font-family: var(--display);
    font-size: 22px;
    font-weight: 600;
    color: #fff;
}

.int-table__row span:last-child {
    color: var(--gold-light);
}

.int-table__head span:last-child {
    color: var(--gold);
}

/* --- очередь --- */
.int-queue {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}

.int-queue__text > p:last-child {
    font-size: 17px;
    line-height: 1.65;
    color: var(--muted);
}

.int-queue__viz {
    position: relative;
    display: flex;
    align-items: center;
    height: 150px;
    padding: 0 20px;
    border-radius: 14px;
    background: #050505;
    box-shadow: var(--glow);
    overflow: hidden;
}

.int-queue__lane {
    position: relative;
    flex: 1;
    height: 40px;
}

.int-queue__msg {
    position: absolute;
    top: 0;
    left: 0;
    padding: 9px 12px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    animation: int-queue 8s cubic-bezier(.5, 0, .3, 1) infinite;
}

.int-queue__msg:nth-child(1) { --slot: 3; }
.int-queue__msg:nth-child(2) { --slot: 2; animation-delay: .15s; }
.int-queue__msg:nth-child(3) { --slot: 1; animation-delay: .3s; }
.int-queue__msg:nth-child(4) { --slot: 0; animation-delay: .45s; }

/* сообщения подъезжают к закрытому шлагбауму, ждут и уходят, когда CRM снова доступна */
@keyframes int-queue {
    0%   { transform: translateX(-120px); opacity: 0; }
    10%  { opacity: 1; }
    30%  { transform: translateX(calc(var(--slot) * 74px)); }
    65%  { transform: translateX(calc(var(--slot) * 74px)); opacity: 1; }
    90%  { transform: translateX(calc(var(--slot) * 74px + 330px)); opacity: 0; }
    100% { transform: translateX(calc(var(--slot) * 74px + 330px)); opacity: 0; }
}

.int-queue__gate {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 12px;
    border-radius: 10px;
    background: #000;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.int-queue__light {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    animation: int-gate 8s steps(1) infinite;
}

@keyframes int-gate {
    0%   { background: #c0533c; box-shadow: 0 0 10px #c0533c; }
    62%  { background: var(--gold-light); box-shadow: 0 0 12px var(--gold); }
    100% { background: #c0533c; box-shadow: 0 0 10px #c0533c; }
}

/* --- вопросы --- */
.int-faq .faq {
    max-width: 820px;
}

/* --- финал --- */
.int-final {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 120px;
    padding: 60px 24px;
    border-radius: 24px;
    text-align: center;
    background:
        radial-gradient(500px 260px at 50% 0%, rgba(206, 146, 72, .2), transparent 70%),
        #050505;
    box-shadow: var(--glow);
}

.int-final__node {
    position: relative;
    width: 22px;
    height: 22px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold) 60%, #8a5a22);
}

.int-final__node:after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    animation: int-ping 2.2s ease-out infinite;
}

.int-final .int-h2 {
    margin: 0 0 14px;
    text-align: center;
}

.int-final > p {
    max-width: 520px;
    margin-bottom: 28px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--muted);
}

.int-final .int-actions {
    justify-content: center;
}

/* --- адаптив --- */
@media (max-width: 960px) {
    .int-patch {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .int-table__row {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .int-table__row span:last-child {
        grid-column: 2;
    }

    .int-table__head span:last-child {
        display: none;
    }

    .int-queue {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 760px) {
    /* метро становится вертикальным */
    .int-metro__track {
        top: 16px;
        bottom: 16px;
        left: 13px;
        right: auto;
        width: 6px;
        height: auto;
    }

    .int-metro__track:before {
        width: auto;
        right: 0;
        height: calc(var(--p) * 100%);
        bottom: auto;
    }

    .int-metro__train {
        top: calc(var(--p) * 100%);
        left: 50%;
        width: 16px;
        height: 30px;
    }

    .int-metro__stations {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .int-metro__stations li {
        display: grid;
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 16px;
        row-gap: 2px;
        align-items: center;
        padding: 0;
        text-align: left;
    }

    .int-metro__stations i {
        grid-row: span 2;
        margin: 0;
    }
}

@media (max-width: 640px) {
    .int {
        padding: 20px 16px 60px;
    }

    .int-hub .int-hub__d {
        display: none;
    }

    .int-hub .int-hub__m {
        display: block;
    }

    .int-hub {
        margin-top: 36px;
    }

    .int-section,
    .int-final {
        margin-top: 80px;
    }

    .int-patch {
        grid-template-columns: 1fr;
    }

    .int-table__row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .int-table__row span:last-child {
        grid-column: auto;
    }

    .int-table__head {
        display: none;
    }

    .int-queue__msg {
        font-size: 11px;
    }

    .int-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .int *,
    .int *:before,
    .int *:after {
        animation: none !important;
        transition: none !important;
    }

    .int-packets {
        display: none;
    }

    .int-queue__msg {
        transform: translateX(calc(var(--slot) * 74px));
    }
}
