/* FAQ page — аккордеон на <details>/<summary>, с плавной JS-анимацией open/close */

.faq {
    max-width: 900px;
    padding-bottom: 100px;
}

.faq__title {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.faq__subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 40px;
    line-height: 1.55;
    max-width: 700px;
}

/* ── Список вопросов ───────────────────────────────────── */
.faq__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq__item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    overflow: hidden;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.15s ease;
}

.faq__item[open] {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(245, 209, 5, 0.25);
}

/* Фокус-рамка на клавиатурной навигации. Outline на summary обрезался бы
   border-radius + overflow:hidden родителя — поэтому рисуем box-shadow
   на самом .faq__item, он уже со скруглёнными углами. */
.faq__item:has(.faq__question:focus-visible) {
    box-shadow: 0 0 0 2px var(--color-yellow);
}

/* ── Вопрос (summary) ──────────────────────────────────── */
.faq__question {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    list-style: none;
    user-select: none;
}

.faq__question::-webkit-details-marker {
    display: none;
}

.faq__question:focus {
    outline: none;
}

.faq__question-num {
    color: var(--color-yellow);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    flex-shrink: 0;
    min-width: 32px;
}

.faq__question-text {
    flex: 1;
    min-width: 0;
}

.faq__question-icon {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq__question-icon::before,
.faq__question-icon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: var(--color-yellow);
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.faq__question-icon::before {
    width: 14px;
    height: 2px;
    transform: translate(-50%, -50%);
}

.faq__question-icon::after {
    width: 2px;
    height: 14px;
    transform: translate(-50%, -50%);
}

.faq__item[open] .faq__question-icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    opacity: 0;
}

/* ── Ответ ─────────────────────────────────────────────── */
/* Внешний .faq__answer — «движок» анимации: height + opacity, padding=0.
   Внутренний .faq__answer-inner держит padding и контент.
   Так height=0 реально схлопывает бокс в ноль без остатка. */
.faq__answer {
    overflow: hidden;
    transition: height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq__answer-inner {
    padding: 4px 24px 22px 70px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 15px;
    line-height: 1.7;
}

.faq__answer-inner p {
    margin: 0 0 12px;
}

.faq__answer-inner p:last-child {
    margin-bottom: 0;
}

.faq__answer-inner a {
    color: var(--color-yellow);
    text-decoration: none;
    border-bottom: 1px solid rgba(245, 209, 5, 0.35);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.faq__answer-inner a:hover {
    color: #ffe24d;
    border-bottom-color: var(--color-yellow);
}

.faq__answer-inner a:visited {
    color: var(--color-yellow);
}

.faq__item:not([open]) .faq__answer {
    height: 0;
    opacity: 0;
}

/* ── Кнопка «Вернуться на главную» ─────────────────────── */
.faq__back {
    display: flex;
    width: fit-content;
    margin: 40px auto 0;
    padding: 18px 40px;
    text-decoration: none;
}

/* ── Адаптив ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .section-content {
        padding-top: 40px;
    }
    .faq {
        padding-bottom: 60px;
    }
    .faq__title {
        font-size: 24px;
    }
    .faq__subtitle {
        font-size: 14px;
        margin-bottom: 28px;
    }
    .faq__question {
        padding: 16px 18px;
        font-size: 15px;
        gap: 10px;
    }
    .faq__question-num {
        min-width: 26px;
        font-size: 14px;
    }
    .faq__answer-inner {
        padding: 4px 18px 18px 54px;
        font-size: 14px;
    }
    .faq__back {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .faq__answer-inner {
        padding-left: 18px;
    }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .faq__answer,
    .faq__question-icon,
    .faq__question-icon::before,
    .faq__question-icon::after {
        transition: none;
    }
}
