/* ====================================================== */
/* --- ОБЩИЕ СТИЛИ И ПЕРЕМЕННЫЕ --- */
/* ====================================================== */
:root {
    --primary-color: #005A9C; /* Профессиональный синий */
    --secondary-color: #F0F8FF; /* Очень светлый синий для фона */
    --accent-color: #FFC107; /* Акцентный желтый для бейджей */
    --dark-color: #333;
    --gray-color: #666;
    --light-gray-color: #f4f4f4;
    --white-color: #ffffff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --font-family: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--white-color);
    color: var(--dark-color);
    line-height: 1.7;
    position: relative; /* Для фоновых элементов */
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 15px;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; color: var(--primary-color); text-align: center; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.4rem; }

p {
    margin-bottom: 15px;
}

.section-subtitle { 
    text-align: center; 
    max-width: 700px; 
    margin: 0 auto 40px auto; 
    color: var(--gray-color); 
}

section {
    padding: 80px 0;
    position: relative;
    overflow: hidden; /* Чтобы фоновые капли не вылезали */
}

/* ... все ваши существующие стили до секции Header ... */

/* ====================================================== */
/* --- ШАПКА (HEADER) --- */
/* ====================================================== */
#header {
    background-color: var(--white-color);
    padding: 15px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

#header.sticky {
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

#header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

#header nav { 
    display: flex; 
    align-items: center; 
    gap: 25px; 
    transition: all 0.3s ease; /* Добавлено для будущих анимаций */
}
#header nav a { text-decoration: none; color: var(--dark-color); font-weight: 600; transition: color 0.3s ease; }
#header nav a:hover { color: var(--primary-color); }

.cta-button-nav { 
    background-color: var(--primary-color); 
    color: var(--white-color) !important; 
    padding: 8px 18px; 
    border-radius: 25px; 
    transition: background-color 0.3s ease; 
}
.cta-button-nav:hover { background-color: #004170; }


/* ====================================================== */
/* НОВЫЙ КОД: Стили для кнопки-бургера */
/* ====================================================== */
#burger-menu-toggle {
    display: none; /* Скрыт на десктопе */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

#burger-menu-toggle span {
    width: 30px;
    height: 3px;
    background: var(--dark-color);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Анимация бургера в крестик */
#burger-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
}

#burger-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

#burger-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}


@media (max-width: 768px) {
    section { padding: 60px 0; }
    h1 { font-size: 2.2rem; } /* Немного уменьшим для мобильных */

    #header .container {
        flex-direction: row; 
    }

    #header nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white-color);
        box-shadow: 0 10px 15px rgba(0,0,0,0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out, padding 0.4s ease-in-out; /* Добавлена анимация для padding */
        flex-direction: column;
        align-items: flex-start; /* Выравниваем по левому краю */
        gap: 0;
        /* ИЗМЕНЕНИЕ: Убираем вертикальный padding, добавляем общий */
        padding: 0 20px;
    }

    #header nav.active {
        max-height: 500px; 
        /* ИЗМЕНЕНИЕ: Добавляем вертикальный padding при открытии */
        padding-top: 20px;
        padding-bottom: 20px;
    }
    
    #header nav a {
        padding: 15px 0; /* Убираем боковые паддинги */
        width: 100%;
        text-align: left; /* Выравниваем текст по левому краю */
    }

    #header nav a:hover {
        background: var(--secondary-color);
        color: var(--primary-color);
    }
    
    .cta-button-nav {
        /* ИЗМЕНЕНИЕ: Убираем боковые margin и сложные расчеты ширины */
        margin: 15px 0 0 0;
        width: 100%;
        text-align: center;
        padding: 15px 0;
    }

    #burger-menu-toggle {
        display: flex;
    }

    /* Существующие стили для других секций */
    .hero { padding-top: 120px; } /* Уменьшаем отступ */
    .hero-content, .benefits-section .container, .steps-container, .comparison-container, .offers-grid {
        flex-direction: column;
    }
    .offers-grid { grid-template-columns: 1fr; }
}


/* ====================================================== */
/* --- ПЕРВЫЙ ЭКРАН (HERO) --- */
/* ====================================================== */
.hero { 
    background-color: var(--secondary-color); 
    padding-top: 140px; 
    padding-bottom: 80px; 
}

.hero::before { /* Фоновая капля */
    content: '';
    position: absolute;
    top: -20%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 45% 55% 70% 30% / 40% 50% 50% 60%;
    filter: blur(90px);
    opacity: 0.15;
    z-index: 0;
}

.hero-content { display: flex; align-items: center; gap: 40px; position: relative; z-index: 1; }
.hero-text { flex: 1; }
.hero-image { flex: 1; }
.hero-image img { max-width: 100%; border-radius: 10px; }

