/* ─── Popup overlay ───────────────────────────────────────────────────── */
.popupArea {
    position: fixed;          /* fixed – не сдвигается при скролле */
    top: 0;
    left: 0;

    display: none;            /* flex при открытии */
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    background: rgba(17, 20, 25, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: 100;

    opacity: 0;
    transition: opacity 0.22s ease;
}
.popupArea.is-visible {
    opacity: 1;
}

/* ─── Popup card ─────────────────────────────────────────────────────── */
.popup {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;

    width: 400px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 32px;

    background: #FFFFFF;
    border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);

    transform: translateY(14px) scale(0.97);
    transition: transform 0.28s cubic-bezier(0.34, 1.3, 0.64, 1);
}
.popup::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: var(--grad-pulse);
}
.popupArea.is-visible .popup {
    transform: translateY(0) scale(1);
}

/* Close × button */
.popupCloseBtn {
    position: absolute;
    top: 12px;
    right: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;
    padding: 0;

    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;

    color: var(--darkGreyColor);
    font-size: 20px;
    line-height: 1;
    font-weight: 300;

    transition: background-color 0.15s, color 0.15s;
}
.popupCloseBtn:hover {
    background-color: var(--commonGreyColor);
    color: var(--commonBlackColor);
}
.popupCloseBtn:focus { outline: none; }

/* ─── Popup body ─────────────────────────────────────────────────────── */
.popupBody {
    display: flex;
    flex-direction: column;
    gap: 16px;

    transition: opacity 0.2s ease;
}
.popupBody.is-hidden {
    display: none;   /* раньше форма оставалась невидимой и занимала место над «успехом» */
}

/* Title */
.popup .title {
    margin: 0;
    font-family: var(--f-display);
    font-size: 20px;
    line-height: 28px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--commonBlackColor);
}

