/* ===========================
   Стили для лендинга юриста по семейному праву Елены Соколовой
   CSS с подробными комментариями
   Бренд-кит: цвета из ТЗ, типографика Montserrat + Open Sans
   Mobile-first: breakpoints 320/768/1024/1440px
   Визуальный стиль ориентирован на референс https://advokat-skv.ru/
=========================== */

/* === 1. БРЕНД-КИТ (CSS-переменные) === */
/* Определяем цветовую палитру согласно ТЗ */
:root {
  --color-primary: #1B3A5C;      /* Navy Trust - заголовки, футер, акценты */
  --color-bg-light: #F4F1EA;     /* Warm Sand - фон блоков, карточки */
  --color-secondary: #5D7692;    /* Slate Blue - подзаголовки, границы */
  --color-white: #FFFFFF;        /* фон формы, текст на тёмном */
  --color-accent: #C8A97E;       /* Muted Gold - CTA-кнопки, цифры, галочки */
}

/* === 2. СБРОС БАЗОВЫХ СТИЛЕЙ (RESET) === */
/* Обнуляем отступы и задаём box-sizing для всех элементов */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* === 3. БАЗОВЫЕ СТИЛИ === */
/* Плавная прокрутка при клике по якорям */
html {
  scroll-behavior: smooth;
}

/* Базовые стили для body */
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-primary);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Стили для заголовков (Montserrat) */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
}

/* Стили для изображений */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Стили для ссылок */
a {
  color: inherit;
  text-decoration: none;
}

/* === 4. ОБЩИЕ КЛАССЫ === */
/* Контейнер для центрирования контента */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Заголовки секций */
.section-title {
  font-size: 24px;
  margin-bottom: 32px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-primary);
}

/* === 4.5. ШАПКА САЙТА (НАВИГАЦИЯ) === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-primary);
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.15);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--color-white);
}

.site-header__logo-img {
  height: 40px;
  width: auto;
  max-width: 72px;
  object-fit: contain;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.08);
}

.site-header__logo-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 16px;
  color: var(--color-white);
}

/* Бургер-кнопка (показывается только на мобильных) */
.site-header__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.site-header__burger-line {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-white);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.site-header__burger:hover .site-header__burger-line {
  background-color: var(--color-accent);
}

.site-header__burger:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Анимация бургера в «крестик» при открытом меню */
.site-header__burger.active .site-header__burger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header__burger.active .site-header__burger-line:nth-child(2) {
  opacity: 0;
}

.site-header__burger.active .site-header__burger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Мобильное меню: выпадающий список под шапкой */
.site-header__nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-primary);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.site-header__nav.open {
  max-height: 420px;
}

.site-header__menu {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 8px 16px 16px;
}

.site-header__link {
  display: block;
  padding: 12px 4px;
  color: var(--color-white);
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  transition: color 0.2s ease;
}

.site-header__link:hover,
.site-header__link:focus {
  color: var(--color-accent);
}

/* Отступ при переходе по якорям, чтобы заголовок не уходил под липкую шапку */
.hero,
.services,
.steps,
.reviews,
.faq,
.form-section {
  scroll-margin-top: 72px;
}

/* === 5. БЛОК 1: HERO === */
/* Основной блок с фото юриста */
.hero {
  position: relative;
  padding: 60px 0;
  background: linear-gradient(rgba(27, 58, 92, 0.85), rgba(27, 58, 92, 0.85)),
              url('../fon.png') center/cover no-repeat;
  color: var(--color-white);
}

.hero__container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

.hero__content {
  width: 100%;
  text-align: center;
}

.hero__title {
  font-size: 28px;
  margin-bottom: 16px;
  color: var(--color-white);
}

.hero__subtitle {
  font-size: 16px;
  margin-bottom: 24px;
  color: var(--color-white);
  opacity: 0.95;
}