.cta-button { 
    display: inline-block; 
    background-color: var(--primary-color); 
    color: var(--white-color); 
    padding: 15px 30px; 
    font-size: 1.1rem; 
    font-weight: 600; 
    text-decoration: none; 
    border-radius: 30px; 
    transition: transform 0.3s ease, background-color 0.3s ease; 
    border: none; 
    cursor: pointer; 
}
.cta-button:hover { background-color: #004170; transform: translateY(-3px); }


/* ====================================================== */
/* --- СЕКЦИЯ ПРЕИМУЩЕСТВ (BENEFITS) --- */
/* ====================================================== */
.benefits-section { background-color: var(--white-color); }
.benefits-section .container { display: flex; justify-content: space-between; gap: 30px; }
.benefit-card { text-align: center; padding: 20px; flex: 1; }
/* Улучшенный стиль для SVG-иконок */
.benefit-card .icon {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    color: var(--primary-color); /* Задаем иконкам основной синий цвет сайта */
}

/* ====================================================== */
/* --- СЕКЦИЯ С ЦИФРАМИ (NUMBERS) --- */
/* ====================================================== */
.numbers-section { background-color: var(--light-gray-color); }
.stats-container { display: flex; justify-content: space-around; text-align: center; margin-top: 40px; }
.stat-item .number { font-size: 4.5rem; font-weight: 700; color: var(--primary-color); line-height: 1; }
.stat-item .label { font-size: 1.1rem; color: var(--gray-color); margin-top: 10px; }


/* ====================================================== */
/* --- СЕКЦИЯ ТИПЫ КРЕДИТОВ (LOAN TYPES) --- */
/* ====================================================== */
.loan-types-section { background-color: var(--white-color); }
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}
.type-card {
    text-align: center;
    padding: 30px;
    background-color: var(--light-gray-color);
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}
.type-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}
.type-card p {
    color: var(--gray-color);
    font-size: 0.95rem;
}