/* Form fields */
.popup .userInfo {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.popup label {
    display: flex;
    flex-direction: column;
    gap: 5px;

    font-size: 13px;
    line-height: 18px;
    color: var(--darkGreyColor);
}

/* Full-width buttons inside popup */
.popup .buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.popup .buttons .buttonBase {
    width: 100%;
    font-size: 15px;
    border-style: none;  /* prevent default button border */
}

/* "Написать нам" link – overrides the global white link color */
.popup .popupLinks {
    text-align: center;
    font-size: 14px;
    margin-top: -4px;
}
.popup .popupLinks a {
    color: var(--darkGreyColor);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    white-space: normal;
    transition: color 0.2s;
}
.popup .popupLinks a:hover {
    color: var(--commonBlackColor);
}

/* ─── Popup success state ────────────────────────────────────────────── */
.popupSuccess {
    display: none; /* shown via JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 8px 8px;
    text-align: center;
}
.popupSuccess.is-visible {
    display: flex;
}

.popupSuccess .successIcon {
    width: 64px;
    height: 64px;
    animation: popSuccessIcon 0.48s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.popupSuccess .successIcon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.popupSuccess .successTitle {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--commonBlackColor);
    animation: popSuccessText 0.4s ease-out 0.1s both;
}

@keyframes popSuccessIcon {
    from { opacity: 0; transform: scale(0.55); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes popSuccessText {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════════════
   All styles below are UNCHANGED from original main.css
   ══════════════════════════════════════════════════════════════════════ */

.introBanner {
    display: flex;
    flex-direction: row;
    box-sizing: border-box;
    width: calc(100% - 2 * clamp(16px, 3.5vw, 50px));
    max-width: 1340px;

    padding-top: 100px;
    padding-left: var(--pageGutter);
    padding-right: var(--pageGutter);
    padding-bottom: 60px;

    border-radius: 32px;
    background: linear-gradient(to right, #1D1D1D 0%, #838383 100%);

    .content {
        display: flex;
        width: 100%;
        height: 100%;
    }
    .text h1 {
        margin: 0 0 20px 0;
        font-size: 48px;
        line-height: 60px;
        font-weight: bold;
        color: var(--commonWhiteColor);
    }
    .text p {
        font-size: 20px;
        line-height: 28px;
        color: var(--strokeGreyColor);
    }
    img {
        height: 350px;
        object-fit: cover;
    }
    #priceList {
        width: fit-content;
        background-color: #10F0E7;
        color: var(--commonBlackColor);
        font-size: 16px;
    }
}

.benefits {
    display: flex;
    flex-direction: row;
    align-content: space-between;
    box-sizing: border-box;

    gap: 40px;
    padding: 40px;
    width: calc(100% - 2 * clamp(16px, 7vw, 102px));
    max-width: 1236px;

    border-radius: 32px;
    transform: translateY(-50px);

    background: white;
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.05);
}
.benefit {
    flex: 1;

    .icon {
        box-sizing: border-box;
        width: 64px;
        height: 64px;
        padding: 16px;
        border-radius: 32px;
        background: var(--commonBlackColor);
    }
    .title {
        font-size: 20px;
        line-height: 28px;
        font-weight: bold;
    }
    .description {
        font-size: 16px;
        line-height: 24px;
        color: var(--darkGreyColor);
    }
}

.about {
    display: flex;
    flex-direction: row;
    gap: 40px;
    padding: 80px var(--pageGutter);
    width: 100%;
    max-width: 1440px;
    box-sizing: border-box;

    .collage {
        display: grid;
        grid-template-rows: 1fr 1fr;
        grid-template-columns: 1fr 1fr;
        gap: 20px;

        div {
            min-width: 300px;
            min-height: 220px;
            background: linear-gradient(to bottom, #E8FFFE, #FFE4C5);
            .icon {
                width: 100%;
                justify-content: center;
            }
        }
    }
    .text {
        padding: 42px 0;

        .title {
            margin: 0;
            font-size: 36px;
            line-height: 40px;
            font-weight: bold;
        }
        .description {
            font-size: 20px;
            line-height: 28px;
            color: var(--commonBlackColor);
        }
    }
}

.certificates {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    max-width: 1440px;
    box-sizing: border-box;
    min-height: 10vh;
    padding: 80px var(--pageGutter);

    background: var(--commonGreyColor);

    .text {
        padding: 60px;

        .title {
            margin-top: 0;
            font-size: 36px;
            line-height: 40px;
            font-weight: bold;
        }
        .list {
            display: flex;
            flex-direction: column;
            list-style-position: inside;
            gap: 16px;
            font-size: 20px;
            line-height: 28px;
        }
    }
    img {
        height: 350px;
    }
}

.clients {
    display: flex;
    flex-direction: row;
    gap: 32px;
    padding: 80px var(--pageGutter);
    width: 100%;
    max-width: 1440px;
    box-sizing: border-box;

    .collage {
        display: grid;
        padding: 0 16px;
        grid-template-columns: 1fr 1fr 1fr;
        flex: 1.2;
        gap: 10px;

        div {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;

            font-size: 32px;
            font-weight: bold;

            min-width: 200px;
            min-height: 80px;
            background: var(--commonGreyColor);
        }
    }
    .text {
        flex: 1;

        .title {
            margin-top: 0;
            font-size: 36px;
            line-height: 40px;
            font-weight: bold;
        }
        .list {
            display: flex;
            flex-direction: column;
            list-style-position: inside;
            gap: 16px;
            font-size: 20px;
            line-height: 28px;
        }
    }
}

.partnership {
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;

    padding: 60px;
    width: calc(100% - 2 * clamp(16px, 7vw, 100px));
    max-width: 1240px;
    text-align: center;

    border-radius: 32px;
    background: var(--commonGreyColor);
    transform: translateY(50px);

    .title {
        margin: 0;
        font-size: 36px;
        line-height: 40px;
        font-weight: bold;
    }
    .subtitle {
        font-size: 20px;
        line-height: 28px;
    }
}

/* Списки «Гарантии и сертификаты», «Наши клиенты» (теперь это <ul>) */
ul.list {
    margin: 0;
    padding: 0;
}

/* ─── Адаптивность ───────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .about .collage div {
        min-width: 0;
        min-height: 180px;
    }
    .clients .collage div {
        min-width: 0;
        font-size: 24px;
    }
}

@media (max-width: 960px) {
    .introBanner {
        flex-direction: column;
        align-items: center;
        padding-top: 48px;
        padding-bottom: 40px;

        .text h1 { font-size: 36px; line-height: 44px; }
        .text p  { font-size: 18px; line-height: 26px; }
        img {
            height: auto;
            width: 100%;
            max-width: 360px;
        }
    }
    .benefits {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        padding: 28px;
        transform: translateY(-30px);
    }
    .about,
    .certificates,
    .clients {
        flex-direction: column;
        padding-top: 40px;
        padding-bottom: 40px;
    }
    .about .text,
    .certificates .text {
        padding: 0;
    }
    .about .collage {
        width: 100%;
    }
    .certificates img {
        height: auto;
        width: 100%;
        max-width: 360px;
        align-self: center;
    }
    .about .text .title,
    .certificates .text .title,
    .clients .text .title,
    .partnership .title {
        font-size: 28px;
        line-height: 34px;
    }
    .about .text .description,
    .certificates .text .list,
    .clients .text .list {
        font-size: 17px;
        line-height: 25px;
    }
    .clients .collage {
        padding: 0;
    }
    .partnership {
        padding: 40px 24px;
        transform: translateY(30px);
    }
}

@media (max-width: 560px) {
    .introBanner .text h1 { font-size: 28px; line-height: 34px; }
    .benefits {
        grid-template-columns: 1fr;
    }
    .about .collage {
        gap: 10px;
    }
    .about .collage div {
        min-height: 120px;
    }
    .clients .collage {
        grid-template-columns: 1fr 1fr;
    }
    .clients .collage div {
        font-size: 18px;
        min-height: 60px;
    }
}
