/* =========================================
   FAQ Page
   ========================================= */

/* ── Intro ── */
.faq-intro {
    padding: 88px 0 80px;
    background: #ffffff;
    background-image:
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.faq-intro::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 460px;
    height: 460px;
    background: radial-gradient(circle, rgba(84,187,144,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.faq-intro__body {
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.faq-intro__body .section-label { margin-bottom: 4px; }

.faq-intro__heading {
    font-family: var(--font-primary);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin: 0;
}

.faq-intro__text {
    font-size: 17px;
    line-height: 1.75;
    color: var(--color-text-muted);
    margin: 0;
}

/* Entrance — intro elements */
.js-faq-el {
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.6s cubic-bezier(0.22,1,0.36,1) calc(var(--fi, 0) * 0.1s),
        transform 0.6s cubic-bezier(0.22,1,0.36,1) calc(var(--fi, 0) * 0.1s);
}

.js-faq-el.is-visible { opacity: 1; transform: none; }

/* ── FAQ list ── */
.faq-list {
    padding: 72px 0 96px;
    background: var(--color-bg);
}

.faq-accordion {
    max-width: 780px;
    display: flex;
    flex-direction: column;
}

/* Section heading */
.faq-accordion__section {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin: 52px 0 0;
    padding-bottom: 14px;
    position: relative;
}

/* Мягкая линия под секцией */
.faq-accordion__section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        var(--color-primary) 0%,
        rgba(84,187,144,0.15) 40%,
        transparent 100%
    );
}

.faq-accordion__section:first-child { margin-top: 0; }

/* Entrance — accordion items */
.js-faq-item {
    opacity: 0;
    transform: translateY(14px);
}

.js-faq-item.is-visible {
    opacity: 1;
    transform: none;
    transition:
        opacity 0.5s cubic-bezier(0.22,1,0.36,1) calc(var(--fi, 0) * 0.045s),
        transform 0.5s cubic-bezier(0.22,1,0.36,1) calc(var(--fi, 0) * 0.045s);
}

/* ── FAQ item ── */
.faq-item {
    position: relative;
    transition: background 0.25s ease;
}

/* Градиентный разделитель — тает по краям */
.faq-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--color-border) 8%,
        var(--color-border) 92%,
        transparent 100%
    );
}

.faq-item:first-of-type {
    border-top: none;
}

/* Верхний разделитель у первого */
.faq-accordion::before {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--color-border) 8%,
        var(--color-border) 92%,
        transparent 100%
    );
    margin-bottom: 0;
}

.faq-item.is-open { background: rgba(84,187,144,0.025); }

/* Trigger */
.faq-item__trigger {
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 24px 4px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    text-align: left;
}

.faq-item__question {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.5;
    letter-spacing: -0.01em;
    transition: color 0.25s ease;
}

.faq-item.is-open .faq-item__question { color: var(--color-text); }

/* Icon — минималистичный */
.faq-item__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: color 0.25s ease;
}

.faq-item.is-open .faq-item__icon { color: var(--color-primary); }

.faq-icon-v {
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.25s ease;
    transform-origin: center;
}

.faq-item.is-open .faq-icon-v {
    transform: rotate(90deg);
    opacity: 0;
}

/* Body */
.faq-item__body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.22,1,0.36,1);
}

.faq-item.is-open .faq-item__body { grid-template-rows: 1fr; }

.faq-item__inner {
    overflow: hidden;
    min-height: 0;
}

.faq-item__answer {
    padding: 0 28px 28px 0;
    font-size: 15px;
    line-height: 1.8;
    color: var(--color-text-muted);
}

.faq-item__answer p { margin: 0 0 10px; }
.faq-item__answer p:last-child { margin-bottom: 0; }

.faq-item__answer ul,
.faq-item__answer ol { padding-left: 18px; margin: 0 0 10px; }

.faq-item__answer li { margin-bottom: 5px; }

.faq-item__answer a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* =========================================
   Responsive
   ========================================= */

/* ── Tablet ── */
@media (max-width: 1024px) {
    .faq-accordion { max-width: 100%; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    /* Intro */
    .faq-intro {
        padding: 56px 0 48px;
        /* Мельче сетка на мобиле */
        background-size: 56px 56px, 56px 56px, 14px 14px, 14px 14px;
    }

    .faq-intro__text { font-size: 15px; }

    /* Зелёный акцент меньше */
    .faq-intro::after {
        width: 280px;
        height: 280px;
        top: -40px;
        right: -40px;
    }

    /* List */
    .faq-list { padding: 40px 0 56px; }

    /* Section label */
    .faq-accordion__section {
        margin-top: 36px;
        font-size: 10px;
    }

    /* Trigger */
    .faq-item__trigger {
        padding: 18px 4px 18px 0;
        gap: 16px;
    }

    .faq-item__question { font-size: 14px; }

    /* Icon */
    .faq-item__icon { width: 24px; height: 24px; }
    .faq-item__icon svg { width: 12px; height: 12px; }

    /* Answer */
    .faq-item__answer {
        padding: 0 14px 20px 14px;
        font-size: 14px;
        line-height: 1.7;
    }

    /* Left accent bar */
    .faq-item::before { width: 2px; }
}

/* ── Small mobile ── */
@media (max-width: 480px) {
    .faq-intro { padding: 44px 0 36px; }

    .faq-intro__heading { letter-spacing: -0.025em; }

    .faq-accordion__section { margin-top: 28px; }

    .faq-item__trigger {
        padding: 16px 4px 16px 12px;
        gap: 12px;
    }

    .faq-item__question {
        font-size: 13px;
        line-height: 1.45;
    }

    .faq-item__answer {
        padding: 0 12px 18px 12px;
        font-size: 13px;
    }
}