/* ====================================================== */
/* --- СЕКЦИЯ ПРЕДЛОЖЕНИЙ (OFFERS) --- */
/* ====================================================== */
.offers-section { background-color: var(--secondary-color); }
.offers-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}
.offer-card {
    display: flex;
    flex-direction: column;
    background: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.07);
    padding: 25px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative; /* Для бейджа */
}
.offer-card:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 90, 156, 0.15);
    border-color: var(--primary-color);
}
.offer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.offer-header h4 {
    font-size: 1.4rem;
    color: var(--dark-color);
    margin: 0;
}
.offer-header span {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    background-color: var(--secondary-color);
    padding: 5px 10px;
    border-radius: 15px;
}
.offer-details {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1; /* Занимает все доступное место, прижимая кнопку вниз */
}
.offer-details li {
    padding: 8px 0;
    color: var(--gray-color);
    border-bottom: 1px dotted #e0e0e0;
}
.offer-details li:last-child {
    border-bottom: none;
}
.offer-details strong {
    color: var(--dark-color);
}
.offer-cta {
    width: 100%;
    text-align: center;
    margin-top: 20px;
}
.special-offer {
    border-color: var(--accent-color);
    border-width: 2px;
}
.special-badge {
    position: absolute;
    top: -1px;
    right: 20px;
    background-color: var(--accent-color);
    color: var(--dark-color);
    padding: 5px 15px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ====================================================== */
/* --- СЕКЦИЯ КАЛЬКУЛЯТОРА (CALCULATOR) --- */
/* ====================================================== */
.calculator-section { background-color: var(--white-color); }
.calculator-form { max-width: 700px; margin: 0 auto; background: var(--white-color); padding: 40px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.form-group { margin-bottom: 30px; }
.form-group label { font-weight: 600; display: block; margin-bottom: 10px; }
.form-group input[type="range"] { width: 100%; cursor: pointer; }
.calculator-result { text-align: center; background-color: var(--secondary-color); padding: 20px; border-radius: 8px; margin-top: 20px; }
.calculator-result h3 { color: var(--primary-color); margin-bottom: 5px; text-align: center; }
#monthlyPayment { font-size: 2.5rem; font-weight: 700; color: var(--dark-color); margin: 0; }
.calculator-result span { font-size: 0.8rem; color: var(--gray-color); }
.form-cta { display: block; width: 100%; text-align: center; margin-top: 30px; }

/* ====================================================== */
/* --- СЕКЦИЯ СРАВНЕНИЯ (WHY) --- */
/* ====================================================== */
.why-section { background-color: var(--secondary-color); }
.comparison-container { display: flex; gap: 30px; margin-top: 40px; }
.comparison-card { flex: 1; background: var(--white-color); padding: 30px; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.comparison-card h3 { color: var(--primary-color); }
.comparison-card ul { list-style: none; padding-left: 0; }
.comparison-card li { padding-left: 25px; position: relative; margin-bottom: 15px; }
.comparison-card li::before { content: '✓'; color: var(--success-color); position: absolute; left: 0; font-weight: 700; }
.comparison-card:last-child li::before { content: '✗'; color: var(--danger-color); }

/* ====================================================== */
/* --- СЕКЦИЯ ПРИМЕРА РАСЧЕТА (KKM) --- */
/* ====================================================== */
.kkm-section { background-color: var(--white-color); }
.kkm-box { max-width: 800px; margin: 40px auto 0 auto; background: var(--light-gray-color); border: 1px solid #ddd; border-radius: 8px; padding: 30px; }
.kkm-box > p { font-weight: 600; }
.kkm-box ul { list-style-type: none; margin: 20px 0; padding-left: 0; }
.kkm-box li { margin-bottom: 5px; }
.kkm-result { border-top: 1px dashed #ccc; padding-top: 20px; margin-top: 20px; }
.kkm-result p { font-size: 1.1rem; }
.kkm-result span { font-size: 0.85rem; color: var(--gray-color); line-height: 1.5; }

/* ====================================================== */
/* --- СЕКЦИЯ "КАК ЭТО РАБОТАЕТ" (HOW IT WORKS) --- */
/* ====================================================== */
.how-it-works-section { background-color: var(--light-gray-color); }
.steps-container { display: flex; justify-content: space-between; gap: 40px; margin-top: 40px; }
.step { flex: 1; text-align: center; }
.step-number { width: 60px; height: 60px; background-color: var(--primary-color); color: var(--white-color); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.8rem; font-weight: 700; margin: 0 auto 20px auto; }
.step h3 { color: var(--dark-color); }
.step p { color: var(--gray-color); }

/* ====================================================== */
/* --- СЕКЦИЯ ОТЗЫВОВ (TESTIMONIALS) --- */
/* ====================================================== */
.testimonials-section { background: var(--white-color); }
.testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-top: 40px; }
.testimonial-card { background: var(--light-gray-color); padding: 30px; border-radius: 10px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.testimonial-avatar { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 20px; object-fit: cover; }
.testimonial-card p { font-style: italic; color: var(--gray-color); margin-bottom: 20px; }
.testimonial-card h4 { font-weight: 600; color: var(--primary-color); }

/* ====================================================== */
/* --- СЕКЦИЯ FAQ --- */
/* ====================================================== */
.faq-section { background-color: var(--secondary-color); }
.faq-section .container { max-width: 800px; margin: auto; }
.faq-item { border-bottom: 1px solid #ccc; padding: 15px 0; }
.faq-question { font-weight: 600; cursor: pointer; position: relative; padding-right: 30px; }
.faq-question::after { content: '+'; font-size: 1.5rem; position: absolute; right: 0; top: 50%; transform: translateY(-50%); transition: transform 0.3s ease; }
.faq-item.active .faq-question::after { transform: translateY(-50%) rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out; }
.faq-answer p { padding-top: 15px; color: var(--gray-color); }

/* ====================================================== */
/* --- ПОДВАЛ (FOOTER) --- */
/* ====================================================== */
footer { background-color: var(--dark-color); color: var(--white-color); padding: 50px 0 20px 0; text-align: center; }
.footer-content h3 { text-align: center; }
.footer-content p { color: #ccc; margin-bottom: 5px; }
.footer-bottom { margin-top: 40px; border-top: 1px solid var(--gray-color); padding-top: 20px; }
.footer-bottom p { font-size: 0.9rem; color: var(--gray-color); }

/* ====================================================== */
/* --- АНИМАЦИИ --- */
/* ====================================================== */
.animated, .animated-hero { opacity: 0; transform: translateY(40px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.animated.visible, .animated-hero.visible { opacity: 1; transform: translateY(0); }
.animated-hero:nth-child(1) { transition-delay: 0.1s; }
.animated-hero:nth-child(2) { transition-delay: 0.2s; }
.animated-hero:nth-child(3) { transition-delay: 0.3s; }

/* ====================================================== */
/* --- АДАПТИВНОСТЬ (MEDIA QUERIES) --- */
/* ====================================================== */
@media (max-width: 992px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    .testimonials-grid { grid-template-columns: 1fr; }
    .stats-container { flex-direction: column; gap: 40px; }
    
    .offer-card {
        flex-direction: column !important; /* Важно для переопределения */
        align-items: stretch !important;
    }
    .offer-details {
        padding: 0 !important;
    }
    .offer-cta {
        width: 100% !important;
        margin-top: 20px !important;
    }
}

@media (max-width: 768px) {
    section { padding: 60px 0; }
    #header .container { flex-direction: column; gap: 10px; }
    #header nav { flex-wrap: wrap; justify-content: center; gap: 15px; }
    #header nav a {
        padding: 15px 0;
        width: 100%;
        text-align: center; /* ИСПРАВЛЕНО */
    }
    .hero { padding-top: 180px; }
    .hero-content { flex-direction: column; text-align: center; }
    .benefits-section .container { flex-direction: column; }
    .steps-container { flex-direction: column; }
    .comparison-container { flex-direction: column; }
    .offers-grid { grid-template-columns: 1fr; }
}