.hero__btn {
  display: inline-block;
  padding: 14px 32px;
  background-color: var(--color-accent);
  color: var(--color-primary);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 16px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(200, 169, 126, 0.3);
  transition: opacity 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.hero__btn:hover,
.hero__btn:focus {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(200, 169, 126, 0.4);
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.hero__btn:active {
  transform: translateY(0);
}

.hero__photo-wrap {
  width: 100%;
  max-width: 320px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__photo {
  width: 100%;
  height: auto;
  /* ТЗ: фото юриста — placeholder 3:4 (портрет) */
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.3);
  object-fit: cover;
}

/* === 6. БЛОК 2: УСЛУГИ И ЦЕНЫ === */
.services {
  padding: 60px 0;
  background-color: var(--color-white);
}

.services__table-wrap {
  display: none;
  overflow-x: auto;
  margin-bottom: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.08);
}

.services__table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.services__table thead {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.services__table th,
.services__table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(93, 118, 146, 0.2);
  font-size: 14px;
  vertical-align: top;
}

.services__table th {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.services__table tbody tr:nth-child(even) {
  background-color: var(--color-bg-light);
}

.services__table tbody tr:hover {
  background-color: rgba(200, 169, 126, 0.12);
}

.services__table tbody tr:last-child td {
  border-bottom: none;
}

.services__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.service-card {
  padding: 16px;
  background-color: var(--color-bg-light);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.08);
  border: 1px solid rgba(93, 118, 146, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(27, 58, 92, 0.12);
}

.service-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--color-primary);
}

.service-card p {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--color-primary);
}

/* === 7. БЛОК 3: ЭТАПЫ РАБОТЫ === */
.steps {
  padding: 60px 0;
  background-color: var(--color-bg-light);
}

.steps__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  list-style: none;
}

.step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 0 1 100%;
  padding: 16px;
  background-color: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.08);
}

.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: var(--color-primary);
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.step__text {
  font-size: 14px;
  color: var(--color-primary);
  flex: 1;
}

/* === 8. БЛОК 4: ОТЗЫВЫ === */
.reviews {
  padding: 60px 0;
  background-color: var(--color-white);
}

.reviews__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.review-card {
  flex: 0 1 100%;
  padding: 16px;
  background-color: var(--color-bg-light);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.08);
  border: 1px solid rgba(93, 118, 146, 0.2);
}

.review-card__name {
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--color-primary);
}

.review-card__text {
  font-size: 14px;
  color: var(--color-primary);
  line-height: 1.5;
  font-style: italic;
}

/* === 9. БЛОК 5: FAQ === */
.faq {
  padding: 60px 0;
  background-color: var(--color-bg-light);
}

.faq__list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq__item {
  background-color: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.08);
  overflow: hidden;
}

.faq__question {
  width: 100%;
  padding: 14px 16px;
  background-color: var(--color-white);
  border: none;
  color: var(--color-primary);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.2s ease;
}

.faq__question:hover,
.faq__question:focus {
  background-color: rgba(200, 169, 126, 0.12);
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.faq__question::after {
  content: '+';
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
  margin-left: 12px;
  transition: transform 0.3s ease;
}

.faq__question.active::after {
  content: '-';
  transform: rotate(180deg);
}

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  background-color: var(--color-white);
}

.faq__answer.active {
  max-height: 300px;
  padding: 0 16px 14px 16px;
}

.faq__answer p {
  font-size: 14px;
  color: var(--color-primary);
  line-height: 1.5;
}

/* === 10. БЛОК 6: ФОРМА ЗАЯВКИ === */
.form-section {
  padding: 60px 0;
  background-color: var(--color-white);
}

.form-section__subtitle {
  text-align: center;
  font-size: 16px;
  margin-bottom: 32px;
  color: var(--color-secondary);
}

.form-wrapper {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px;
  background-color: var(--color-white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(27, 58, 92, 0.08);
  border: 1px solid rgba(93, 118, 146, 0.2);
}

#yandex-form-container {
  min-height: 200px;
  width: 100%;
}

