/* =========================
   FLIP CARDS (FINAL CLEAN)
========================= */

.flip-card {
    display: block;
    height: 420px;
    perspective: 1200px;
    text-decoration: none;
    color: inherit;
    min-height: 0;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform .6s ease;
    transform-style: preserve-3d;
    min-height: 0;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-face {
    position: absolute;
    inset: 0;
    border-radius: 28px;
    overflow: hidden;
    backface-visibility: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);

    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* =========================
   FRONT
========================= */

.flip-card-front {
    background: var(--card-bg, none) top center / cover no-repeat,
    linear-gradient(145deg, #5b5bd6, #3c33a6);
    color: #fff;
}

/* затемнение для читаемости */
.flip-card-front::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .00), rgba(0, 0, 0, .22));
    pointer-events: none;
    z-index: 0;
}

/* всё содержимое поверх overlay */
.flip-card-front > * {
    position: relative;
    z-index: 1;
}

/* ключ: front тоже flex-колонка с управлением */
.flip-card-front .card-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;

    padding: 28px 28px 24px 28px;
}

.flip-card-front .card-title {
    font-weight: 800;
    font-size: 44px;
    line-height: 1;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}

.card-spacer {
    flex: 1;
}

/* =========================
   BACK
========================= */

.flip-card-back {
    transform: rotateY(180deg);
    background: #3c33a6;
    color: #fff;

    padding: 28px 28px 24px 28px;
    min-height: 0;
    overflow: hidden;
}

.flip-card-back .card-title {
    font-weight: 800;
    font-size: 40px;
    line-height: 1;
    margin: 0 0 12px 0;
}

/* ПРОКРУТКА: работает, если min-height:0 и overflow у правильного блока */
.flip-card-back .card-text {
    flex: 1 1 0;
    min-height: 0;

    font-size: 14px;
    line-height: 1.6;
    opacity: .95;

    overflow-y: auto;
    max-height: 100%;
    padding-right: 6px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* списки */
.card-list {
    margin: 8px 0 0 0;
    padding-left: 18px;
}

.card-list li {
    margin-bottom: 6px;
    line-height: 1.5;
}

/* =========================
   CTA (ОДИН стиль, одинаковая позиция)
   Кнопка всегда внизу, одинаковые отступы
========================= */

.flip-card-front .card-cta,
.flip-card-back .card-cta {
    margin-top: auto; /* прибили вниз */
    align-self: flex-start;

    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 600;
    width: max-content;
}

/* различаем внешний вид, но не позицию */
.flip-card-front .card-cta {
    background: #fff;
    color: #3c33a6;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
}

.flip-card-back .card-cta {
    border: 2px solid rgba(255, 255, 255, .85);
    color: #fff;
}

/* отступ от краёв (одинаковый смысл на обеих сторонах) */
.flip-card-front .card-cta {
    margin-left: 0;
}

.flip-card-back .card-cta {
    margin-left: 0;
}

/* =========================
   SCROLLBAR
========================= */

.flip-card-back .card-text::-webkit-scrollbar {
    width: 6px;
}

.flip-card-back .card-text::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .35);
    border-radius: 999px;
}

/* arrow */
.arrow {
    font-size: 18px;
    line-height: 1;
}

/* КРИТИЧНОЕ ИСПРАВЛЕНИЕ ПРОКРУТКИ */
.flip-card:hover .flip-card-inner {
    pointer-events: none;
}

.flip-card:hover .flip-card-back {
    pointer-events: auto;
}

/* ДОПОЛНЕНИЕ ДЛЯ МОБИЛЬНЫХ */
.flip-card-back .card-text {
    touch-action: pan-y;
    overscroll-behavior: contain; /* ← Страховка от "подёргиваний" страницы */
}

/* =========================
   MOBILE: NO HOVER
========================= */

@media (hover: none) {
    .flip-card:hover .flip-card-inner {
        transform: none;
    }
}

/* =========================
   SERVICES GRID (NO FLIP)
========================= */

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);;
    gap: 24px;
    align-items: stretch;
}

.svc-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;

    padding: 22px 22px 18px 22px;
    border-radius: 22px;
    background: #F3F5FF;
    text-decoration: none;
    color: #0f172a;

    overflow: hidden;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
    transition: transform .18s ease, box-shadow .18s ease;
}

/* размеры как на скрине */
.svc-card--tall {
    grid-row: span 2;
}

.svc-card--wide {
    grid-column: span 1;
}

.svc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(15, 23, 42, .12);
}

/* заголовок */
.svc-head {
    font-weight: 900;
    font-size: 28px;
    letter-spacing: .5px;
    z-index: 2;
}

/* контейнер тегов */
.svc-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 72%;
    z-index: 2;
}

/* “кнопки-пилюли” */
.svc-tag {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(60, 51, 166, .10);
    color: #3c33a6;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

/* при наведении на конкретную пилюлю: подсветка только у неё */
.svc-tag:hover {
    background: #3c33a6;
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
}

/* картинка как была абсолютной, так и остаётся */
.svc-illus{
    position: absolute;
    right: 0px;
    bottom: 0px;
    width: 50%;
    max-width: 280px;
    max-height: 80%;
    height: auto;
    object-fit: contain;
    display: block;
    z-index: 0; /* ниже текста */
    pointer-events: none;
    filter: drop-shadow(0 20px 35px rgba(15, 23, 42, .12));
}

/* чтобы текст не уезжал на картинку */
.svc-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(70% 70% at 30% 20%, rgba(255, 255, 255, .65), rgba(255, 255, 255, 0));
    z-index: 0;
}

