/* Базовые сбросы стилей */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent; 
}


body {
    background-color: #ffffff;
    color: #333333;
    font-family: 'Nunito', sans-serif !important;
}

/* Принудительно задаем этот шрифт для кнопок, чтобы они тоже стали мягкими */
*, *::before, *::after {
    font-family: inherit;
}


/* Стили шапки */
.site-header {
    width: 100%;
    padding: 20px 0;
    background: #ffffff;
}

/* Контейнеры для выравнивания правых краев */
.header-container, 
.hero-section,
.hero-section-2 {
    width: 60%;
    margin: 0 auto;
    padding: 0 20px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 48px; /* Подберите под высоту вашей кнопки */
    width: auto;
    object-fit: contain;
    flex-shrink: 0; 
}

.phone-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
}

.phone-label {
    font-size: 0.75rem;
    color: #4BB45C;
    margin-bottom: 4px;
}

.phone-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #60CF71;
    text-decoration: none;
    display: inline-flex; /* Переключили на inline-flex */
    align-items: center;  /* Выравнивает иконку и текст строго по центру линии */
    justify-content: center;
    gap: 8px;
    line-height: 1;       /* Сбрасываем лишние высоты строк, чтобы центровка не ломалась */
}

.phone-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.phone-icon-img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
}

.phone-digits {
    display: inline-block;
}

.spacer,
.btn-consult {
    flex-shrink: 0;
    width: 20%;
}

.btn-consult {
    background-color: #60CF71;
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-consult:hover {
    background-color: #175427;
}

/* Стили главного баннера */
.hero-section,
.hero-section-2 {
    margin-top: 10px;
    margin-bottom: 40px;
    min-height: 40vh;
    display: flex; 
}

.check-box-png {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url('Resources/checkmark.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.hero-container {
    background: linear-gradient(135deg, #175427 0%, #6FEA83 100%);
    border-radius: 16px;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.hero-container-2 {
    background: #FFFFFF;
    border-radius: 16px;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    align-items: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.hero-content,
.hero-content-2 {
    padding: 50px 45px;
    color: #ffffff;
}

.hero-content h1 {
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
}

.hero-content-2 h1 {
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 25px;
    letter-spacing: -0.5px;
    color: #175427;
}

.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 35px;
    opacity: 0.85;
    max-width: 520px;
}

.hero-subtitle-2 {
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 35px;
    opacity: 0.85;
    max-width: 520px;
    color: #175427;
}

.hero-advantages,
.hero-advantages-2 {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.hero-advantages li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
}

.hero-advantages-2 li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: #175427;
}

/* Иконки галочек через PNG */


.btn-test {
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 16px 48px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn-test-2 {
    background-color: #175427;
    color: #FFFFFF;
    border: none;
    padding: 16px 48px;
    border-radius: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-test-2:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* Блок изображения */
.hero-image-wrapper {
    display: block; /* Убираем flex, чтобы обертка жестко следовала сетке грида */
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden; /* Обрезает картинку по скругленным краям баннера, если она вылезет */
}

/* Сама картинка внутри обертки */
.hero-image {
    width: 100%;       /* Растягиваем на 100% ширины дива */
    height: 100%;      /* Растягиваем на 100% высоты дива */
    display: block;
    object-fit: cover; /* Главное свойство: масштабирует фото заполняя весь див без деформации */
    object-position: center; /* Центрирует изображение внутри блока */
}

/* Основной контейнер секции — совпадает по ширине со всеми вашими блоками */
.features-section {
    width: 60%;
    margin: 60px auto; /* Центрируем и делаем красивые отступы сверху/снизу */
    padding: 0 20px;
    box-sizing: border-box;
}

/* Стили главного заголовка */
.features-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #175427; /* Темно-зеленый цвет из вашего макета */
    text-align: center;
    margin-bottom: 45px;
    letter-spacing: -0.5px;
}

/* Сетка для 4-х колонок */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Ровно 4 одинаковые колонки */
    gap: 30px; /* Отступы между колонками */
}

/* Отдельная карточка */
.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрируем иконку и текст внутри колонки */
    text-align: center;
}

/* Обертка для картинок, чтобы они были одинакового размера */
.feature-icon-wrap {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Сами 3D иконки */
.feature-icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Текст под иконками */
.feature-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333333;
}

/* Жирные заголовки внутри текста */
.feature-text strong {
    display: block; /* Переносит описание на новую строчку, как на вашем скрине */
    margin-bottom: 5px;
    color: #175427; /* Делаем акцентные слова темно-зелеными */
}

/* Основной контейнер — строго 60% ширины, как и прошлые блоки */
.service-section {
    width: 60%;
    margin: 60px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Заголовок секции */
.service-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #175427;
    text-align: center;
    margin-bottom: 45px;
    letter-spacing: -0.5px;
}

/* Сетка для разделения на левую карточку и правые элементы */
.service-container {
    display: grid;
    grid-template-columns: 680px max-content; 
    gap: 20px;               
    justify-content: center; 
    align-items: center;
}

/* 2. Левая карточка теперь не будет раздуваться */
.info-card {
    background: #F4FBF6;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(23, 84, 39, 0.04);
    width: 100%;             /* Занимает все выделенные ей 550px */
}

.info-card-body {
    padding: 35px;
}

.doc-notice {
    font-size: 1.05rem;
    color: #333333;
    margin-bottom: 25px;
}

/* Строка с паспортом */
.passport-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 35px;
}

.passport-icon {
    width: 36px;
    height: 36px;
    background-color: #60CF71; /* Фирменный зеленый */
    border-radius: 8px;
    display: inline-block;
    position: relative;
}

/* Простая геометрическая иконка паспорта/документа внутри */
.passport-icon::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 18px;
    border: 2px solid #ffffff;
    border-radius: 3px;
    top: 7px;
    left: 9px;
}

