/* ====================== 1. ОБЩИЕ СТИЛИ ====================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  line-height: 1.6;
}

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

/* ====================== 2. ШАПКА ====================== */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #222;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.logo {
  font-size: 1.85rem;
  font-weight: bold;
  color: #f59e0b;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  gap: 32px;
}

.desktop-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.desktop-nav a:hover {
  color: #f59e0b;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.phone-block {
  text-align: right;
}

.phone-btn {
  background: #f59e0b;
  color: black;
  padding: 10px 22px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: background 0.3s;
}

.phone-btn:hover {
  background: #d97706;
}

.schedule {
  font-size: 0.87rem;
  color: #aaa;
  margin-top: 4px;
}

.menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.95rem;
  cursor: pointer;
  padding: 8px 12px;
  display: none;
}

/* ====================== 3. МОБИЛЬНОЕ МЕНЮ ====================== */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #111;
  padding: 25px 20px;
  border-top: 1px solid #333;
  z-index: 999;
}

.mobile-menu:not(.hidden) {
  display: block;
}

.mobile-menu.hidden {
  display: none;
}

.mobile-menu a,
.mobile-menu .messenger-btn {
  display: block;
  color: white;
  text-decoration: none;
  padding: 14px 0;
  font-size: 1.25rem;
  transition: color 0.3s;
}

/* ====================== 4. HERO ====================== */
.hero {
  min-height: calc(100vh - 80px);
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  padding-top: 80px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.hero-content h1 {
  font-size: 3.6rem;
  margin-bottom: 12px;
  color: #f59e0b;
}

.hero-content h2 {
  font-size: 2.85rem;
  margin-bottom: 20px;
}

.hero-content p {
  font-size: 1.45rem;
  margin-bottom: 32px;
  opacity: 0.9;
}

.hero-buttons {
  display: flex;
  flex-direction: row;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

/* ====================== 5. КНОПКИ ====================== */
.btn {
  padding: 15px 32px;
  border-radius: 50px;
  font-size: 1.12rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 400px;           /* базовая ширина */
  justify-content: center;
  transition: all 0.3s;
}

.btn.primary {
  background: #f59e0b;
  color: black;
}

.btn.primary:hover {
  background: #d97706;
}

.btn.outline {
  border: 2px solid white;
  color: white;
}

.btn.outline:hover {
  background: white;
  color: black;
}

/* ====================== 6. СЕКЦИИ ====================== */
.section {
  padding: 90px 0;
}

.section h2 {
  font-size: 2.6rem;
  text-align: center;
  margin-bottom: 55px;
}

/* Услуги */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 28px;
  margin-top: 50px;
}

.service-card {
  background: #1a1a1a;
  padding: 40px 30px;
  border-radius: 24px;
  text-align: center;
  transition: all 0.4s ease;
  height: 100%;                    /* выравнивает высоту карточек */
}

.service-card:hover {
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.25);
}

.service-card i {
  font-size: 3.8rem;
  color: #f59e0b;
  margin-bottom: 24px;
  display: block;
}

.service-card h3 {
  font-size: 1.55rem;
  margin-bottom: 16px;
  color: #ffffff;
}

.service-card p {
  color: #ccc;
  line-height: 1.5;
  font-size: 1.02rem;
}

/* Почему выбирают нас */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.stat-item {
  background: #1a1a1a;
  padding: 40px 20px;
  border-radius: 20px;
  text-align: center;
}

.stat-number {
  font-size: 4rem;
  font-weight: bold;
  color: #f59e0b;
  margin-bottom: 10px;
}

/* Контакты */
.contacts-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  font-size: 1.25rem;
}

.contacts-list a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: color 0.3s;
}

.contacts-list a:hover {
  color: #f59e0b;
}

.contacts-list i {
  font-size: 2.1rem;
}

/* Футер */
footer {
  padding: 45px 0;
  background: #0a0a0a;
  text-align: center;
  border-top: 1px solid #222;
}

