/* --- Глобальные стили и переменные --- */
:root {
    --primary-color: #1b1f3f; /* Яркий красный для акцентов */
    --secondary-color: #f5f5f5;
    --dark-bg: #fff;
    --text-color: #000000;
    --text-light: #fff;
    --text-muted: #333; /* Сделали текст чуть темнее для лучшего контраста */
    --container-width: 1200px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased; /* Улучшение рендеринга шрифтов */
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 700;
}

h1 {
    /* Адаптивный размер шрифта */
    font-size: clamp(2.2rem, 5.5vw, 3.5rem);
    font-weight: 900;
}

h2 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    text-align: center;
    margin-bottom: 60px;
}

section {
    padding: 80px 0;
    overflow-x: hidden; /* Предотвращаем горизонтальный скролл */
}

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

/* --- Стили кнопок --- */
.btn-primary, .btn-secondary {
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
}
.btn-primary:hover {
    background-color: #C62828;
    border-color: #C62828;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
}
.btn-secondary:hover {
    background-color: #C62828;
    border-color: #C62828;
    transform: translateY(-2px);
}


/* --- Шапка --- */
.main-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 60px 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-circle {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 10;
}

.logo-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 50%;
}

.logo-lines {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 2px;
    pointer-events: none;
    z-index: -10;
}

.line {
    position: absolute;
    top: -25px;
    height: 50px;
    background: white;
}

.line-left {
    right: 50%;
    width: 50vw;
    margin-right: 40px;
}

.line-right {
    left: 50%;
    width: 50vw;
    margin-left: 40px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 40px;
    position: absolute;
}

.left-nav {
    right: 60%;
}

.right-nav {
    left: 60%;
}

.main-nav a {
    color: var(--text-color);
    font-weight: 400;
    text-decoration: none;
    font-size: 16px;
    text-transform: lowercase;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.nav-divider {
    color: #ccc;
    font-size: 16px;
}

/* --- Блок 1: Главный экран --- */
 .hero {
    position: relative;
    min-height: 80vh;
    background: url('/static/img/main-bg.jpg') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding-top: 120px; /* Отступ для шапки */
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
}
.hero-container {
    position: relative;
    z-index: 2;
    padding-top: 100px; /* Добавляем отступ для хедера */
}
.hero h1 {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 40px;
}
.hero .subtitle {
    display: inline-block;
    background: rgba(255,255,255,0.95);
    color: var(--primary-color);
    font-weight: bold;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    padding: 8px 24px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap; /* Для переноса кнопок на маленьких экранах */
    margin-bottom: 40px;
}

.hero-details-btn {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 15px 30px;
    font-size: 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: lowercase;
}

.hero-details-btn:hover {
    background: white;
    color: var(--primary-color);
}

/* Стили для индикаторов слайдера */
.slider-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

.hero-bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, #e53935 0%, #ffb347 100%);
    opacity: 0.12;
    z-index: 0;
}

.hero-wave {
    position: absolute;
    left: 0;
    bottom: -1px; /* -1px для скрытия возможных артефактов рендеринга */
    width: 100%;
    height: 120px;
    z-index: 2;
    pointer-events: none;
}

.hero-title-accent {
    color: white;
    display: block;
}


/* --- Блок 2: Соцсети и Призыв к Действию --- */
.social-cta-section {
    background-color: #f9f9f9;
    padding: 50px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.social-cta-section .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 40px;
}

.social-icons-wrapper {
    text-align: center;
}

.social-icons-wrapper h4 {
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 1.1rem;
}

