﻿/* Общие стили */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-image: url('Фон.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    overflow-x: hidden; /* <-- Добавлено: предотвращает горизонтальную прокрутку */
}

header {
    background-color: rgba(26, 26, 26, 0.4);
    color: #fff;
    padding: 1em 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1em 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    position: sticky; /* Остается sticky для десктопа */
    top: 0;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 60px;
    margin-right: 10px;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

nav li a {
    color: #fff;
    text-decoration: none;
    margin-left: 1.5em;
    padding: 0.5em 1em;
    transition: color 0.3s ease, background-color 0.3s ease;
    border-radius: 4px;
    font-weight: bold;
}

nav li a:hover {
    color: #FFD700;
    background-color: rgba(255, 255, 255, 0.1);
}

main {
    padding: 40px 20px;
    background-color: rgba(255, 255, 255, 0.6);
    color: #333;
    min-height: calc(100vh - 150px);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin: 20px auto;
    border-radius: 8px;
}

section {
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

h1, h2 {
    color: #0d47a1;
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
}

h3 {
    color: #0d47a1;
    margin-bottom: 15px;
    font-weight: bold;
}

h4 {
    color: #0d47a1;
    margin-bottom: 10px;
    font-weight: bold;
}

p {
    line-height: 1.7;
    margin-bottom: 15px;
    font-size: 1.1em;
}

ul {
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 15px;
    line-height: 1.6;
}

ul li {
    margin-bottom: 8px;
    font-size: 1.05em;
}

footer {
    background-color: rgba(26, 26, 26, 0.4);
    color: #fff;
    text-align: center;
    padding: 1.5em 0;
    position: relative;
    bottom: 0;
    width: 100%;
    margin-top: 20px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.2);
}

footer p {
    margin: 5px 0;
    font-size: 0.9em;
}

.button {
    display: inline-block;
    background-color: #FFD700;
    color: #333;
    padding: 0.8em 1.8em;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.button:hover {
    background-color: #b8860b;
    transform: translateY(-2px);
}

.button-secondary {
    display: inline-block;
    background-color: transparent;
    color: #0d47a1;
    padding: 0.8em 1.8em;
    text-decoration: none;
    border: 2px solid #0d47a1;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
    margin-top: 1.5em;
    font-weight: bold;
    cursor: pointer;
}

.button-secondary:hover {
    background-color: #0d47a1;
    color: #fff;
    transform: translateY(-2px);
}

/* Новый стиль для кнопки "Оставить заявку бесплатно" */
.button-tertiary {
    display: inline-block;
    background-color: #0d47a1; /* Синий цвет */
    color: #fff;
    padding: 0.8em 1.8em;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    margin-top: 20px; /* Отступ сверху от других кнопок */
}

.button-tertiary:hover {
    background-color: #0a3a80; /* Темнее синий при наведении */
    transform: translateY(-2px);
}


/* Стили для главной страницы */
.hero {
    background-color: rgba(13, 71, 161, 0.7);
    padding: 6em 20px;
    text-align: center;
    color: #fff;
    margin-bottom: 40px;
    border-radius: 8px;
}

.hero h1 {
    color: #fff;
    font-size: 2.8em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.hero p {
    font-size: 1.3em;
    opacity: 0.9;
    margin-bottom: 1.5em;
}

/* Стили для новых элементов на главной странице */
.callback-section {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.callback-section h2 {
    color: #0d47a1;
    font-size: 2em;
    margin-bottom: 25px;
}

.contact-buttons {
    display: flex;
    flex-wrap: wrap; /* Добавил для лучшей адаптивности на мелких экранах */
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.contact-buttons .button,
.contact-buttons .button-tertiary { /* Добавил button-tertiary */
    min-width: 180px;
    text-align: center;
    font-size: 1.1em;
}

/* Анимации для появления текста */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

/* Анимации для выезжающих кнопок */
.slide-in-left {
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.slide-in-left.active,
.slide-in-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* --- Стили для новых блоков контента (аккордеоны) --- */
.section-with-toggle {
    margin-bottom: 40px;
    padding: 20px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.collapsible-header {
    cursor: pointer;
    color: #0d47a1;
    margin-bottom: 20px;
    font-weight: bold;
    text-align: center;
    display: flex; /* Для выравнивания стрелки */
    justify-content: center; /* Для центрирования текста */
    align-items: center; /* Для центрирования стрелки по вертикали */
    transition: color 0.3s ease;
}

.collapsible-header:hover {
    color: #0a3a80; /* Темнее при наведении */
}

.collapsible-header .arrow {
    font-size: 0.8em;
    margin-left: 10px;
    display: inline-block; /* Важно для transform */
    transition: transform 0.3s ease;
}

.collapsible-content-wrapper {
    /* Эти стили управляются JS */
}

/* Секция "Почему выбирают меня" */
.why-choose-me {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* 280px min width for items */
    gap: 30px;
    margin-top: 20px;
}

.advantage-item {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.advantage-item h4 {
    margin-top: 0;
    color: #0d47a1;
}

.advantage-item p {
    font-size: 1em;
    line-height: 1.6;
}

/* Секция "Полные услуги" */
.services-full-description {
    margin-top: 40px;
}

.service-category {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px; /* Отступ между категориями услуг */
}

.service-category h3 {
    margin-top: 0;
}

.service-category ul {
    list-style: disc;
    margin-left: 20px;
    padding: 0;
}

.service-category ul li {
    margin-bottom: 8px;
}

/* Секция "Мой путь в юриспруденции" (полное описание "Обо мне") */
.about-full {
    margin-top: 40px;
}

.about-full p {
    margin-bottom: 20px;
}

.about-full h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

/* Секция "Часто задаваемые вопросы" (FAQ) - теперь каждый faq-item-toggle */
.faq-section {
    margin-top: 40px;
}

.faq-item-toggle { /* Контейнер для каждого вопроса-ответа в FAQ */
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.faq-item-toggle h3 { /* Заголовок вопроса, который является кнопкой */
    margin-top: 0;
    cursor: pointer;
    color: #0d47a1;
    display: flex; /* Для выравнивания стрелки */
    justify-content: space-between; /* Для размещения стрелки справа */
    align-items: center;
    transition: color 0.3s ease;
}

.faq-item-toggle h3:hover {
    color: #0a3a80;
}

.faq-item-toggle h3 .arrow {
    font-size: 0.8em;
    margin-left: 10px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.faq-content { /* Контейнер для ответа */
    /* Эти стили управляются JS */
    padding-top: 10px; /* Отступ между вопросом и ответом при раскрытии */
    border-top: 1px solid rgba(0, 0, 0, 0.05); /* Разделитель при раскрытии */
    margin-top: 10px;
}
.faq-content p {
    margin-bottom: 0; /* Убираем лишний отступ у последнего параграфа в ответе */
}

/* --- Стили для СЛАЙДЕРА ОТЗЫВОВ (для reviews-short на главной) --- */
.reviews-short {
    padding: 40px 20px;
    text-align: center;
}

.reviews-slider-container {
    position: relative;
    max-width: 800px; /* Максимальная ширина слайдера */
    margin: 30px auto;
    overflow: hidden; /* Скрывает элементы, выходящие за пределы контейнера */
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px 0; /* Внутренний отступ, чтобы кнопки не прилипали */
}

.reviews-slider {
    display: flex;
    transition: transform 0.5s ease-in-out; /* Плавная анимация переключения слайдов */
}

.review-slide {
    min-width: 100%; /* Каждый слайд занимает всю ширину контейнера */
    box-sizing: border-box; /* Учитываем padding и border в ширине */
    padding: 20px 40px; /* Отступы внутри каждого отзыва */
    text-align: center;
    flex-shrink: 0; /* Не сжимать слайды */
}

.review-text {
    font-style: italic;
    font-size: 1.2em;
    color: #333;
    margin-bottom: 15px;
}

.reviewer-name {
    font-weight: bold;
    color: #0d47a1;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.review-date {
    font-size: 0.9em;
    color: #666;
}

.slider-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(13, 71, 161, 0.7); /* Цвет кнопок */
    color: #fff;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1.5em;
    border-radius: 50%; /* Круглые кнопки */
    line-height: 1; /* Чтобы стрелка была по центру */
    transition: background-color 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 10; /* Поверх слайдов */
}

.slider-button:hover {
    background-color: #0a3a80;
    transform: translateY(-50%) scale(1.1); /* Легкое увеличение при наведении */
}

.slider-button.prev {
    left: 10px;
}

.slider-button.next {
    right: 10px;
}

.slider-dots {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

.dot {
    height: 12px;
    width: 12px;
    margin: 0 5px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease, transform 0.3s ease;
    cursor: pointer;
}

.dot.active {
    background-color: #0d47a1;
    transform: scale(1.2);
}

/* Стили для секции формы обратной связи */
.callback-form-section {
    padding: 40px 20px;
    background-color: rgba(255, 255, 255, 0.85); /* Более плотный фон для формы */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 40px; /* Отступ от предыдущего блока */
    text-align: center; /* Центрируем заголовок и описание */
    scroll-margin-top: 80px; /* Для плавной прокрутки к форме */
}

.callback-form-section h2 {
    color: #0d47a1;
    margin-bottom: 15px;
}

.callback-form-section p {
    color: #555;
    margin-bottom: 30px;
    font-size: 1.1em;
}

#contact-form {
    max-width: 600px;
    margin: 0 auto;
    text-align: left; /* Выравнивание полей по левому краю */
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 1em;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group textarea {
    width: calc(100% - 22px); /* Учитываем padding и border */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    color: #333;
    background-color: #f9f9f9;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #0d47a1;
    outline: none;
    box-shadow: 0 0 5px rgba(13, 71, 161, 0.3);
}

textarea {
    resize: vertical; /* Разрешаем только вертикальное изменение размера */
}

.form-submit-button {
    width: 100%;
    padding: 12px;
    font-size: 1.2em;
    text-align: center;
    border: none;
    cursor: pointer;
    background-color: #0d47a1; /* Синий цвет */
    color: #fff;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.form-submit-button:hover {
    background-color: #0a3a80; /* Темнее синий при наведении */
    transform: translateY(-2px);
}

#form-status {
    margin-top: 20px;
    font-weight: bold;
    color: #0d47a1;
    text-align: center;
}

/* --- НАЧАЛО: Важные изменения для мобильных устройств --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        background-color: rgba(26, 26, 26, 0.6);
        position: static;
        padding: 0.5em 10px;
        box-sizing: border-box;
        width: 100%;
    }

    .logo {
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
    }

    .logo img {
        height: 45px;
        margin-right: 10px;
    }
    
    .logo span {
        font-size: 1em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    nav {
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        margin-top: 5px;
        width: 100%;
    }

    nav li {
        margin: 0;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }

    nav li a {
        padding: 0.5em 0; /* <-- ИЗМЕНЕНО: Уменьшил вертикальный padding */
        font-size: 1em;
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    main {
        padding: 10px;
        margin: 10px auto;
        background-color: rgba(255, 255, 255, 0.7);
        box-sizing: border-box;
    }

    section {
        padding: 15px;
        background-color: rgba(255, 255, 255, 0.9);
        box-sizing: border-box;
    }

    .hero {
        padding: 3em 20px;
        background-color: rgba(13, 71, 161, 0.6);
    }

    .hero h1 {
        font-size: 2em;
    }

    .hero p {
        font-size: 1em;
    }

    /* ---- Правила для кнопок "ПОЗВОНИТЬ" / "НАПИСАТЬ" (оставил с !important для надежности) ---- */
    .contact-buttons {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
    }

    .contact-buttons .button,
    .contact-buttons .button-tertiary {
        width: 90% !important;
        max-width: 300px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        text-align: center !important;
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
    }
    /* ------------------------------------------------------------- */

    /* Адаптивность для новых блоков */
    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .section-with-toggle,
    .faq-item-toggle {
        padding: 15px;
    }

    .hero h1 {
        font-size: 1.8em;
    }

    .hero p {
        font-size: 1.1em;
    }

    h2 {
        font-size: 1.5em;
    }

    h3 {
        font-size: 1.2em;
    }

    p, ul li {
        font-size: 0.95em;
    }

    /* Адаптивность для слайдера отзывов */
    .reviews-slider-container {
        padding: 10px 0;
    }

    .review-slide {
        padding: 15px 25px;
    }

    .slider-button {
        padding: 8px 12px;
        font-size: 1.2em;
    }

    .slider-button.prev {
        left: 5px;
    }

    .slider-button.next {
        right: 5px;
    }

    footer {
        background-color: rgba(26, 26, 26, 0.6);
    }

    body {
        background-attachment: scroll;
    }

    /* Адаптивность для формы */
    .callback-form-section {
        padding: 20px 15px;
    }

    #contact-form {
        padding: 0 10px;
    }

    .form-group input[type="text"],
    .form-group input[type="tel"],
    .form-group textarea {
        width: calc(100% - 20px);
    }
}
/* --- КОНЕЦ: Важные изменения для мобильных устройств --- */