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

body {
  background: linear-gradient(135deg, #4b5563 0%, #374151 50%, #1f2937 100%);
  color: #f8fafc;
  font-family: system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  scroll-behavior: smooth;
}

.header-container {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.header-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/img/bg3.jpg');
  background-position: center;
  background-size: cover;
  z-index: 1;
  animation: scandi-animation 20s infinite ease-in-out;
}

.header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(55, 65, 81, 0.55), rgba(31, 41, 55, 0.88));
  z-index: 2;
}

.header-content-wrapper {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  width: 100%;
}

@keyframes scandi-animation {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.logo-title {
  text-transform: uppercase;
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
}

.logo-sub {
  color: #cbd5e1;
  font-size: 12px;
  display: block;
  margin-top: 4px;
}

.phone {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  display: block;
}

/* ИНТЕРАКТИВНЫЙ БЛОК КАЛЕНДАРЯ В ШАПКЕ */
.calendar-wrapper-top {
  position: relative;
  text-align: right;
}

.calendar-trigger-text {
  background: none;
  border: none;
  color: #34d399;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  outline: none;
  transition: color 0.2s;
}

.calendar-trigger-text:hover {
  color: #10b981;
}

.pulse-green-dot {
  width: 7px;
  height: 7px;
  background-color: #34d399;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

.calendar-dropdown-box {
  position: absolute;
  top: 110%;
  right: 0;
  width: 260px;
  background-color: #ffffff;
  color: #1e293b;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  text-align: center;
  z-index: 50;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.calendar-dropdown-box.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.calendar-month-name {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #0f172a;
  margin-bottom: 12px;
}

.calendar-week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
}

.weekend-head {
  color: #fda4af;
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.calendar-day-cell {
  padding: 6px 0;
  border-radius: 6px;
  color: #64748b;
}

.day-green {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
  cursor: pointer;
}

.day-green:hover {
  background-color: #10b981;
  color: #ffffff;
}

.day-red {
  background-color: #fee2e2;
  color: #991b1b;
  cursor: not-allowed;
  text-decoration: line-through;
  opacity: 0.6;
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  margin-top: 14px;
  border-top: 1px solid #f1f5f1;
  padding-top: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.leg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.leg-dot.green {
  background-color: #10b981;
}

.leg-dot.red {
  background-color: #ef4444;
}

/* ЦЕНТРАЛЬНЫЙ БЛОК */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  padding: 0 20px;
  margin-top: -25px;
}

h1 {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 30px;
  color: #ffffff;
  margin-top: 60px;
}

.silver-text {
  background: linear-gradient(90deg, #e2e8f0, #ffffff, #94a3b8, #ffffff, #e2e8f0);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: silver-flow 6s linear infinite;
}

@keyframes silver-flow {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

.desc {
  color: #e2e8f0;
  font-size: 16px;
  max-width: 650px;
  margin: 0 auto 26px auto;
}

/* ГЕОМЕТРИЧЕСКИЙ КОНФИГУРАТОР */
.configurator-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  margin: 0 auto 12px auto;
  max-width: 660px;
  width: 100%;
}

.options-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

.action-row {
  display: flex;
  width: 100%;
}

.btn-gold {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  padding: 16px 0;
  border: none;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 16px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-gold:hover {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #9ca3af;
  color: #f8fafc;
  font-weight: 600;
  padding: 14px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  width: 100%;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #ffffff;
}

.btn-outline.btn-green-active {
  background-color: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.check-mark {
  font-weight: 900;
  display: none;
}

.btn-green-active .check-mark {
  display: inline-block;
  animation: scale-up 0.2s ease-out;
}

@keyframes scale-up {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

/* БАННЕР ПОД КНОПКОЙ РАСЧЕТА */
.badge-wrapper {
  min-height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.badge {
  display: inline-block;
  background-color: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 20px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0;
  transform: translateY(-5px);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.badge.badge-active {
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3), inset 0 0 8px rgba(255, 255, 255, 0.1);
}

/* ПЛАНКА СТАТИСТИКИ (ДЛЯ ПК) */
.bottom-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(31, 41, 55, 0.6);
  padding: 24px 0;
  width: 100%;
  margin-top: -35px;
}

.grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}

.stat-num {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 6px;
  color: #ffffff;
}

.stat-text {
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.4;
  padding: 0 10px;
}

/* КВИЗ */
.quiz-section {
  padding: 120px 20px;
}

.quiz-container {
  max-width: 700px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 50px;
  color: #0f172a;
}

.quiz-title {
  text-align: center;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 14px;
}

.quiz-subtitle {
  text-align: center;
  color: #475569;
  font-size: 16px;
  margin-bottom: 44px;
}

.form-group {
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  text-align: left;
}

.input-field, .select-field {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 16px;
  color: #0f172a;
  font-size: 16px;
  outline: none;
}

.btn-submit {
  background: #0f172a;
  color: #ffffff;
  font-weight: 700;
  width: 100%;
  font-size: 17px;
  padding: 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

.quiz-date-red {
  color: #ef4444 !important;
  font-weight: 800;
  transition: color 0.3s ease;
}

.quiz-date-green {
  color: #059669 !important;
  font-weight: 800;
}

/* =======================================================
   📱 СВЕРХТОЧНАЯ АДАПТИВНОСТЬ ДЛЯ ЛЮБЫХ СМАРТФОНОВ (МЕНЕЕ 768px)
   ======================================================= */
@media (max-width: 768px) {
  /* Сжимаем заголовок h1, чтобы не ломал фоновый ТВ */
  h1 {
    font-size: 26px !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
  }

  .desc {
    font-size: 13px !important;
    padding: 0 10px;
    margin-bottom: 20px !important;
  }

  /* Раздвигаем контейнер, чтобы контент не сжимался */
  .main-content {
    padding: 0 10px !important;
  }

  /* Перестраиваем три верхние кнопки опций вертикально друг под другом */
  .options-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .btn-outline {
    padding: 12px 10px !important;
    font-size: 13px !important;
    height: auto !important;
  }

  /* Делаем главную золотую кнопку удобной для нажатия пальцем */
  .btn-gold {
    padding: 14px 0 !important;
    font-size: 15px !important;
  }

  /* ЖЕЛЕЗОБЕТОННАЯ КОРРЕКЦИЯ НИЖНЕГО ПОЯСА ПРЕИМУЩЕСТВ: ПЛИТКА 2х2 */
  .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px 12px !important;
    padding: 0 10px !important;
  }

  .stat-num {
    font-size: 18px !important;
    margin-bottom: 2px !important;
  }

  .stat-text {
    font-size: 11px !important;
    padding: 0 !important;
    line-height: 1.3 !important;
  }

  .bottom-bar {
    padding: 16px 0 !important;
  }

  /* Адаптируем шапку: переносим город под логотип на смартфонах */
  .top-bar {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 15px 10px !important;
  }

  .calendar-wrapper-top {
    text-align: center !important;
  }

  /* Центрируем выпадающий календарь по центру экрана телефона */
  .calendar-dropdown-box {
    right: auto;
    left: 50%;
    transform: translate(-50%, -10px);
  }

  .calendar-dropdown-box.open {
    transform: translate(-50%, 0);
  }

  /* Сжимаем контейнер квиза для маленьких экранов */
  .quiz-section {
    padding: 40px 10px !important;
  }

  .quiz-container {
    padding: 24px 15px !important;
  }

  .quiz-title {
    font-size: 22px !important;
  }
}

/* ЖИВАЯ АНИМАЦИЯ ПЕРЕЛИВА ДЛЯ ФУНДАМЕНТА ЛОГОТИПА */
.top-bar svg rect {
  animation: neon-flow 6s linear infinite;
}

@keyframes neon-flow {
  0% {
    filter: hue-rotate(0deg) drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
  }
  50% {
    filter: hue-rotate(90deg) drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
  }
  100% {
    filter: hue-rotate(0deg) drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
  }
}

/* =======================================================
   💎 РОСКОШНОЕ ТЕМНОЕ ПОРТФОЛИО (ФИНАЛЬНАЯ ЧИСТАЯ ВЕРСИЯ)
   ======================================================= */
.portfolio-section {
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.6) 0%, #1f2937 100%);
  padding: 100px 20px;
  color: #f8fafc;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.portfolio-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
  color: #ffffff;
}

.section-subtitle {
  font-size: 16px;
  color: #cbd5e1;
  margin-bottom: 50px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  text-align: left;
}

/* Матовые темно-серые карточки с тонкой неоновой рамкой */
.portfolio-card {
  position: relative !important; /* Базовый якорь для позиционирования внутренних элементов */
  background: rgba(55, 65, 81, 0.4);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.portfolio-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Жесткая фиксация высоты слайдера картинок */
.portfolio-card .card-image-wrapper {
  position: relative !important;
  width: 100% !important;
  height: 240px !important;
  overflow: hidden !important;
  background-color: #374151;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.portfolio-card .swiper {
  width: 100% !important;
  height: 100% !important;
}

.portfolio-card .swiper-wrapper {
  display: flex !important;
  flex-direction: row !important;
  height: 100% !important;
}

.portfolio-card .swiper-slide {
  width: 100% !important;
  height: 100% !important;
  flex-shrink: 0 !important;
}

.portfolio-card .card-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  opacity: 0.8;
}

/* Метка формата квартиры */
.card-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  background: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 30px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
}

/* Текстовый контент под фото */
.card-content {
  padding: 24px;
}

.card-title {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 16px;
}

.card-meta {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.meta-item {
  font-size: 14px;
  color: #cbd5e1;
}

.meta-item strong {
  color: #34d399; /* Изумрудная подсветка характеристик */
  font-weight: 700;
}

/* Кнопка возврата к квизу */
.btn-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  border: 1px solid #9ca3af;
  padding: 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.btn-card:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #f8fafc;
  transform: translateY(-1px);
}

/* =======================================================
   💎 СТИЛЬНАЯ СТАТИЧНАЯ ГАЛЕРЕЯ (ЖЕЛЕЗОБЕТОННЫЙ ВАРИАНТ)
   ======================================================= */
.portfolio-section {
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.6) 0%, #1f2937 100%);
  padding: 80px 20px;
  color: #f8fafc;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.portfolio-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
  color: #ffffff;
}

.section-subtitle {
  font-size: 16px;
  color: #cbd5e1;
  margin-bottom: 44px;
}

/* Красивая сетка 2х2 для твоих фотографий */
.portfolio-grid-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.gallery-item {
  position: relative;
  height: 340px; /* Идеальная высота для демонстрации деталей */
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: #374151;
}

.gallery-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  opacity: 0.85;
  transition: all 0.4s ease;
}

/* Легкое увеличение фото при наведении мышки */
.gallery-item:hover img {
  transform: scale(1.03);
  opacity: 1;
}

/* Матовая плашка с описанием внизу каждого фото */
.gallery-desc {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0.4) 70%, rgba(15, 23, 42, 0) 100%);
  padding: 24px 20px 16px 20px;
  text-align: left;
  color: #34d399;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* Фирменная кнопка */
.btn-card {
  display: block;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
  border: 1px solid #9ca3af;
  padding: 16px 30px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-card:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #f8fafc;
  transform: translateY(-2px);
}

/* 📱 ПОЛНАЯ АДАПТИВНОСТЬ ПОД СМАРТФОНЫ (ГАЛЕРЕЯ ПОРТФОЛИО) */
@media (max-width: 768px) {
  .portfolio-grid-gallery {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* На смартфонах фото встают в одну удобную ленту */
  .gallery-item {
    height: 260px !important;
  }

  .section-title {
    font-size: 24px !important;
  }

  .gallery-desc {
    font-size: 12px !important;
    padding: 15px 12px !important;
  }
}

/* 🧠 УМНАЯ АДАПТИВНАЯ РОКИРОВКА РЕКЛАМЫ (ПК / МОБИЛКИ — НЕЗАВИСИМЫЙ БЛОК) */
@media (max-width: 1150px) {
  /* Полностью гасим громоздкие боковые колонны на смартфонах и планшетах */
  .side-banner-column {
    display: none !important;
  }

  /* Включаем аккуратный горизонтальный баннер под Квизом */
  .mobile-only-banner {
    display: block !important;
  }

  /* Убираем лишние отступы, чтобы Квиз на телефоне был на весь экран */
  .quiz-flexible-wrapper {
    padding: 0 10px !important;
    gap: 0 !important;
  }
}