/* ====================== 7. КРАСИВОЕ ПОРТФОЛИО ====================== */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.portfolio-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-card:hover {
  transform: translateY(-12px) scale(1.03);
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.25);
}

.portfolio-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 16 / 10;
  transition: transform 0.6s ease;
}

.portfolio-card:hover img {
  transform: scale(1.08);
}

.card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(10, 10, 10, 0.9));
  padding: 32px 20px 22px;
  color: white;
  font-size: 1.12rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portfolio-card:hover .card-overlay {
  opacity: 1;
}

/* ====================== 8. КОНТАКТЫ + ФОРМА ====================== */
.contacts-section {
  background: #0f0f0f;
  padding: 110px 0;
}

.contacts-section h2 {
  text-align: center;
  margin-bottom: 80px;
  font-size: 2.65rem;
}

.contacts-form-wrapper {
  display: flex;
  gap: 100px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 30px;
}

.contacts-block {
  flex: 0.95;
  min-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.form-block {
  flex: 1.25;
}

.contacts-block h3,
.form-block h3 {
  color: #f59e0b;
  margin-bottom: 38px;
  font-size: 1.78rem;
  text-align: center;
}

/* Контакты */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  align-items: center;
  max-width: 510px;
}

.contact-link,
.messenger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 34px;
  border-radius: 50px;
  font-size: 1.14rem;
  font-weight: 500;
  text-decoration: none;
  border: 2px solid;
  width: 100%;
  max-width: 590px;           /* твоя настройка */
  transition: all 0.3s;
  white-space: nowrap;
}