.social-icons-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.social-icon-link {
    color: var(--primary-color);
    font-size: 2.2rem;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon-link:hover {
    color: #C62828;
    transform: translateY(-5px);
}

.callback-cta {
    flex-grow: 1;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 25px 35px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.callback-cta .cta-text h3 {
    margin-bottom: 5px;
    font-size: 1.5rem;
}
.callback-cta .cta-text p {
    color: var(--text-muted);
    margin: 0;
}

/* --- Блок 3: Почему мы --- */
.modern-why-us {
    background: linear-gradient(180deg, #fff 60%, #f5f5f5 100%);
    position: relative;
    z-index: 1;
    text-align: center;
}

.section-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 60px auto;
    font-style: italic;
}

.modern-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.modern-features-grid .feature-item {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(229, 57, 53, 0.08), 0 1.5px 6px rgba(0, 0, 0, 0.04);
    padding: 36px 28px 28px 28px;
    text-align: center;
    transition: transform 0.3s cubic-bezier(.4, 2, .6, 1), box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.modern-features-grid .feature-item:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 16px 48px rgba(229, 57, 53, 0.13), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.modern-features-grid .feature-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 18px;
    filter: drop-shadow(0 2px 8px #e5393533);
}

.modern-features-grid .feature-item h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.modern-features-grid .feature-item p {
    color: var(--text-muted);
    font-size: 1rem;
}

.modern-founders-block {
    margin-top: 40px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 4px 24px rgba(229, 57, 53, 0.06);
    padding: 32px 16px 16px 16px;
}

.modern-founders-block h3 {
    text-align: center;
    margin-bottom: 24px;
}

.modern-founders-block .founders-container {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
}

.modern-founders-block .founder-item {
    text-align: center;
    transition: transform 0.3s cubic-bezier(.4, 2, .6, 1), box-shadow 0.3s;
    border-radius: 16px;
    background: #fafafa;
    box-shadow: 0 2px 12px rgba(229, 57, 53, 0.04);
    padding: 18px 24px 10px 24px;
}

.modern-founders-block .founder-item:hover {
    transform: translateY(-6px) scale(1.04);
    box-shadow: 0 8px 32px rgba(229, 57, 53, 0.10);
}

.modern-founders-block .founder-item img {
    border-radius: 50%;
    box-shadow: 0 2px 12px #e5393533;
    margin-bottom: 12px;
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.modern-founders-block .founder-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* --- Блок 4: Этапы работы --- */
.how-it-works {
    background: #f7f7f7;
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.step {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    border-top: 5px solid var(--primary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.step:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.step span {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}
.step h3 {
    margin-top: 10px;
}

/* --- Блок 5: Отзывы --- */
.testimonials {
    background: #fff;
}
.testimonial-item {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
.testimonial-item img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
}
.testimonial-text {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-muted);
}
.testimonial-author {
    font-size: 1.2rem;
}
.testimonial-car {
    color: var(--primary-color);
}

/* --- Блок 6: FAQ --- */
.faq {
    background: var(--primary-color);
    color: var(--text-light);
}

.faq h2 {
    color: var(--text-light);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.faq-item:hover {
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.faq-question {
    padding: 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: rgba(255, 255, 255, 0.05);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--text-light);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer p {
    padding: 0 25px 25px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-item.active .faq-answer {
    max-height: 200px;
}


/* --- Подвал --- */
footer.main-footer {
    background-color: #f5f5f5;
    padding-top: 60px;
    color: var(--text-color);
    border-top: 1px solid #eee;
}
.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
}
.footer-col p, .footer-col a {
    color: var(--text-muted);
    margin-bottom: 10px;
}
.footer-social-icons a {
    font-size: 1.5rem;
    margin-right: 15px;
    transition: color 0.3s ease;
    color: var(--primary-color);
}
.footer-social-icons a:hover {
    color: #C62828;
}
.copyright {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #eee;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.copyright a {
    color: var(--primary-color);
}


/* --- Всплывающие окна (Модалки) --- */
.modal {
    display: none; /* ИСПРАВЛЕНО: Это единственное правило display, которое делает окно скрытым по умолчанию */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s;
    /* Центрирование будет достигаться через JS, добавляя display: flex */
    align-items: center;
    justify-content: center;
    padding: 20px;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-content {
    background-color: #fff;
    padding: 40px;
    width: 100%; /* Ширина управляется padding родителя .modal */
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    color: var(--text-color);
    animation: slideIn 0.3s;
    max-height: 95vh; /* Ограничение высоты */
    overflow-y: auto; /* Скролл, если контент не влезает */
    margin: 0; /* Убираем старый margin */
}
@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-btn:hover,
.close-btn:focus {
    color: black;
}

/* Промо-модалка с логотипом */
.promo-modal {
    text-align: center;
    max-width: 420px;
    padding: 50px 30px;
}

.promo-content h2 {
    font-size: 2.2rem; /* Слегка уменьшен для мобильных */
    margin-bottom: 15px;
}

.promo-content p {
    color: #777;
    max-width: 300px;
    margin: 0 auto 30px auto;
}

.logo-wrapper {
    margin: 0 auto 30px auto;
    text-align: center;
}

.promo-logo {
    width: 120px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logo-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px auto;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-initials {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    line-height: 1;
}

.promo-modal .btn-primary {
    width: 100%;
    font-size: 1rem;
}

/* Форма в модалке */
.modal-content.dark-form {
    background-color: #fff;
    color: var(--text-color);
    border: 1px solid #eee;
}

.dark-form .close-btn {
    color: #aaa;
}

.dark-form .close-btn:hover {
    color: #333;
}

.dark-form .form-header {
    text-align: center;
    margin-bottom: 30px;
}

.dark-form .form-header h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.dark-form .form-header p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 350px;
    margin: 0 auto;
}

.dark-form form input,
.dark-form form select {
    background-color: #f5f5f5;
    border: 1px solid #ccc;
    color: var(--text-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    width: 100%;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.dark-form form input::placeholder,
.dark-form form select {
    color: #aaa;
}

.dark-form form input:focus,
.dark-form form select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.dark-form .btn-primary {
    width: 100%;
}

.dark-form .form-buttons-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.dark-form .privacy-policy {
    font-size: 0.8rem;
    color: #777;
    margin-top: 20px;
    text-align: center;
}

/* Плавная смена отзывов */
.testimonial-slider {
    transition: opacity 0.4s ease-in-out;
}
.testimonial-slider.fade-out {
    opacity: 0;
}


/* --- Анимации появления --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(.4,2,.6,1), transform 0.7s cubic-bezier(.4,2,.6,1);
}
.is-visible.animate-on-scroll {
    opacity: 1;
    transform: none;
}

/* Toast notification styles */
.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #fff;
    color: var(--primary-color);
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 9999;
    left: 50%;
    bottom: 40px;
    font-size: 18px;
    font-weight: bold;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 60px;
}


@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }

    h2 {
        margin-bottom: 40px;
    }

    /* Улучшенная мобильная адаптация header */
    .main-header {
        padding: 20px 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
    }

    .main-header .container {
        flex-direction: row;
        align-items: center;
        position: relative;
        gap: 0;
    }

    .logo-container {
        order: 1;
        flex-shrink: 0;
    }

    .logo-circle {
        width: 50px;
        height: 50px;
    }

    .logo-img {
        width: 30px;
        height: 30px;
    }

    .logo-lines {
        display: none;
    }

    /* Объединяем навигацию в одну строку */
    .main-nav {
        position: static;
        order: 2;
        display: flex;
        gap: 15px;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
    }

    .left-nav,
    .right-nav {
        position: static;
        display: flex;
        gap: 15px;
    }

    .main-nav a {
        font-size: 14px;
        padding: 8px 12px;
        border-radius: 6px;
        transition: all 0.3s ease;
        background: transparent;
    }

    .main-nav a:hover {
        background: rgba(229, 57, 53, 0.1);
        color: var(--primary-color);
    }

    .nav-divider {
        display: none;
    }

    .hero {
        min-height: 60vh;
        padding-top: 120px; /* Уменьшаем отступ для компактной шапки */
        padding-bottom: 80px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .modal-content {
        padding: 25px;
        max-height: 90vh;
    }

    .promo-content h2 {
        font-size: 1.8rem;
    }

    .hero-wave {
        height: 60px;
    }

    .modern-founders-block .founder-item img {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 600px) {
    .hero-wave {
        height: 40px;
    }

    .modern-features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .modern-founders-block .founders-container {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .modern-founders-block {
        padding: 18px 0 8px 0;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        max-width: 320px; /* Чтобы кнопки не растягивались на всю ширину */
        padding-left: 15px;
        padding-right: 15px;
    }

    .dark-form .form-buttons-group {
        flex-direction: column;
    }

    /* Дополнительные стили для мобильного хедера */
    .main-nav {
        gap: 10px;
    }

    .main-nav a {
        font-size: 13px;
        padding: 6px 10px;
    }

    .nav-divider {
        display: none; /* Также скрываем на очень маленьких экранах */
    }
}

/* Дополнительные стили для очень маленьких экранов */
@media (max-width: 480px) {
    .main-header .container {
        padding: 0 15px;
    }

    .logo-circle {
        width: 45px;
        height: 45px;
    }

    .logo-img {
        width: 25px;
        height: 25px;
    }

    .main-nav {
        gap: 8px;
    }

    .main-nav a {
        font-size: 12px;
        padding: 5px 8px;
    }

    .left-nav,
    .right-nav {
        gap: 8px;
    }

    .hero {
        padding-top: 100px;
    }
}