/* =========================================================
   FAQ блок — matrisa-sudbi.ru
   Стили встроены в дизайн-систему сайта
   ========================================================= */

.ms-faq {
    --faq-accent: #2ec5b6;
    --faq-accent-dark: #1fa99b;
    --faq-bg: #fbf6ec;
    --faq-card: #ffffff;
    --faq-ink: #1c2333;
    --faq-muted: #5a6273;
    --faq-line: #ece3d0;
    --faq-shadow: 0 10px 30px -18px rgba(28, 35, 51, 0.25);

    max-width: 820px;
    margin: 48px auto;
    padding: 44px 44px 40px;
    background: var(--faq-bg);
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    font-family: 'Golos Text', 'PT Sans', system-ui, sans-serif;
    color: var(--faq-ink);
}

/* декоративный фоновый акцент */
.ms-faq::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(46, 197, 182, 0.18), transparent 70%);
    pointer-events: none;
}

.ms-faq__head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.ms-faq__badge {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--faq-accent);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    line-height: 44px;
    text-align: center;
    box-shadow: 0 8px 18px -8px rgba(46, 197, 182, 0.6);
}

.ms-faq__title {
    margin: 0 !important;
    font-family: 'Playfair Display', 'Merriweather', Georgia, serif;
    font-weight: 600;
    font-size: clamp(24px, 2.4vw, 32px);
    letter-spacing: -0.01em;
    color: var(--faq-ink);
}

/* список */
.ms-faq__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.ms-faq__item {
    background: var(--faq-card);
    border: 1px solid var(--faq-line);
    border-radius: 18px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.ms-faq__item:hover {
    box-shadow: var(--faq-shadow);
    border-color: rgba(46, 197, 182, 0.4);
}

.ms-faq__item.is-open {
    border-color: var(--faq-accent);
    box-shadow: var(--faq-shadow);
}

/* кнопка-вопрос */
.ms-faq__question {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    padding: 20px 24px;
    cursor: pointer;
    box-sizing: border-box;
    font-family: inherit;
}

.ms-faq__question:focus-visible {
    outline: 2px solid var(--faq-accent);
    outline-offset: -2px;
    border-radius: 18px;
}

.ms-faq__q-text {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--faq-ink);
}

.ms-faq__icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(46, 197, 182, 0.1);
    color: var(--faq-accent);
    transition: transform 0.35s cubic-bezier(.4,.0,.2,1),
                background 0.3s ease;
}

.ms-faq__item.is-open .ms-faq__icon {
    background: var(--faq-accent);
    color: #fff;
    transform: rotate(180deg);
}

/* панель с ответом — закрыта по умолчанию */
.ms-faq__panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(.4,.0,.2,1);
}

.ms-faq__item.is-open .ms-faq__panel {
    max-height: 1000px; /* любое значение больше реальной высоты ответа */
}

.ms-faq__answer {
    padding: 0 24px 22px;
    font-size: 16px;
    line-height: 1.65;
    color: var(--faq-muted);
}

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

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

.ms-faq__answer a {
    color: var(--faq-accent-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}


/* мобильные */
@media (max-width: 640px) {
    .ms-faq {
        margin: 32px 12px;
        padding: 28px 20px 26px;
        border-radius: 22px;
    }
    .ms-faq__question { padding: 16px 18px; }
    .ms-faq__q-text { font-size: 15.5px; }
    .ms-faq__answer { padding: 0 18px 18px; font-size: 15px; }
    .ms-faq__badge { width: 38px; height: 38px; line-height: 38px; font-size: 18px; }
}

/* уважение к reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .ms-faq__panel,
    .ms-faq__icon,
    .ms-faq__item { transition: none; }
}