.passport-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #175427;
}

/* Блок "Нам не нужны" */
.no-needed-title {
    font-size: 1rem;
    font-weight: 700;
    color: #175427;
    margin-bottom: 15px;
}

/* 2. Даем белым плашкам возможность красиво растянуться по всей новой ширине */
.tags-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%; /* Растягивает контейнер с тегами на всю ширину карточки */
}

.tag-item {
    background: #ffffff;
    padding: 10px 14px; /* Немного увеличили внутренние отступы для солидности */
    border-radius: 8px;
    font-size: 0.85rem;
    color: #4BB45C;
    border: 1px solid rgba(75, 180, 92, 0.2);
    display: flex;
    align-items: center;
    justify-content: center; 
    gap: 6px;
    white-space: nowrap; 
}


/* Добавляем маленький крестик перед тегами */
.tag-item::before {
    content: '×';
    color: #FF5C5C;
    font-size: 1.1rem;
    font-weight: bold;
}

/* Нижняя плашка левой карточки */
.info-card-footer {
    background: #6FEA83; /* Light green */
    padding: 20px;
    text-align: center;
}

.footer-btn-text {
    background: #ffffff;
    color: #175427;
    padding: 14px 0;
    border-radius: 8px;
    font-weight: 700;
    display: block;
    width: 100%;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    
    /* Добавляем эти три строчки для корректного сброса стилей кнопки */
    border: none;
    cursor: pointer;
    outline: none;
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s; /* Включаем плавную анимацию */
}

/* Эффект при наведении (кнопка чуть темнеет и приподнимается) */
.footer-btn-text:hover {
    background-color: #f5f5f5; /* Делаем белый фон слегка сероватым/затемненным */
    transform: translateY(-2px); /* Кнопка приподнимается вверх на 2 пикселя */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1); /* Тень становится чуть глубже */
}

/* Эффект при клике (кнопка слегка вдавливается) */
.footer-btn-text:active {
    transform: translateY(0); /* Возвращается на место */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Правый блок */
.action-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    width: 100%;
    max-width: 100%;        /* Ограничиваем ширину кнопки и таймера */
}

.timer-wrap {
    text-align: center;
}

.timer-value {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: #175427;
    line-height: 1.1;
}

.timer-label {
    font-size: 1.1rem;
    color: #4BB45C;
}

/* Большая зеленая кнопка */
.btn-submit-request {
    background-color: #60CF71; /* Основной зеленый */
    color: #ffffff;
    border: none;
    width: 100%;
    max-width: 320px;
    padding: 18px 0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(96, 207, 113, 0.25);
    transition: transform 0.2s, background-color 0.2s;
}

.btn-submit-request:hover {
    background-color: #4BB45C;
    transform: translateY(-2px);
}

