/* --- 1. Глобальные переменные для цвета --- */
:root {
  --primary-color: #9B7BB8;    /* Основной акцент (кнопки, рамочки, детали) */
  --bg-color: #F1EDF7;         /* Общий фон сайта */
  --card-bg: #DED3EB;          /* Фон карточек и блоков */
  
  --heading-color: #30243A;     /* Все основные заголовки (H1, H2) */
  --subheading-color: #68477F;  /* Все подзаголовки (H3, H4, номера этапов, "Что изучаем") */
  --text-color: #332D3A;       /* Обычный основной текст */
  
  --hero-text-color: #4A4352;  /* Отдельный цвет текста для первого экрана (Hero) */
  --faq-title-color: #30243A;  /* Цвет вопросов в FAQ */
  --faq-text-color: #4A4352;   /* Цвет ответов в FAQ */

  --badge-bg-color: #F6EBFF;   /* Фон плашки "Занятия" */
  --badge-text-color: #68477F; /* Текст плашки "Занятия" */
}

/* --- 2. Базовые настройки --- */
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.6;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 60px 0;
}

/* Главные заголовки */
h1, h2 {
  color: var(--heading-color);
  margin-top: 0;
}

h2 {
  font-size: 32px;
  margin-bottom: 20px;
  text-align: center;
}

/* Подзаголовки */
h3, h4 {
  color: var(--subheading-color);
  margin-top: 0;
}

/* --- Кнопки --- */
.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 0.2s, opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

/* --- Плавный скролл для всего сайта --- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Отступ сверху, чтобы шапка не перекрывала заголовок блока */
}

/* --- Навигационная шапка (Header) --- */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: rgba(241, 237, 247, 0.95); /* Цвет фона сайта с лёгкой прозрачностью */
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 14px 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--heading-color);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: var(--primary-color);
}

.header-btn {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.header-btn:hover {
  opacity: 0.9;
}

/* --- Адаптивная шапка для смартфонов --- */
@media (max-width: 768px) {
  .header {
    padding: 10px 0;
  }

  .header-container {
    flex-direction: column;
    align-items: stretch; /* Растягиваем контейнер по всей ширине */
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
  }

  .header-top-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  /* Навигация строго в 1 линию с горизонтальной прокруткой */
  .nav {
    display: flex;
    flex-wrap: nowrap !important; /* Отключаем перенос на новую строку */
    width: 100%;
    min-width: 0; /* Обязательно для работы overflow во flex-контейнерах */
    overflow-x: auto;
    white-space: nowrap;
    gap: 16px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Скрываем полосу скролла в Firefox */
  }

  .nav::-webkit-scrollbar {
    display: none; /* Скрываем полосу скролла в Chrome/Safari */
  }

  .nav a {
    font-size: 13.5px;
    flex-shrink: 0; /* Запрещаем сжимать текст ссылок */
  }

  .header-btn {
    padding: 6px 14px;
    font-size: 13px;
  }
}

/* --- Первый экран (Hero) --- */
.hero {
  background-color: var(--card-bg);
}

.hero-container {
  display: flex;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1;
  min-width: 300px;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.2;
}

.subtitle {
  color: var(--subheading-color);
  font-weight: 600;
  font-size: 20px;
}

.description {
  font-size: 18px;
  color: var(--hero-text-color);
  margin-bottom: 30px;
}

/* Контейнер для фото в первом блоке */
.hero-image-container {
  flex: 1;
  min-width: 300px;
  max-width: 500px;
}

/* Сама картинка */
.hero-img {
  width: 100%;
  height: 320px;
  object-fit: cover; /* Картинка заполнит блок без искажения пропорций */
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); /* Мягкая тень */
  display: block;
}

/* --- Галерея (Работы учеников) --- */
.section-desc {
  text-align: center;
  color: var(--text-color);
  max-width: 600px;
  margin: 0 auto 30px auto;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.gallery-item {
  height: 180px;
  background-color: #cbd5e1;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 15px;
  color: #475569;
  font-size: 14px;
}

.gallery-item.main-item {
  background-color: #94a3b8;
  color: #ffffff;
}

.gallery-note {
  font-size: 13px;
  color: #94a3b8;
  margin-top: 15px;
  text-align: center;
}

/* --- Формат занятий --- */
.cards-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background-color: var(--card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
}

.card h3 {
  color: var(--subheading-color);
  font-size: 20px;
}

.card p {
  margin: 0;
  color: var(--text-color);
}

/* --- Подход к обучению --- */
.approach-box {
  background-color: var(--card-bg);
  border-left: 5px solid var(--primary-color);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.approach-box h2 {
  text-align: left;
}

/* --- Путь ученика --- */
.path-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.step-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.step-card.highlight-step {
  border: 2px solid var(--primary-color);
  background-color: #E8DFEE;
}

.step-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--subheading-color);
  display: block;
  margin-bottom: 10px;
}