/* Адаптивность встроенной Яндекс Формы: iframe растягиваем по ширине контейнера,
   чтобы форма не выходила за пределы блока и не появлялась горизонтальная прокрутка */
#yandex-form-container iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 420px;
  border: 0;
}

/* === 11. БЛОК 7: ФУТЕР === */
.footer {
  padding: 32px 0;
  background-color: var(--color-primary);
  color: var(--color-white);
}

.footer__content {
  text-align: center;
}

.footer__top {
  margin-bottom: 16px;
}

.footer__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer__logo-img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 8px;
}

.footer__logo-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--color-white);
}

.footer__contacts p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
}

.footer__bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer__policy {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
}

.footer__policy:hover,
.footer__policy:focus {
  color: var(--color-accent);
}

.footer__copy {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

/* === 12. АДАПТИВНОСТЬ (MEDIA QUERIES) === */
/* Mobile-first. Breakpoints: 320/768/1024/1440px */

/* Планшеты: от 768px */
@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
  
  /* Шапка: обычное горизонтальное меню, бургер скрыт */
  .site-header__burger {
    display: none;
  }
  
  .site-header__nav {
    position: static;
    max-height: none;
    overflow: visible;
    background-color: transparent;
  }
  
  .site-header__menu {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 0;
  }
  
  .site-header__link {
    padding: 8px 0;
    border-bottom: none;
    font-size: 15px;
  }
  
  .hero {
    padding: 80px 0;
  }
  
  .hero__title {
    font-size: 34px;
  }
  
  .hero__subtitle {
    font-size: 17px;
  }
  
  .section-title {
    font-size: 28px;
    margin-bottom: 36px;
  }
  
  .services,
  .steps,
  .reviews,
  .faq,
  .form-section {
    padding: 70px 0;
  }
  
  .services__table th,
  .services__table td {
    padding: 14px 16px;
    font-size: 15px;
  }
  
  .services__table th {
    font-size: 14px;
  }
  
  .services__cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .steps__list,
  .reviews__grid {
    gap: 18px;
  }
  
  .step,
  .review-card {
    flex-basis: calc(50% - 9px);
  }
  
  .faq__question {
    font-size: 15px;
    padding: 16px 18px;
  }
  
  .form-wrapper {
    padding: 32px;
  }
  
  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* Десктоп: от 1024px */
@media (min-width: 1024px) {
  .hero {
    padding: 100px 0;
  }
  
  .hero__container {
    flex-direction: row;
    gap: 48px;
    align-items: center;
  }
  
  .hero__content {
    flex: 1;
    text-align: left;
  }
  
  .hero__photo-wrap {
    flex-shrink: 0;
    width: 380px;
    max-width: 45%;
  }
  
  .hero__title {
    font-size: 40px;
  }
  
  .hero__subtitle {
    font-size: 18px;
  }
  
  .services,
  .steps,
  .reviews,
  .faq,
  .form-section {
    padding: 80px 0;
  }
  
  /* На десктопе показываем таблицу, скрываем карточки */
  .services__cards {
    display: none;
  }
  
  .services__table-wrap {
    display: block;
  }
  
  .steps__list,
  .reviews__grid {
    gap: 20px;
  }
  
  .step,
  .review-card {
    flex-basis: calc(33.333% - 13.34px);
  }
  
  .step {
    padding: 18px;
  }
  
  .step__text {
    font-size: 15px;
  }
  
  .review-card {
    padding: 18px;
  }
  
  .review-card__text {
    font-size: 15px;
  }
}

/* Большие экраны: от 1440px */
@media (min-width: 1440px) {
  .container {
    padding: 0 32px;
  }
  
  .hero__title {
    font-size: 44px;
  }
  
  .section-title {
    font-size: 32px;
    margin-bottom: 40px;
  }
  
  .hero {
    padding: 120px 0;
  }
}