/* Основной контейнер — строго 60% ширины */
.steps-section {
    width: 60%;
    max-width: 1020px; /* Принудительно ограничиваем ширину под размер верхнего блока */
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* 2. Делаем сетку шагов на всю доступную ширину */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 равные колонки */
    gap: 30px; /* Расстояние между шагами */
    width: 100%;
}

/* 3. Распределяем место внутри каждого шага */
.step-item {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%; /* Чтобы элементы тянулись по сетке */
}

.steps-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #175427; /* Darkest green */
    text-align: center;
    margin-bottom: 45px;
}

.step-icon-wrap {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.step-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Надпись ШАГ 1, ШАГ 2 */
.step-number {
    font-size: 0.8rem;
    font-weight: 700;
    color: #4BB45C; /* Dark green */
    letter-spacing: 1px;
}

.step-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333333;
    line-height: 1.3;
}

/* Настройки внешнего контейнера по ширине ваших блоков */
.viber-cta-section {
    width: 60%;
    max-width: 1020px; /* Строго под размер прошлых блоков */
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.viber-cta-container {
    border: 2px solid #6FEA83;
    border-radius: 20px;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between; /* Текст остаётся слева, а вся правая группа уходит вправо */
    align-items: center;
    background-color: #ffffff;
}

/* Новый класс, который соединяет иконку и кнопку */
.viber-right-group {
    display: flex;
    align-items: center;
    gap: 15px; /* Задаёт аккуратное фиксированное расстояние между иконкой и кнопкой */
}


/* Текст слева */
.viber-cta-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #175427; /* Darkest green */
    margin: 0;
}

/* Контейнер для Viber */
.viber-messenger-block {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Квадратная подложка для Viber как на макете */
.viber-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    transition: transform 0.2s;
    text-decoration: none;
}

.viber-link:hover {
    transform: scale(1.08);
}

/* Кнопка справа */
.viber-cta-btn {
    background-color: #60CF71; /* Фирменный Green */
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.viber-cta-btn:hover {
    background-color: #4BB45C; /* Dark green при наведении */
    transform: translateY(-1px);
}

.viber-icon-img-new {
    width: 44px;        /* Оптимальный размер иконки внутри квадрата */
    height: 44px;
    display: block;
    object-fit: contain; /* Защищает изображение от искажения пропорций */
}

/* Общий контейнер секции */
.reviews-section {
    width: 60%;
    max-width: 1020px; /* Идеально по ширине прошлых блоков */
    margin: 50px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Заголовок отзывов */
.reviews-title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #175427; /* Ваш самый темный зеленый */
    text-align: center;
    margin-bottom: 40px;
}

/* Сетка для 6 карточек (по 3 в ряд) */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

/* Стили карточки отзыва */
.review-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* Мягкая тень как на макете */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Выравнивает авторов строго по нижней линии */
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* Звездочки рейтинга */
.rating-stars {
    color: #4BB45C; /* Красивый золотой цвет звезд */
    font-size: 1.2rem;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

/* Стилизация для 4-х звезд (последняя звезда становится серой) */
.rating-stars.four-stars span {
    color: #E0E0E0;
}

/* Заголовок внутри отзыва */
.review-heading {
    font-size: 1.2rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 12px;
}

/* Текст самого отзыва */
.review-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555555;
    margin-bottom: 25px;
    flex-grow: 1; /* Позволяет карточкам с коротким текстом держать высоту длинных */
}

/* Блок автора внизу */
.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #F5F5F5;
    padding-top: 15px;
}

/* Аватарка */
.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px; /* Скругленные углы у фото, как на скрине */
    object-fit: cover;
    background-color: #E0E0E0; /* Заглушка, пока нет картинок */
}

/* Имя и город */
.author-info {
    font-size: 0.9rem;
    font-weight: 600;
    color: #777777;
}

/* Общая подложка футера на весь экран */
.site-footer {
    width: 100%;
    background-color: #ffffff;
    padding: 60px 0 40px 0;
    border-top: 1px solid #F0F5F1; /* Легкая эстетичная линия сверху футера */
}

/* Контейнер — строго 60% ширины, как и все остальные ваши блоки */
.footer-container {
    width: 60%;
    max-width: 1020px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: grid;
    /* Делим на две колонки: левая широкая для текста, правая компактная */
    grid-template-columns: 1.3fr 0.7fr; 
    gap: 60px;
}