/* --- Программа курса --- */
.program-subtitle {
  text-align: center;
  color: var(--subheading-color);
  font-weight: 600;
  margin-bottom: 40px;
}

.program-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.program-stage {
  background-color: var(--card-bg);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
}

.stage-header h3 {
  margin-bottom: 5px; /* Небольшой отступ от заголовка до плашки */
}

.stage-header .badge {
  display: inline-block; /* Делаем блочным элементом, чтобы она встала на свою строку */
  margin-bottom: -10px;   /* Отступ от плашки до описания этапа */
  background-color: var(--badge-bg-color);
  color: var(--badge-text-color);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: normal;
  margin-left: -5px;        Убираем старый отступ слева, так как она теперь под заголовком */
}

.badge.gold {
  background-color: #fef08a;
  color: #854d0e;
}

details {
  margin-top: 15px;
  cursor: pointer;
}

summary {
  color: var(--subheading-color);
  font-weight: 600;
  cursor: pointer;
}

.details-content {
  margin-top: 10px;
  padding-left: 20px;
  color: var(--text-color);
}

.optional-item {
  margin-top: 8px;
  padding-top: 8px;
}

/* Сетка отзывов */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

/* Карточка отзыва */
.review-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.review-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

/* Шапка карточки со звёздами и кавычкой */
.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.review-stars {
  color: #ffb800; /* Золотистый цвет звёзд */
  font-size: 16px;
  letter-spacing: 2px;
}

.quote-icon {
  font-size: 36px;
  line-height: 1;
  color: var(--primary-color);
  opacity: 0.3;
  font-family: Georgia, serif;
  font-weight: bold;
}

/* Текст отзыва */
.review-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 24px;
  flex-grow: 1;
}

/* Подвал карточки (Автор) */
.review-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Круглая плашка с первой буквой имени */
.author-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: var(--badge-bg-color);
  color: var(--badge-text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--heading-color);
}

.author-role {
  font-size: 12.5px;
  color: var(--subheading-color);
  margin-top: 2px;
}

/* --- О преподавателе --- */
.teacher-container {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
}

.teacher-photo {
  width: 100%;
  max-width: 360px;
  height: auto; /* Автоматическая высота — картинка никогда не обрежется */
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: block;
  object-fit: unset;
}

.teacher-info {
  flex: 2;
  min-width: 280px;
}

.teacher-info h2 {
  text-align: left;
}

/* Мобильная версия */
@media (max-width: 768px) {
  .teacher-container {
    flex-direction: column;
    align-items: center;
    text-align: left;
  }
  
  .teacher-photo {
    width: 100%;
    max-width: 100%; /* На весь экран телефона, но с сохранением пропорций */
    height: auto;
  }
}

/* --- Стоимость --- */
.price-card, .pricing .price-card {
  background-color: var(--card-bg);
  max-width: 450px;
  margin: 0 auto;
  padding: 35px;
  border-radius: 20px;
  border: 2px solid var(--primary-color);
  text-align: center;
}

.price {
  font-size: 38px;
  font-weight: 800;
  color: var(--heading-color);
  margin: 15px 0;
}

.price .duration {
  font-size: 16px;
  color: var(--text-color);
  font-weight: normal;
}

.price-card ul {
  text-align: left;
  margin-bottom: 25px;
  color: var(--text-color);
}

/* --- Технические требования --- */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.tech-card {
  background-color: var(--card-bg);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
}

/* --- FAQ --- */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 16px 20px;
  border: 1px solid #e2e8f0;
}

.faq-item summary {
  color: var(--faq-title-color);
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease;
}

.faq-item summary:hover {
  color: var(--primary-color);
}

.faq-answer {
  margin-top: 10px;
  color: var(--faq-text-color);
}

