/* =========================================
   1. ПЕРЕМЕННЫЕ И СБРОС
   ========================================= */
:root {
    --color-primary: #205C36;
    --color-primary-dark: #1a4d2d;
    --color-primary-light: #e8f5e9;
    --color-text: #1A1A1A;
    --color-text-muted: #4A4A4A;
    --color-bg: #FFFFFF;
    --color-bg-alt: #F8F9FA;
    --color-border: #E0E0E0;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
    --radius: 12px;
    --transition: all 0.3s ease;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Manrope', sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   2. ТИПОГРАФИКА И КНОПКИ (УЛУЧШЕННЫЕ)
   ========================================= */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

.text-green {
    color: var(--color-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out-expo), background-color 0.3s ease;
    border: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(32, 92, 54, 0.3);
}

.btn--primary:active {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(32, 92, 54, 0.2);
}

.btn--outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--outline:hover {
    background-color: var(--color-primary);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(32, 92, 54, 0.2);
}

.btn--outline:active {
    transform: translateY(-1px);
}

.btn--large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn--full {
    width: 100%;
}

/* =========================================
   3. ШАПКА И МОБИЛЬНОЕ МЕНЮ
   ========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s var(--ease-out-expo);
}

.logo:hover {
    transform: scale(1.02);
}

.logo__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo__title {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-primary);
}

.logo__subtitle {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.nav {
    display: none;
}

.header__actions {
    display: none;
}

.burger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.burger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu__overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out-expo);
}

.mobile-menu__overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 360px;
    height: 100vh;
    background: #fff;
    z-index: 999;
    padding: 1.5rem;
    transition: right 0.4s var(--ease-out-expo);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.mobile-menu__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text);
    padding: 0.5rem;
    transition: transform 0.3s var(--ease-out-expo);
}

.mobile-menu__close:hover {
    transform: rotate(90deg);
}

.mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-grow: 1;
}

.mobile-menu__link {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text);
    transition: color 0.3s ease, transform 0.3s var(--ease-out-expo);
}

.mobile-menu__link:hover {
    color: var(--color-primary);
    transform: translateX(5px);
}

.mobile-menu__actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

@media (min-width: 992px) {
    .burger { display: none; }
    .nav { display: block; }
    .nav__list { display: flex; gap: 2rem; }
    .nav__link {
        font-weight: 500;
        color: var(--color-text-muted);
        position: relative;
        transition: color 0.3s ease;
    }
    .nav__link:hover, .nav__link--active { color: var(--color-primary); }
    .nav__link::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--color-primary);
        transition: width 0.4s var(--ease-out-expo);
    }
    .nav__link:hover::after { width: 100%; }
    .header__actions { display: flex; align-items: center; gap: 1.5rem; }
    .header__phone {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 600;
        color: var(--color-text);
        transition: color 0.3s ease;
    }
    .header__phone:hover { color: var(--color-primary); }
}

/* =========================================
   4. ГЛАВНЫЙ ЭКРАН (HERO) - ПРЕМИУМ АНИМАЦИИ
   ========================================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 70px;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
    0% { transform: scale(1.1); }
    100% { transform: scale(1.15); }
}

.hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0.4) 100%);
    z-index: -1;
}

.hero__container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.hero__label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: 1rem;
    background: var(--color-primary-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.hero__title {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
}

.hero__subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero__rating {
    display: inline-flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.5);
    margin-bottom: 1.5rem;
}

.hero__rating .stars {
    font-weight: 700;
    color: #FFA500;
    margin-bottom: 0.25rem;
}

.hero__rating .rating-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.hero__cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 400px;
}

.offer-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out-expo);
}

.offer-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.offer-price {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-primary);
}

.offer-name {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: right;
}

.hero__buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hero__footer-note {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .hero__title { font-size: 3rem; }
    .hero__cards { flex-direction: row; max-width: 100%; }
    .hero__buttons { flex-direction: row; }
}

@media (min-width: 992px) {
    .hero__title { font-size: 3.5rem; }
}

/* =========================================
   5. БЕГУЩАЯ СТРОКА
   ========================================= */
.ticker {
    overflow: hidden;
    background: var(--color-primary);
    color: white;
    padding: 12px 0;
    white-space: nowrap;
}

.ticker__track {
    display: flex;
    width: max-content;
    animation: ticker 30s linear infinite;
}

.ticker__set {
    display: flex;
    align-items: center;
    padding-right: 2rem;
}

.ticker__item {
    font-weight: 600;
    font-size: 0.9rem;
}

.ticker__dot {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    margin: 0 1.5rem;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   6. ОБЩИЕ СЕКЦИИ И SCROLL REVEAL (ПРЕМИУМ)
   ========================================= */
section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header__label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.section-header__title {
    font-size: 2rem;
}

.section-header__desc {
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    section { padding: 5rem 0; }
    .section-header__title { font-size: 2.5rem; }
}

/* Премиум Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
    will-change: opacity, transform;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for grids */
.services__cards .service-card.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.services__cards .service-card.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.services__cards .service-card.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.services__cards .service-card.scroll-reveal:nth-child(4) { transition-delay: 0.4s; }

.why-us__grid .why-us-card.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.why-us__grid .why-us-card.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.why-us__grid .why-us-card.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }
.why-us__grid .why-us-card.scroll-reveal:nth-child(4) { transition-delay: 0.4s; }

.reviews__grid .review.scroll-reveal:nth-child(1) { transition-delay: 0.1s; }
.reviews__grid .review.scroll-reveal:nth-child(2) { transition-delay: 0.2s; }
.reviews__grid .review.scroll-reveal:nth-child(3) { transition-delay: 0.3s; }

.stages-timeline .stage-item.scroll-reveal:nth-child(2) { transition-delay: 0.1s; }
.stages-timeline .stage-item.scroll-reveal:nth-child(3) { transition-delay: 0.2s; }
.stages-timeline .stage-item.scroll-reveal:nth-child(4) { transition-delay: 0.3s; }
.stages-timeline .stage-item.scroll-reveal:nth-child(5) { transition-delay: 0.4s; }

/* =========================================
   7. УСЛУГИ (ИНТЕРАКТИВНЫЕ КАРТОЧКИ)
   ========================================= */
.services {
    background-color: var(--color-bg-alt);
}

.services__wrapper {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.services__info {
    text-align: center;
}

.services__label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.services__title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.services__desc {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.services__cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.service-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.service-card__image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.service-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.service-card:hover .service-card__image img {
    transform: scale(1.08);
}

.service-card__icon {
    position: absolute;
    bottom: -20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: transform 0.4s var(--ease-out-expo);
}

.service-card:hover .service-card__icon {
    transform: scale(1.1) rotate(5deg);
}

.service-card__content {
    padding: 2rem 1.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
}

.service-card__title {
    font-size: 1.25rem;
    font-weight: 700;
}

.arrow-icon {
    color: var(--color-primary);
    transition: transform 0.3s var(--ease-out-expo);
}

.service-card:hover .arrow-icon {
    transform: translateX(5px);
}

@media (min-width: 768px) {
    .services__wrapper { flex-direction: row; align-items: flex-start; }
    .services__info { text-align: left; flex: 1; position: sticky; top: 100px; }
    .services__desc { margin-left: 0; }
    .services__cards { flex: 2; grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .services__cards { grid-template-columns: repeat(2, 1fr); }
}

/* =========================================
   8. О КОМПАНИИ
   ========================================= */
.about__grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.about__image {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    position: relative;
}

.about__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.about__image:hover img {
    transform: scale(1.03);
}

.about__label {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    margin-bottom: 0.75rem;
}

.about__title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.about__text {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.about__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.stat {
    text-align: center;
}

.stat__number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-primary);
}

.stat__suffix {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.stat__label {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

@media (min-width: 768px) {
    .about__grid { flex-direction: row; align-items: center; }
    .about__image, .about__content { flex: 1; }
    .about__title { font-size: 2.5rem; }
}

/* =========================================
   9. ПРЕИМУЩЕСТВА
   ========================================= */
.why-us {
    background-color: var(--color-bg-alt);
}

.why-us__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.why-us-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
}

.why-us-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.why-us-card__icon {
    width: 64px;
    height: 64px;
    background: var(--color-primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform 0.4s var(--ease-out-expo);
}

.why-us-card:hover .why-us-card__icon {
    transform: scale(1.1);
}

.why-us-card__title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.why-us-card__text {
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

@media (min-width: 768px) { .why-us__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .why-us__grid { grid-template-columns: repeat(4, 1fr); } }

/* =========================================
   10. ЭТАПЫ РАБОТЫ
   ========================================= */
.stages-timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stages-line {
    display: none;
}

.stage-item {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.stage-image {
    border-radius: var(--radius);
    overflow: hidden;
    height: 200px;
}

.stage-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out-expo);
}

.stage-item:hover .stage-image img {
    transform: scale(1.05);
}

.stage-content {
    padding: 0 1rem;
}

.stage-number {
    width: 40px;
    height: 40px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    transition: transform 0.3s var(--ease-out-expo);
}

.stage-item:hover .stage-number {
    transform: scale(1.1);
}

.stage-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.stage-text {
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .stages-timeline { flex-direction: row; justify-content: space-between; padding-top: 2rem; }
    .stages-line { display: block; position: absolute; top: 40px; left: 0; width: 100%; height: 2px; background: var(--color-border); z-index: 0; }
    .stage-item { flex: 1; flex-direction: column; text-align: center; z-index: 1; }
    .stage-number { margin: 0 auto 1rem; border: 4px solid #fff; }
    .stage-content { padding: 0; }
}

/* =========================================
   11. ОТЗЫВЫ
   ========================================= */
.reviews {
    background-color: var(--color-bg-alt);
}

.reviews__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.review {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out-expo);
}

.review:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.review__stars {
    color: #FFA500;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.review__text {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.review__author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.review__avatar {
    width: 48px;
    height: 48px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.review__info {
    display: flex;
    flex-direction: column;
}

.review__name {
    font-weight: 700;
}

.review__date {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

@media (min-width: 768px) {
    .reviews__grid { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================
   12. FAQ (ПЛАВНЫЙ АККОРДЕОН)
   ========================================= */
.faq__list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.faq-item.active {
    box-shadow: var(--shadow-sm);
    border-color: var(--color-primary-light);
}

.faq-item__header {
    width: 100%;
    padding: 1.25rem;
    background: none;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    transition: color 0.3s ease;
}

.faq-item__header:hover {
    color: var(--color-primary);
}

.faq-item__icon {
    font-size: 1.5rem;
    color: var(--color-primary);
    transition: transform 0.4s var(--ease-out-expo);
    line-height: 1;
}

.faq-item.active .faq-item__icon {
    transform: rotate(45deg);
}

.faq-item__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s var(--ease-out-expo), padding 0.5s var(--ease-out-expo);
}

.faq-item.active .faq-item__content {
    max-height: 300px;
}

.faq-item__content p {
    padding: 0 1.25rem 1.25rem;
    color: var(--color-text-muted);
}

/* =========================================
   13. КАЛЬКУЛЯТОР
   ========================================= */
.calculator-section {
    background-color: var(--color-bg-alt);
    padding: 5rem 0;
}

.calculator-wrapper {
    background: #fff;
    border-radius: var(--radius);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    max-width: 900px;
    margin: 0 auto;
}

.calc-step {
    margin-bottom: 2.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border);
}

.calc-step:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 1.5rem;
}

.calc-step__title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    color: var(--color-text);
}

.calc-step__subtitle {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.calc-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.calc-options-grid--small {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}

.calc-option-card {
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    background: #fff;
}

.calc-option-card:hover {
    border-color: var(--color-primary-light);
    background: var(--color-primary-light);
    transform: translateY(-2px);
}

.calc-option-card.active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-weight: 600;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.calc-option-card .icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.calc-custom-input {
    margin-top: 1rem;
    max-width: 300px;
}

.calc-params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.calc-checkbox-group {
    display: flex;
    align-items: center;
}

.calc-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text);
}

.calc-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.calc-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.calc-total-block {
    background: var(--color-bg-alt);
    border-radius: 8px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.calc-total-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calc-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    color: var(--color-text-muted);
}

.calc-total-row strong {
    color: var(--color-text);
}

.calc-total-price {
    text-align: center;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    border: 2px solid var(--color-primary);
    transition: transform 0.3s var(--ease-out-expo);
}

.calc-total-price:hover {
    transform: scale(1.02);
}

.calc-total-label {
    display: block;
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.calc-total-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.calc-total-disclaimer {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-style: italic;
}

@media (min-width: 1024px) {
    .calc-options-grid { grid-template-columns: repeat(3, 1fr); }
    .calc-options-grid--small { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 768px) {
    .calculator-wrapper { padding: 1.5rem; }
    .calc-total-value { font-size: 2rem; }
}

/* =========================================
   14. ФОРМА ЗАКАЗА
   ========================================= */
.order {
    background-color: var(--color-primary);
    color: #fff;
}

.order__grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.order__title {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.order__text {
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.5rem;
}

.order__list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.order__list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.order__form {
    background: #fff;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    color: var(--color-text);
}

.calc-summary-box {
    background: var(--color-primary-light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--color-primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(32, 92, 54, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-note {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 1rem;
}

.form-note a {
    color: var(--color-primary);
    text-decoration: underline;
}

@media (min-width: 992px) {
    .order__grid { flex-direction: row; align-items: center; }
    .order__info, .order__form { flex: 1; }
}

/* =========================================
   15. КОНТАКТЫ
   ========================================= */
.contacts__grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.contacts__title {
    font-size: 2rem;
    margin-bottom: 2rem;
}

.contacts__item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contacts__icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s var(--ease-out-expo);
}

.contacts__item:hover .contacts__icon {
    transform: scale(1.1);
}

.contacts__text {
    display: flex;
    flex-direction: column;
}

.contacts__label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.contacts__value {
    font-weight: 600;
    font-size: 1.1rem;
}

.contacts__value:hover {
    color: var(--color-primary);
}

.contacts__map {
    height: 300px;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

@media (min-width: 768px) {
    .contacts__grid { flex-direction: row; }
    .contacts__info { flex: 1; }
}

/* =========================================
   16. ПОДВАЛ
   ========================================= */
.footer {
    background: #F8F9FA;
    color: var(--color-text);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--color-border);
}

.footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.footer__desc {
    color: var(--color-text-muted);
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer__title {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
    font-weight: 700;
}

.footer-contact-card {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    border-left: 3px solid var(--color-primary);
}

.footer__phone {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.footer__phone:hover {
    color: var(--color-primary);
}

.footer__work-hours {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer__contact-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__links a {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    transition: color 0.3s ease, padding-left 0.3s var(--ease-out-expo);
}

.footer__links a:hover {
    color: var(--color-primary);
    padding-left: 5px;
}

.footer__requisites-card {
    background: #fff;
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.8;
    border: 1px solid var(--color-border);
}

.footer__requisites-card strong {
    color: var(--color-text);
    font-size: 1rem;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    transition: all 0.3s var(--ease-out-expo);
}

.social-link:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

.footer__bottom {
    background: var(--color-primary-dark);
    color: rgba(255, 255, 255, 0.9);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-size: 0.9rem;
    margin: 0 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(26, 77, 45, 0.25);
}

.footer__bottom-left,
.footer__bottom-center,
.footer__bottom-right {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.footer__bottom-left p {
    margin: 0;
    font-weight: 500;
}

.footer__bottom-center {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.5;
}

.footer__bottom-center p {
    margin: 0;
}

.footer__bottom-right {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.datetime-card {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 0.3s ease;
}

.datetime-card:hover {
    background: rgba(255, 255, 255, 0.18);
}

.datetime-card svg {
    opacity: 0.8;
}

@media (min-width: 768px) {
    .footer__grid { grid-template-columns: repeat(2, 1fr); }
    .footer__bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        align-items: center;
        padding: 1.25rem 2rem;
    }
    .footer__bottom-left { justify-content: flex-start; }
    .footer__bottom-center { flex: 1; justify-content: center; }
    .footer__bottom-right { justify-content: flex-end; }
}

@media (min-width: 1024px) {
    .footer__grid { grid-template-columns: 1.5fr 1fr 1fr; }
}

@media (max-width: 768px) {
    .footer__bottom { margin: 0 1rem 1.5rem; padding: 1.25rem 1rem; }
    .footer__bottom-right { flex-direction: row; align-items: center; gap: 0.75rem; }
    .datetime-card { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
}

@media (max-width: 480px) {
    .footer__bottom { margin: 0 0.75rem 1rem; padding: 1rem 0.75rem; font-size: 0.8rem; }
    .footer__bottom-center { font-size: 0.75rem; }
}

/* =========================================
   17. МОДАЛЬНЫЕ ОКНА
   ========================================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out-expo);
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal__content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 500px;
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s var(--ease-out-expo);
    max-height: 90vh;
    overflow-y: auto;
}

.modal.active .modal__content {
    transform: translateY(0) scale(1);
}

.modal--large .modal__content {
    max-width: 800px;
}

.modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color 0.2s, transform 0.3s var(--ease-out-expo);
}

.modal__close:hover {
    color: var(--color-text);
    transform: rotate(90deg);
}

.modal__title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.modal__text {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.legal-text {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 1rem;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.legal-text p {
    margin-bottom: 1rem;
}

.legal-text strong {
    color: var(--color-text);
    display: block;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* =========================================
   18. КНОПКА НАВЕРХ
   ========================================= */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out-expo), background-color 0.3s ease;
    z-index: 90;
}

.scroll-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.scroll-top:hover {
    background: var(--color-primary-dark);
    transform: translateY(-3px);
}

/* =========================================
   19. АНИМАЦИИ (ПЕРВЫЙ ЭКРАН)
   ========================================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s var(--ease-out-expo) forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   20. СТИЛИ ДЛЯ ЮРИДИЧЕСКИХ СТРАНИЦ
   ========================================= */
.legal-page {
    padding-top: 100px;
    padding-bottom: 4rem;
}

.legal-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.legal-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.legal-content .last-updated {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    font-style: italic;
}

.legal-content h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.legal-content p, .legal-content li {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.legal-content ul {
    padding-left: 1.5rem;
    list-style-type: disc;
    margin-bottom: 1.5rem;
}

.legal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: 2rem;
}

.legal-back-link:hover {
    text-decoration: underline;
}

/* =========================================
   21. EXIT-INTENT POPUP
   ========================================= */
.exit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s var(--ease-out-expo), visibility 0.4s var(--ease-out-expo);
    pointer-events: none;
}

.exit-popup.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.exit-popup__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.exit-popup__card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    max-width: 520px;
    width: 100%;
    overflow: hidden;
    transform: scale(0.9) translateY(30px);
    transition: transform 0.5s var(--ease-out-expo);
    z-index: 1;
}

.exit-popup.active .exit-popup__card {
    transform: scale(1) translateY(0);
}

.exit-popup__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-muted);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s var(--ease-out-expo);
    z-index: 3;
}

.exit-popup__close:hover {
    background: var(--color-bg-alt);
    color: var(--color-text);
    transform: rotate(90deg);
}

.exit-popup__header {
    padding: 1.75rem 2rem 0;
}

.exit-popup__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.exit-popup__logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.exit-popup__logo-title {
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--color-primary);
}

.exit-popup__logo-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.exit-popup__body {
    padding: 1.5rem 2rem 2rem;
    position: relative;
    z-index: 2;
}

.exit-popup__title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.exit-popup__subtitle {
    font-size: 1.1rem;
    color: var(--color-text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    font-weight: 500;
}

.exit-popup__accent {
    color: var(--color-primary);
    font-weight: 800;
}

.exit-popup__description {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exit-popup__description::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.exit-popup__form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.exit-popup__input-wrap {
    position: relative;
}

.exit-popup__input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.exit-popup__input {
    width: 100%;
    padding: 0.9rem 1rem 0.9rem 2.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    color: var(--color-text);
}

.exit-popup__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(32, 92, 54, 0.12);
}

.exit-popup__input::placeholder {
    color: #999;
}

.exit-popup__btn {
    width: 100%;
    padding: 1rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.exit-popup__btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(32, 92, 54, 0.3);
}

.exit-popup__btn:active {
    transform: translateY(0);
}

.exit-popup__btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.exit-popup__privacy {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

.exit-popup__privacy a {
    color: var(--color-primary);
    text-decoration: underline;
}

.exit-popup__decoration {
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.exit-popup__decoration svg {
    width: 100%;
    height: 100%;
}

/* =========================================
   22. ДОСТУПНОСТЬ (PREFERS-REDUCED-MOTION)
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .scroll-reveal {
        opacity: 1;
        transform: none;
    }
    .hero__bg img {
        animation: none;
        transform: scale(1);
    }
    .exit-popup__card, .modal__content {
        transform: none;
    }
}

/* Мобильные адаптации для popup */
@media (max-width: 768px) {
    .exit-popup { padding: 0.75rem; align-items: flex-end; }
    .exit-popup__card { max-width: 100%; border-radius: 16px 16px 0 0; max-height: 90vh; overflow-y: auto; }
    .exit-popup__header { padding: 1.25rem 1.5rem 0; }
    .exit-popup__body { padding: 1.25rem 1.5rem 1.5rem; }
    .exit-popup__title { font-size: 1.75rem; }
    .exit-popup__subtitle { font-size: 1rem; }
    .exit-popup__decoration { width: 150px; opacity: 0.6; }
}

@media (max-width: 480px) {
    .exit-popup__title { font-size: 1.5rem; }
    .exit-popup__subtitle { font-size: 0.95rem; }
    .exit-popup__btn { padding: 0.9rem; font-size: 1rem; }
}

@media (max-width: 360px) {
    .exit-popup { padding: 0.5rem; }
    .exit-popup__header, .exit-popup__body { padding-left: 1rem; padding-right: 1rem; }
    .exit-popup__close { top: 12px; right: 12px; width: 32px; height: 32px; }
}

/* =========================================================
   RESPONSIVE SAFETY LAYER — content stays inside its blocks
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; }
body { width: 100%; max-width: 100%; overflow-x: clip; }
img, svg, video, canvas { max-width: 100%; }
.container, .header__container, .footer__grid, .contacts__grid,
.calculator-wrapper, .modal__content, .legal-content { min-width: 0; }
h1, h2, h3, h4, p, li, a, label, button, span {
  overflow-wrap: anywhere;
}
input, select, textarea, button { max-width: 100%; min-width: 0; font: inherit; }
textarea { resize: vertical; }
.footer__grid > *, .contacts__grid > *, .calc-params-grid > *,
.calc-options-grid > *, .order__form > *, .footer__bottom > * { min-width: 0; }
.footer__bottom { flex-wrap: wrap; gap: 12px 20px; }
.footer__bottom-right { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.legal-text, .legal-content { overflow-wrap: anywhere; word-break: normal; }

@media (max-width: 768px) {
  .container { width: min(100% - 32px, 100%); }
  .section-header__title, .hero__title, .contacts__title { max-width: 100%; overflow-wrap: anywhere; }
  .calc-options-grid, .calc-options-grid--small, .calc-params-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .calc-option-card { min-width: 0; }
  .form-group, .form-input, .form-select, .form-textarea { width: 100%; min-width: 0; }
  .footer__grid { grid-template-columns: minmax(0, 1fr) !important; }
  .footer__bottom { align-items: flex-start; }
  .footer__bottom-right { width: 100%; }
  .modal__content { width: min(100% - 24px, 560px); max-height: calc(100dvh - 24px); overflow-y: auto; }
  .modal--large .modal__content { width: min(100% - 24px, 760px); }
}
@media (max-width: 480px) {
  .container { width: min(100% - 28px, 100%); }
  h1 { font-size: clamp(1.8rem, 8vw, 2.5rem); }
  h2 { font-size: clamp(1.45rem, 6vw, 2rem); }
  .btn { white-space: normal; text-align: center; }
  .header__container { gap: 10px; }
  .footer__phone, .contacts__value { overflow-wrap: anywhere; }
}
@media (max-width: 360px) {
  .container { width: min(100% - 24px, 100%); }
  .section-header__desc, .hero__subtitle { font-size: 0.94rem; }
}


/* FINAL POLISH: compact hero, calculator and forms */
.hero__title {
  font-size: clamp(2rem, 3.4vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  max-width: 760px;
  margin-bottom: 1.1rem;
  text-wrap: balance;
}
.hero__subtitle { max-width: 540px; line-height: 1.55; margin-bottom: 1.5rem; }
.calculator-section { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.calculator-section .section-header { margin-bottom: 1.75rem; }
.calculator-wrapper { max-width: 1000px; padding: clamp(1.25rem, 2.5vw, 2rem); }
.calc-step { margin-bottom: 1.5rem; padding-bottom: 1.5rem; }
.calc-step__title { font-size: 1.08rem; margin-bottom: .85rem; }
.calc-step__subtitle { font-size: 1rem; margin: 1rem 0 .75rem !important; }
.calc-options-grid, .calc-extras-grid { gap: .7rem; }
.calc-option-card { padding: .75rem .65rem; min-width: 0; line-height: 1.35; }
.calc-option-card .icon { font-size: 1.25rem; margin-bottom: .3rem; }
.calc-params-grid { gap: 1rem; }
.calc-total-block { padding: 1.25rem; gap: 1rem; }
.calc-total-price { padding: 1rem; }
.calc-total-value { font-size: clamp(1.8rem, 4vw, 2.25rem); }
.calc-total-row { gap: .75rem; align-items: flex-start; font-size: .94rem; }
.calc-total-row strong { text-align: right; overflow-wrap: anywhere; }
.modal__content { padding: clamp(1.25rem, 4vw, 2rem); }

@media (max-width: 767px) {
  .hero { min-height: auto; padding-top: 84px; padding-bottom: 2rem; align-items: flex-start; }
  .hero__container { padding-top: 1.25rem; padding-bottom: 1.25rem; }
  .hero__rating { margin-bottom: 1rem; padding: .65rem .85rem; }
  .hero__label { margin-bottom: .8rem; font-size: .78rem; padding: .42rem .8rem; }
  .hero__title { font-size: clamp(1.85rem, 7.2vw, 2.35rem); line-height: 1.13; margin-bottom: .9rem; max-width: 100%; }
  .hero__subtitle { font-size: .98rem; line-height: 1.48; margin-bottom: 1.15rem; max-width: 100%; }
  .hero__buttons { gap: .7rem; margin-bottom: 1rem; }
  .hero__footer-note { font-size: .78rem; line-height: 1.45; }
  .calculator-section { padding: 2.5rem 0; }
  .calculator-wrapper { padding: 1rem; border-radius: 14px; }
  .calc-step { margin-bottom: 1.15rem; padding-bottom: 1.15rem; }
  .calc-step__title { font-size: 1rem; margin-bottom: .7rem; }
  .calc-options-grid, .calc-options-grid--small { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: .55rem; }
  .calc-option-card { padding: .7rem .45rem; font-size: .88rem; }
  .calc-params-grid { grid-template-columns: minmax(0, 1fr) !important; gap: .75rem; }
  .calc-extras-grid { grid-template-columns: minmax(0, 1fr) !important; gap: .65rem; }
  .calc-checkbox { align-items: flex-start; line-height: 1.4; font-size: .9rem; }
  .calc-total-block { padding: .9rem; gap: .85rem; }
  .calc-total-price { padding: .9rem .65rem; }
  .calc-total-label { font-size: .9rem; }
  .calc-total-disclaimer { line-height: 1.4; }
}
@media (max-width: 390px) {
  .hero__title { font-size: clamp(1.75rem, 7vw, 2rem); }
  .hero__rating .rating-text { font-size: .8rem; }
  .calc-options-grid, .calc-options-grid--small { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .calculator-wrapper { padding: .8rem; }
}


/* =========================================
   Компактный современный калькулятор
   Изменения ограничены только блоком калькулятора
   ========================================= */
.calculator-wrapper {
    max-width: 760px;
    padding: 1.65rem;
    border: 1px solid rgba(32, 92, 54, .10);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(20, 45, 30, .08);
    background: #fff;
}
.calculator-wrapper .calc-step {
    margin-bottom: 1.35rem;
    padding-bottom: 1.35rem;
    border-bottom-color: rgba(32, 92, 54, .12);
}
.calculator-wrapper .calc-step__title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: .85rem;
    letter-spacing: -.015em;
}
.calculator-wrapper .calc-step__subtitle {
    font-size: .98rem;
    margin-bottom: .75rem;
}
.calculator-wrapper .calc-options-grid {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: .65rem;
}
.calculator-wrapper .calc-options-grid--small {
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
}
.calculator-wrapper .calc-option-card {
    padding: .75rem .65rem;
    border: 1px solid #e3eae5;
    border-radius: 12px;
    min-height: 76px;
}
.calculator-wrapper .calc-option-card .icon {
    font-size: 1.25rem;
    margin-bottom: .3rem;
}
.calculator-wrapper .calc-params-grid {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: .85rem;
}
.calculator-wrapper .calc-checkbox {
    gap: .55rem;
    font-size: .88rem;
    line-height: 1.35;
}
.calculator-wrapper .calc-extras-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .6rem;
}
.calculator-wrapper .calc-total-block {
    padding: 1.15rem;
    gap: 1rem;
    border-radius: 14px;
}
.calculator-wrapper .calc-total-row {
    font-size: .9rem;
    gap: .8rem;
}
.calculator-wrapper .calc-total-price {
    padding: 1rem;
    border-width: 1px;
    border-radius: 12px;
}
.calculator-wrapper .calc-total-label {
    font-size: .88rem;
    margin-bottom: .35rem;
}
.calculator-wrapper .calc-total-value {
    font-size: 2rem;
}
.calculator-wrapper #openOrderFromCalc {
    min-height: 48px;
}
@media (max-width: 768px) {
    .calculator-wrapper {
        padding: 1.1rem;
        border-radius: 15px;
    }
    .calculator-wrapper .calc-step {
        margin-bottom: 1.1rem;
        padding-bottom: 1.1rem;
    }
    .calculator-wrapper .calc-total-block {
        padding: .9rem;
    }
    .calculator-wrapper .calc-total-value {
        font-size: 1.8rem;
    }
}
@media (max-width: 380px) {
    .calculator-wrapper {
        padding: .85rem;
    }
    .calculator-wrapper .calc-options-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .calculator-wrapper .calc-options-grid--small {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}


/* Юридические модальные окна: полный текст с отдельной прокруткой */
#modal-privacy .modal__content,
#modal-agreement .modal__content {
    display: flex;
    flex-direction: column;
    width: min(90vw, 800px);
    max-height: min(88vh, 900px);
    max-height: min(88dvh, 900px);
    overflow: hidden;
}

#modal-privacy .modal__title,
#modal-agreement .modal__title {
    flex: 0 0 auto;
    padding-right: 2.5rem;
}

#modal-privacy .legal-text,
#modal-agreement .legal-text {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 1rem 1rem 0;
}

#modal-privacy .legal-text ul,
#modal-agreement .legal-text ul,
#modal-privacy .legal-text ol,
#modal-agreement .legal-text ol {
    padding-left: 1.4rem;
    margin: 0 0 1rem;
}

#modal-privacy .legal-text li,
#modal-agreement .legal-text li {
    margin-bottom: .45rem;
}

#modal-privacy .modal__close,
#modal-agreement .modal__close {
    z-index: 2;
}

@media (max-width: 600px) {
    #modal-privacy .modal__content,
    #modal-agreement .modal__content {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
        padding: 1.25rem;
    }
    #modal-privacy .modal__title,
    #modal-agreement .modal__title {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }
    #modal-privacy .legal-text,
    #modal-agreement .legal-text {
        font-size: .9rem;
        padding-right: .5rem;
    }
}

/* =========================================
   25. КОМПАКТНЫЙ КАЛЬКУЛЯТОР + ДО/ПОСЛЕ
   ========================================= */
.calculator-layout {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    align-items: stretch;
    gap: clamp(1rem, 2vw, 1.6rem);
}
.calculator-layout .calculator-wrapper {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: clamp(1rem, 1.8vw, 1.5rem);
    border: 1px solid rgba(32, 92, 54, .09);
    box-shadow: 0 14px 40px rgba(20, 45, 28, .08);
}
.calculator-layout .calc-step {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}
.calculator-layout .calc-step__title {
    font-size: 1rem;
    margin-bottom: .7rem;
}
.calculator-layout .calc-options-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}
.calculator-layout .calc-options-grid--small {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.calculator-layout .calc-option-card {
    min-width: 0;
    padding: .65rem .45rem;
    font-size: .86rem;
    line-height: 1.3;
}
.calculator-layout .calc-option-card .icon {
    font-size: 1.15rem;
    margin-bottom: .2rem;
}
.calculator-layout .calc-params-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}
.calculator-layout .calc-extras-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
}
.calculator-layout .calc-checkbox {
    gap: .45rem;
    font-size: .83rem;
    line-height: 1.35;
}
.calculator-layout .calc-total-block {
    padding: 1rem;
    gap: .8rem;
}
.calculator-layout .calc-total-value {
    font-size: clamp(1.7rem, 2.5vw, 2.1rem);
}
.before-after-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(32, 92, 54, .09);
    border-radius: var(--radius);
    box-shadow: 0 14px 40px rgba(20, 45, 28, .08);
}
.before-after-card__image {
    position: relative;
    min-height: 280px;
    flex: 1 1 auto;
    overflow: hidden;
    background: #e9eee9;
}
.before-after-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
}
.before-after-tag {
    position: absolute;
    top: 1rem;
    z-index: 1;
    padding: .45rem .8rem;
    border-radius: 999px;
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.before-after-tag--before { left: 1rem; background: rgba(48, 53, 49, .82); }
.before-after-tag--after { right: 1rem; background: var(--color-primary); }
.before-after-card__content { padding: clamp(1.1rem, 2vw, 1.6rem); }
.before-after-card__eyebrow {
    display: block;
    margin-bottom: .55rem;
    color: var(--color-primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .1em;
}
.before-after-card__content h3 {
    margin: 0 0 .6rem;
    color: var(--color-text);
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    line-height: 1.2;
}
.before-after-card__content p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: .94rem;
    line-height: 1.6;
}
.before-after-card__note {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin-top: 1rem;
    color: var(--color-primary-dark);
    font-size: .88rem;
    font-weight: 700;
}
.before-after-card__note span { font-size: 1.1rem; }
.legal-consent {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin: .2rem 0 1rem;
    color: inherit;
    font-size: .82rem;
    line-height: 1.5;
    cursor: pointer;
}
.legal-consent input[type="checkbox"] {
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    margin: .12rem 0 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.legal-consent a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.modal__form .legal-consent { color: var(--color-text-muted); }
.legal-consent--popup { color: inherit; font-size: .76rem; }

@media (max-width: 980px) {
    .calculator-layout { grid-template-columns: minmax(0, 1fr); }
    .before-after-card__image { min-height: 250px; }
    .before-after-card__image img { min-height: 250px; max-height: 360px; }
}
@media (max-width: 560px) {
    .calculator-layout .calculator-wrapper { padding: .9rem; }
    .calculator-layout .calc-options-grid--small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .calculator-layout .calc-params-grid,
    .calculator-layout .calc-extras-grid { grid-template-columns: minmax(0, 1fr); }
    .before-after-card__image,
    .before-after-card__image img { min-height: 205px; }
    .legal-consent { font-size: .77rem; }
}

/* Interactive before / after comparison */
.before-after-card__image { aspect-ratio: 4 / 3; min-height: 0; }
.before-after-card__image img.before-after-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    object-fit: cover;
}
.before-after-image--after { z-index: 0; }
.before-after-image--before {
    z-index: 1;
    clip-path: inset(0 calc(100% - var(--reveal)) 0 0);
}
.before-after-tag { z-index: 3; }
.before-after-tag--before { left: 1rem; }
.before-after-tag--after { right: 1rem; }
.before-after-divider {
    position: absolute;
    z-index: 2;
    top: 0;
    bottom: 0;
    left: var(--reveal);
    width: 3px;
    background: #fff;
    transform: translateX(-50%);
    box-shadow: 0 0 0 1px rgba(0,0,0,.12);
    pointer-events: none;
}
.before-after-divider::after {
    content: "↔";
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    transform: translate(-50%, -50%);
}
.before-after-range {
    position: absolute;
    z-index: 4;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}
@media (max-width: 980px) {
    .before-after-card__image,
    .before-after-card__image img.before-after-image { min-height: 0; max-height: none; }
}
@media (max-width: 560px) {
    .before-after-card__image { aspect-ratio: 4 / 3; }
}

/* Final refinement: balanced calculator + full before/after image */
@media (min-width: 981px) {
  .calculator-layout {
    grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
    align-items: start;
    gap: clamp(1rem, 1.6vw, 1.4rem);
  }
  .before-after-card {
    align-self: start;
    height: auto;
  }
  .before-after-card__image {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 3 / 2;
    min-height: 0;
  }
  .before-after-card__image img.before-after-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #eeeae4;
  }
  .calculator-layout .calculator-wrapper {
    padding: clamp(.85rem, 1.25vw, 1.15rem);
  }
  .calculator-layout .calc-step {
    margin-bottom: .75rem;
    padding-bottom: .75rem;
  }
  .calculator-layout .calc-step__title {
    margin-bottom: .5rem;
    font-size: .94rem;
  }
  .calculator-layout .calc-options-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .4rem;
  }
  .calculator-layout .calc-options-grid--small {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .4rem;
  }
  .calculator-layout .calc-option-card {
    min-height: 58px;
    padding: .48rem .35rem;
    font-size: .78rem;
    line-height: 1.2;
  }
  .calculator-layout .calc-option-card .icon {
    margin-bottom: .12rem;
    font-size: 1rem;
  }
  .calculator-layout .calc-params-grid,
  .calculator-layout .calc-extras-grid {
    gap: .5rem;
  }
  .calculator-layout .calc-step__subtitle {
    margin: .8rem 0 .5rem !important;
    font-size: .9rem;
  }
  .calculator-layout .calc-total-block {
    padding: .8rem;
    gap: .6rem;
  }
  .calculator-layout .calc-total-value {
    font-size: 1.65rem;
  }
}
@media (max-width: 980px) {
  .calculator-layout { align-items: stretch; }
  .before-after-card__image { aspect-ratio: 3 / 2; }
  .before-after-card__image img.before-after-image { object-fit: contain; background: #eeeae4; }
}