/* Заголовки "Реквизиты" и "Контакты" */
.footer-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #175427; /* Ваш фирменный Darkest green */
    margin-bottom: 20px;
    margin-top: 0;
}

/* Мелкий текст реквизитов */
.footer-text {
    font-size: 0.8rem;
    line-height: 1.6;
    color: #777777; /* Серый цвет для второстепенного текста */
    text-align: justify; /* Ровные края текста как на картинке */
    margin: 0;
}

/* Правая колонка с контактами */
.footer-contacts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Номер телефона */
.footer-phone {
    font-size: 1.15rem;
    font-weight: 700;
    color: #333333;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    transition: color 0.2s ease;
}

.footer-phone:hover {
    color: #60CF71; /* Фирменный Green при наведении */
}

/* Маленькая иконка трубки на CSS */
.footer-phone-icon {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://w3.org' viewBox='0 0 24 24' fill='%23175427'%3E%3Cpath d='M20 15.5c-1.25 0-2.45-.2-3.57-.57a1.02 1.02 0 0 0-1.02.24l-2.2 2.2a15.04 15.04 0 0 1-6.59-6.59l2.2-2.21a1 1 0 0 0 .25-1A11.36 11.36 0 0 1 8.5 4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.5c0-.55-.45-1-1-1z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    display: inline-block;
}

/* Блок ссылок */
.footer-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Ссылки на политики */
.footer-link {
    font-size: 0.9rem;
    color: #555555;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #4BB45C; /* Dark green при наведении */
    text-decoration: underline;
}

.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #333; /* Темный фон */
  color: #fff;
  padding: 15px;
  display: none; /* Скрыта по умолчанию */
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  font-family: sans-serif;
  font-size: 14px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.cookie-banner p {
  margin: 0 20px 0 0;
}
.cookie-banner a {
  color: #0d7427;
  text-decoration: underline;
}

.cookie-btn {
  background: #4caf50; /* Зеленая кнопка */
  color: white;
  border: none;
  padding: 8px 20px;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
}

.cookie-btn:hover {
  background: #45a049;
}

/*МОДАЛЬНОЕ ОКНО*/
/* Затемняющий фон за модальным окном */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(23, 84, 39, 0.4); /* Полупрозрачный темно-зеленый */
    backdrop-filter: blur(4px); /* Легкое размытие заднего плана */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Класс, который делает окно видимым через JS */
.modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Само белое окно */
.modal-window {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 15px 40px rgba(23, 84, 39, 0.15);
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    box-sizing: border-box;
}

.modal-overlay.is-open .modal-window {
    transform: translateY(0);
}

/* Кнопка закрытия (крестик) */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #777777;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close-btn:hover {
    color: #175427;
}

/* Заголовки */
.modal-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #175427;
    text-align: center;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.modal-subtitle {
    font-size: 0.95rem;
    color: #666666;
    text-align: center;
    margin: 0 0 30px 0;
}

/* Форма и инпуты */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
    border-color: #60CF71;
    box-shadow: 0 0 0 3px rgba(96, 207, 113, 0.1);
}

/* Красная рамка при ошибке валидации */
.modal-input.has-error {
    border-color: #FF5C5C !important;
    background-color: #FFF8F8;
}

/* Текст ошибки */
.error-message {
    font-size: 0.75rem;
    color: #FF5C5C;
    margin-top: 5px;
    display: none;
}

.modal-input.has-error + .error-message,
.checkbox-group.has-error .error-message {
    display: block;
}

/* Чекбокс согласия */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #E0E0E0;
    border-radius: 5px;
    display: inline-block;
    flex-shrink: 0;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
}

.checkbox-label input:checked + .checkbox-custom {
    background-color: #60CF71;
    border-color: #60CF71;
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-size: 0.8rem;
    line-height: 1.4;
    color: #666666;
}

.checkbox-text a {
    color: #4BB45C;
    text-decoration: underline;
}

/* Главная зеленая кнопка */
.modal-submit-btn {
    background-color: #60CF71;
    color: #ffffff;
    border: none;
    padding: 16px 0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(96, 207, 113, 0.2);
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 10px;
}

.modal-submit-btn:hover {
    background-color: #4BB45C;
}

.modal-submit-btn:active {
    transform: scale(0.98);
}