/* --- Финальный CTA --- */
.cta-section {
  background-color: var(--cta-bg-color, #1e293b);
  color: var(--cta-text-color, #FFFFFF);
  text-align: center;
}

.cta-section h2 {
  color: var(--cta-text-color, #FFFFFF);
}

.cta-section p {
  max-width: 600px;
  margin: 0 auto 0px auto;
  color: var(--cta-text-color, #FFFFFF);
  opacity: 0.85;
}
.cta-email-note {
  margin-top: 20px;
  font-size: 14px;
  color: var(--cta-text-color, #ffffff);
  opacity: 0.8;
}
.cta-email-note a {
  color: var(--cta-text-color, #ffffff);
  text-decoration: underline;
  font-weight: 600;
  transition: opacity 0.2s ease;
}
.cta-email-note a:hover {
  opacity: 1;
}

/* --- Подвал --- */
.footer {
  background-color: #0f172a;
  color: #64748b;
  padding: 30px 0;
  font-size: 14px;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-title {
  color: #f8fafc;
  font-weight: 600;
  margin: 0;
}

.footer-sub {
  margin: 0;
}

/* Блок ссылок подвала */
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-link {
  color: #94a3b8;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #ffffff;
}

.footer-divider {
  color: #475569;
  user-select: none;
}

/* --- Просмотр картинок (Lightbox) --- */
.zoomable-img {
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.zoomable-img:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.lightbox {
  display: none;
  position: fixed;
  z-index: 10000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.9); /* Тёмная полупрозрачная подложка */
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.lightbox-close:hover {
  color: var(--primary-color, #9b7bb8);
}

/* --- Карусель галереи --- */
.gallery-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.gallery-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 10px 5px 20px 5px;
  -webkit-overflow-scrolling: touch;
}

/* Скрываем полосу прокрутки для чистоты дизайна */
.gallery-carousel::-webkit-scrollbar {
  display: none;
}
.gallery-carousel {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Карточка в карусели */
.gallery-card {
  flex: 0 0 280px; /* Ширина одной карточки */
  scroll-snap-align: start;
  background-color: var(--card-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
}

.gallery-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

/* Описание под картинкой в карточке */
.gallery-card-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gallery-card-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--heading-color);
}

.gallery-card-author {
  font-size: 13px;
  color: var(--subheading-color);
}

/* Стрелки навигации */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--primary-color);
  color: #ffffff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s, transform 0.2s;
}

.carousel-btn:hover {
  opacity: 0.9;
  transform: translateY(-50%) scale(1.08);
}

.prev-btn { left: -15px; }
.next-btn { right: -15px; }

@media (max-width: 768px) {
  .carousel-btn {
    display: none; /* На телефонах стрелки скрываем, листая свайпом */
  }
}

/* --- Подпись во всплывающем окне (Lightbox) --- */
.lightbox-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90%;
}

.lightbox-caption {
  margin-top: 12px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 18px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* --- Карусель отзывов --- */
.reviews-carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 30px;
}

.reviews-carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 10px 5px 20px 5px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Скрываем скроллбар в Firefox */
}

.reviews-carousel::-webkit-scrollbar {
  display: none; /* Скрываем скроллбар в Chrome/Safari */
}

/* Изменения для карточки внутри карусели */
.reviews-carousel .review-card {
  flex: 0 0 calc(50% - 10px); /* Ровно 2 карточки на ширину экрана */
  scroll-snap-align: start;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .reviews-carousel .review-card {
    flex: 0 0 85vw; /* На мобильных оставляем 1 крупный отзыв (85% экрана) */
  }
}

/* --- Блок иконки-кнопки связи --- */
.cta-buttons-images {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 0px;
}

.svg-btn {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateZ(0); /* Включает аппаратное ускорение */
  transform: scale(1.2);
}

/* Принудительное математическое сглаживание для всех SVG внутри кнопок */
.svg-btn svg {
  display: block;
  overflow: visible; 
  width: 159px;
  height: auto;
  text-rendering: geometricPrecision;
}

/* Сдвигаем последнюю кнопку (Email) левее и выше */
.svg-btn:last-child {
  transform: scale(1.2) translate(-4px, -4px); /* -8px сдвигает влево, -4px поднимает вверх */
}

/* Плавная анимация при наведении */
.svg-btn:hover {
  transform: translateY(-4px) scale(1.24) translateZ(0);
}

.svg-btn:active {
  transform: translateY(-1px) translateZ(0);
}

/* Сохраняем сдвиг при наведении для последней кнопки */
.svg-btn:last-child:hover {
  transform: translateY(-4px) scale(1.24) translate(-4px, -4px) translateZ(0);
}

/* --- Интерактивный Email с копированием --- */
.copy-email-btn {
  position: relative;
  display: inline-block;
  color: var(--cta-text-color, #ffffff);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.copy-email-btn:hover {
  opacity: 0.85;
}