.contact-link.phone { border-color: #555; color: #ddd; }
.contact-link.phone:hover { border-color: #f59e0b; color: #f59e0b; }

.contact-link.email { border-color: #555; color: #ddd; }
.contact-link.email:hover { border-color: #f59e0b; color: #f59e0b; }

.telegram-btn { border-color: #229ed9; color: #229ed9; }
.telegram-btn:hover { background: #229ed9; color: white; }

.max-btn {
  border: 2px solid transparent;
  background: linear-gradient(135deg, #6b4eff, #3b82f6);
  color: white;
}

.max-btn:hover {
  background: linear-gradient(135deg, #5a3de6, #2563eb);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(107, 78, 255, 0.35);
}

/* Текст под контактами */
.schedule-info {
  margin-top: 32px;
  text-align: center;
  line-height: 1.6;
}

.schedule-info p {
  font-size: 1.08rem;
  color: #ffffff;
  margin-bottom: 6px;
}

/* ====================== 9. ФОРМА ====================== */
.contact-form {
  background: #1a1a1a;
  padding: 50px 45px;
  border-radius: 28px;
  box-shadow: 0 15px 55px rgba(0, 0, 0, 0.5);
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 18px 24px;
  background: #111;
  border: 1px solid #555;
  border-radius: 14px;
  color: #ffffff;
  font-size: 1.06rem;
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-form button {
  width: 100%;
  padding: 18px;
  font-size: 1.22rem;
  margin-top: 15px;
}

/* ====================== 10. ЧЕКБОКС И МОДАЛЬНОЕ ОКНО ====================== */
.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 1rem;
  color: #ddd;
  margin: 28px 0 18px;
  cursor: pointer;
  line-height: 1.5;
}

.consent-label input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin-top: 3px;
  flex-shrink: 0;                    /* чекбокс не сжимается */
  accent-color: #f59e0b;
  cursor: pointer;
}

.consent-label span {
  flex: 1;                           /* текст занимает оставшееся место */
}

.consent-label a {
  color: #f59e0b;
  text-decoration: underline;
  white-space: nowrap;               /* ссылка не переносится внутри себя */
}

.consent-label a:hover {
  color: #ffcc5c;
}

/* Модальное окно */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #1a1a1a;
  max-width: 620px;
  width: 90%;
  padding: 40px 35px;
  border-radius: 20px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #aaa;
  cursor: pointer;
}

.modal-close:hover {
  color: white;
}

/* ====================== 11. АДАПТИВ ====================== */
/* 4K и выше (3840px+) */
@media (min-width: 3840px) {

  .container {
    max-width: 1720px;
    padding: 0 80px;
  }

  .hero-content h1 {
    font-size: 6.1rem;
  }

  .hero-content h2 {
    font-size: 4.5rem;
  }

  .hero-content p {
    font-size: 2rem;
  }

  .hero-buttons .btn {
    min-width: 520px;
    padding: 26px 60px;
    font-size: 1.42rem;
  }

  .section {
    padding: 170px 0;
  }

  .section h2 {
    font-size: 3.6rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax: 480px, 1fr);
    gap: 45px;
  }

  .contact-form {
    padding: 80px 75px;
  }
}

/* 2K мониторы (2560px) */
@media (min-width: 2560px) {

  .container {
    max-width: 1520px;
    padding: 0 60px;
  }

  /* Hero — увеличиваем текст и кнопки */
  .hero-content h1 {
    font-size: 5.2rem;
    margin-bottom: 16px;
  }

  .hero-content h2 {
    font-size: 3.85rem;
    margin-bottom: 24px;
  }

  .hero-content p {
    font-size: 1.75rem;
    max-width: 820px;
    margin: 0 auto 45px;
  }

  /* Кнопки в Hero */
  .hero-buttons .btn {
    min-width: 290px;
    padding: 22px 52px;
    font-size: 1.28rem;
    gap: 12px;
  }

  /* Общие секции */
  .section {
    padding: 140px 0;
  }

  .section h2 {
    font-size: 3.1rem;
    margin-bottom: 75px;
  }

  /* Услуги */
  .service-card {
    padding: 52px 36px;
  }

  .service-card h3 {
    font-size: 1.95rem;
  }

  /* Портфолио */
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 38px;
  }

  /* Контакты + Форма */
  .contacts-form-wrapper {
    gap: 130px;
  }

  .contact-form {
    padding: 65px 60px;
    border-radius: 32px;
  }

  .contact-form input,
  .contact-form textarea {
    padding: 22px 30px;
    font-size: 1.15rem;
  }

  .contact-form button {
    padding: 20px;
    font-size: 1.3rem;
  }
}

/* Планшеты и ниже */
@media (max-width: 992px) {
  .desktop-nav {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .phone-block {
    display: none;
  }

  .header-right {
    gap: 10px;
  }

  .contacts-form-wrapper {
    flex-direction: column;
    gap: 70px;
    padding: 0 24px;           /* защита от прилипания */
  }
}

/* Смартфоны */
@media (max-width: 768px) {
  .container {
    padding: 0 24px;           /* главное исправление — больше отступов от краёв */
  }

  .hero-content h1 { font-size: 2.55rem; }
  .hero-content h2 { font-size: 2.05rem; }
  .hero-content p { font-size: 1.18rem; }

  .btn {
    min-width: 70%;
    padding: 16px 24px;
    font-size: 1.1rem;
  }

  .section {
    padding: 65px 0;
  }

  .section h2 {
    font-size: 2.15rem;
    margin-bottom: 45px;
  }

  .mobile-menu {
    padding: 30px 20px;
  }

  .mobile-menu a,
  .mobile-menu .messenger-btn {
    font-size: 1.3rem;
    padding: 16px 0;
  }

  .contact-form {
    padding: 40px 24px;
  }

  .contacts-form-wrapper {
    padding: 0 24px;
  }
}

/* Очень маленькие экраны (исправление главной проблемы) */
@media (max-width: 520px) {
  .container {
    padding: 0 20px;           /* надёжный отступ от краёв */
  }

  .contacts-form-wrapper {
    padding: 0 20px;
  }

  .contact-form {
    padding: 35px 20px;
    border-radius: 24px;
  }

  .contact-form button {
    padding: 17px;
  }

  .hero-buttons {
    gap: 14px;
  }
}

/* Самые узкие экраны (iPhone SE и подобные) */
@media (max-width: 400px) {
  .container {
    padding: 0 16px;
  }

  .contact-form {
    padding: 32px 18px;
  }
}