/* Затемняющая подложка квиза */
.quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(23, 84, 39, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.quiz-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Окно анкеты */
.quiz-window {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 15px 40px rgba(23, 84, 39, 0.15);
    position: relative;
    box-sizing: border-box;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.quiz-overlay.is-open .quiz-window {
    transform: translateY(0);
}

.quiz-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

/* Управление показом шагов */
.quiz-step {
    display: none;
}

.quiz-step.active {
    display: block;
}

.quiz-question {
    font-size: 1.45rem;
    font-weight: 700;
    color: #175427;
    margin: 0 0 25px 0;
    line-height: 1.3;
}

/* Стилизация радио-кнопок выбора */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 30px;
}

.quiz-radio {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: #333333;
    cursor: pointer;
    user-select: none;
    padding: 6px 0;
}

.quiz-radio input {
    display: none;
}

.quiz-radio span {
    width: 20px;
    height: 20px;
    border: 2px solid #E0E0E0;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.quiz-radio input:checked + span {
    border-color: #60CF71;
}

.quiz-radio input:checked + span::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background-color: #60CF71;
    border-radius: 50%;
    top: 3px;
    left: 3px;
}

/* Контактная форма 5 шага */
.quiz-contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 25px;
}

.quiz-input-group {
    position: relative;
}

.quiz-contact-form input[type="text"],
.quiz-contact-form input[type="tel"] {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.quiz-contact-form input:focus {
    border-color: #60CF71;
}

.quiz-contact-form input.has-error {
    border-color: #FF5C5C !important;
    background-color: #FFF8F8;
}

.quiz-error {
    font-size: 0.75rem;
    color: #FF5C5C;
    margin-top: 5px;
    display: none;
}

.quiz-input-group.has-error .quiz-error,
.quiz-contact-form input.has-error + .quiz-error {
    display: block;
}

/* Чекбокс согласия в квизе */
.quiz-check-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.quiz-check-label input {
    display: none;
}

.quiz-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #E0E0E0;
    border-radius: 4px;
    display: inline-block;
    flex-shrink: 0;
    position: relative;
}

.quiz-check-label input:checked + .quiz-checkbox-custom {
    background-color: #60CF71;
    border-color: #60CF71;
}

.quiz-check-label input:checked + .quiz-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.quiz-check-text {
    font-size: 0.8rem;
    color: #666666;
    line-height: 1.4;
}

.quiz-check-text a {
    color: #4BB45C;
}

/* Навигационная панель футера */
.quiz-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #F5F5F5;
    padding-top: 20px;
}

.quiz-nav-link {
    background: none;
    border: none;
    color: #777777;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 10px 0;
    transition: color 0.2s;
}

.quiz-nav-link:hover {
    color: #175427;
}

.quiz-main-btn {
    background-color: #60CF71;
    color: #ffffff;
    border: none;
    padding: 14px 35px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(96, 207, 113, 0.2);
    transition: background-color 0.2s, transform 0.1s;
}

.quiz-main-btn:hover {
    background-color: #4BB45C;
}

/* Фоновая полупрозрачная подложка */
.thank-you-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Окно становится видимым */
.thank-you-modal.active {
    opacity: 1;
    pointer-events: auto;
}

/* Белая карточка внутри */
.thank-you-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.thank-you-modal.active .thank-you-content {
    transform: translateY(0);
}

/* Иконка галочки */
.success-icon {
    width: 70px;
    height: 70px;
    background-color: #60CF71;
    color: #ffffff;
    font-size: 2.2rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px auto;
}

.thank-you-content h2 {
    font-size: 1.6rem;
    color: #2c3e50;
    margin-bottom: 12px;
}

.thank-you-content p {
    color: #7f8c8d;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 25px;
}