/* слои */
.svc-card > :not(.svc-illus){
    position: relative;
    z-index: 2;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 992px) {
    .services-grid {
        grid-template-columns:1fr;
    }

    .svc-card--tall {
        grid-row: auto;
    }

    .svc-card--wide {
        grid-column: auto;
    }

    /*.svc-illus {*/
    /*    width: 58%;*/
    /*}*/

    .svc-tags {
        max-width: 85%;
    }
}

/* =========================
   STEPS SECTION
========================= */

.steps-section {
    background: #f4f6fb;
    padding: 96px 0;
}

.steps-title {
    text-align: center;
    font-size: 42px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 64px;
}

/* GRID */
.steps-grid {
    display: grid;
    grid-template-columns:repeat(3, 1fr);
    gap: 32px;
}

/* CARD */
.step-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px 28px;
    transition: all .25s ease;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(60, 51, 166, .15);
}

/* NUMBER */
.step-num {
    font-size: 44px;
    font-weight: 800;
    color: #3c33a6;
    margin-bottom: 12px;
}

/* TITLE */
.step-heading {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

/* TEXT */
.step-text {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 992px) {
    .steps-grid {
        grid-template-columns:repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .steps-grid {
        grid-template-columns:1fr;
    }
}

/* =========================
   WHY US
========================= */

.why-section {
    background: #f4f6fb;
    padding: 96px 0;
}

.why-head {
    text-align: center;
    margin-bottom: 48px;
}

.why-title {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.15;
    margin: 0 0 14px 0;
}

.why-sub {
    font-size: 18px;
    margin: 0;
    color: rgba(0, 0, 0, .65);
}

/* cards */
.why-cards {
    display: grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin-top: 36px;
}

.why-card {
    background: #fff;
    border-radius: 18px;
    padding: 26px 22px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.why-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(60, 51, 166, .14);
}

.why-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(60, 51, 166, .08);
    margin-bottom: 14px;
}

.why-icon svg {
    width: 26px;
    height: 26px;
    fill: #3c33a6;
}

.why-card-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 8px 0;
}

.why-card-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(0, 0, 0, .70);
}

/* stats */
.why-stats {
    display: grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 64px;
}

.stat {
    text-align: center;
    padding: 18px 10px;
}

.stat-num {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: .5px;
    color: #3c33a6;
    line-height: 1;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    font-weight: 600;
    color: rgba(0, 0, 0, .75);
}

/* responsive */
@media (max-width: 992px) {
    .why-cards {
        grid-template-columns:repeat(2, 1fr);
    }

    .why-stats {
        grid-template-columns:repeat(2, 1fr);
    }

    .why-title {
        font-size: 40px;
    }
}

@media (max-width: 576px) {
    .why-cards {
        grid-template-columns:1fr;
    }

    .why-stats {
        grid-template-columns:1fr;
    }

    .why-title {
        font-size: 32px;
    }

    .stat-num {
        font-size: 44px;
    }
}


/* =========================
   FAQ
========================= */

.faq-section {
    background: #ffffff;
    padding: 96px 0;
}

.faq-head {
    text-align: center;
    margin-bottom: 44px;
}

.faq-title {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.15;
    margin: 0 0 12px 0;
}

.faq-sub {
    font-size: 18px;
    margin: 0;
    color: rgba(0, 0, 0, .65);
}

/* container for items */
.faq-accordion {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* item */
.faq-item {
    border-radius: 18px;
    background: #f4f6fb;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
    overflow: hidden;
    border: 1px solid rgba(60, 51, 166, .08);
}

/* summary row */
.faq-q {
    list-style: none;
    cursor: pointer;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 18px;
    font-weight: 800;
}

.faq-q::-webkit-details-marker {
    display: none;
}

.faq-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(60, 51, 166, .10);
    color: #3c33a6;
    font-size: 20px;
    line-height: 1;
    flex: 0 0 auto;
    transition: transform .2s ease, background .2s ease;
}

/* answer */
.faq-a {
    padding: 0 22px 20px 22px;
    color: rgba(0, 0, 0, .78);
    font-size: 15px;
    line-height: 1.75;
}

.faq-a p {
    margin: 10px 0;
}

.faq-list {
    margin: 10px 0 0 0;
    padding-left: 18px;
}

.faq-list li {
    margin: 6px 0;
}

.faq-steps {
    margin: 10px 0 0 0;
    padding-left: 18px;
}

.faq-steps li {
    margin: 8px 0;
}

.faq-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(60, 51, 166, .08);
    color: rgba(0, 0, 0, .72);
    font-size: 13px;
}

/* open state */
.faq-item[open] {
    background: #ffffff;
    border-color: rgba(60, 51, 166, .18);
    box-shadow: 0 16px 34px rgba(60, 51, 166, .12);
}

.faq-item[open] .faq-icon {
    transform: rotate(45deg);
    background: rgba(60, 51, 166, .14);
}

/* hover */
.faq-item:hover {
    box-shadow: 0 16px 34px rgba(60, 51, 166, .10);
}

/* responsive */
@media (max-width: 992px) {
    .faq-title {
        font-size: 40px;
    }
}

@media (max-width: 576px) {
    .faq-title {
        font-size: 32px;
    }

    .faq-q {
        font-size: 16px;
        padding: 18px 18px;
    }

    .faq-a {
        padding: 0 18px 18px 18px;
    }
}