/* Кнопка закрытия */
.thank-you-btn {
    background-color: #60CF71;
    color: white;
    border: none;
    padding: 12px 35px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.thank-you-btn:hover {
    background-color: #175427;
}


/* ==========================================================================
   ЕДИНЫЙ БЛОК АДАПТИВНОСТИ ДЛЯ МОБИЛЬНЫХ ЭКРАНОВ И ПЛАНШЕТОВ
   ========================================================================== */
@media (max-width: 768px) {
    
    /* 1. Общие настройки контейнеров и ширины страниц */
    .header-container,
    .hero-section,
    .hero-section-2,
    .features-section,
    .service-section,
    .steps-section,
    .viber-cta-section,
    .reviews-section,
    .site-footer .footer-container {
        width: 95%; /* Увеличиваем до 95%, чтобы максимально полезно использовать экран смартфона */
        max-width: 100%;
        padding: 0 15px;
    }

    /* 2. Шапка сайта */
    .header-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .phone-block {
        margin: 0 auto;
    }
    .spacer, .btn-consult {
        width: 100%; /* Кнопка консультации в шапке становится на всю ширину */
        max-width: 320px;
    }

    /* 3. Главные баннеры (Герои) */
    .hero-section,
    .hero-section-2 {
        height: auto; /* Убираем фиксированную высоту vh/px, чтобы контент не вылезал */
        min-height: auto;
    }
    .hero-container,
    .hero-container-2 {
        grid-template-columns: 1fr; /* Перестраиваем картинку и текст друг под друга */
    }
    /* Возвращаем правильный порядок элементов для отзеркаленного баннера на мобилках */
    .hero-container-2 {
        display: flex;
        flex-direction: column-reverse; /* Текст будет сверху, картинка снизу */
    }
    .hero-content,
    .hero-content-2 {
        padding: 30px 20px;
    }
    .hero-image-wrapper {
        margin-top: 15px;
        height: 250px; /* Ограничиваем высоту фото на мобилках */
    }
    .hero-image {
        max-height: 100%;
    }
    .hero-section-2 .hero-image {
        max-height: 250px;
        padding: 10px;
    }

    /* 4. Блок "Что вас ждет дальше" (Иконки преимуществ) */
    .features-grid {
        grid-template-columns: 1fr; /* Строго в один столбик на телефонах */
        gap: 35px;
    }
    .feature-item {
        text-align: center;
    }

    .btn-consult {
        display: none !important;
    }

    /* 5. Блок "Технологичный сервис" (Карточка + 15 минут) */
    .service-container {
        grid-template-columns: 1fr; /* Перестраиваем в один столбец */
        gap: 30px;
    }
    /* Сбрасываем жесткие 680px, которые мы задавали для больших экранов */
    .service-container {
        grid-template-columns: 1fr !important; 
    }
    .info-card {
        width: 100%;
    }
    /* Перестраиваем плашки "Кредитная история" в один столбик, чтобы текст не сжимался */
    .tags-row {
        grid-template-columns: 1fr; 
        gap: 10px;
    }
    .tag-item {
        white-space: normal; /* Разрешаем перенос длинного текста */
        text-align: center;
    }
    /* Блок с таймером центрируется */
    .action-block {
        justify-self: center; 
        margin: 0 auto;
    }

    /* 6. Блок "Простые шаги" */
    .steps-grid {
        grid-template-columns: 1fr; /* Шаги строго друг под другом */
        gap: 30px;
    }
    .step-item {
        flex-direction: column; /* Картинка шага теперь сверху, текст снизу */
        text-align: center;
        gap: 10px;
    }

    /* 7. Viber-плашка */
    .viber-cta-container {
        flex-direction: column; /* Складываем элементы вертикально */
        gap: 20px;
        text-align: center;
        padding: 30px 20px;
    }
    .viber-right-group {
        width: 100%;
        justify-content: center; /* Центрируем Viber и кнопку */
    }
    .viber-cta-btn {
        width: 100%;
        max-width: 280px;
    }

    /* 8. Блок отзывов */
    .reviews-grid {
        grid-template-columns: 1fr; /* Отзывы выстраиваются в одну ленту */
        gap: 20px;
    }
    .review-card {
        padding: 20px;
    }

    /* 9. Подвал сайта (Футер) */
    .footer-container {
        grid-template-columns: 1fr; /* Реквизиты сверху, контакты снизу */
        gap: 35px;
    }
    .footer-text {
        text-align: left;
    }
    .footer-contacts {
        align-items: center; /* Центрируем телефон и ссылки в мобильном футере */
        text-align: center;
    }
    .modal-window {
        padding: 30px 20px;
        max-width: 92%;
    }
    .modal-title {
        font-size: 1.4rem;
    }
    .quiz-window {
        padding: 30px 20px;
        max-width: 94%;
    }
    .quiz-question {
        font-size: 1.25rem;
    }
}
