/* ============================================================
   МАСТЕР НА ДОМ — Таблица стилей (style.css)
   ============================================================ */

/* ---- Сброс и базовые настройки ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --orange: #E8620A;
  --orange-dark: #C44E00;
  --orange-light: #FFF3E0;
  --dark: #1A1A1A;
  --dark2: #2D2D2D;
  --grey: #6B7280;
  --light: #F9F7F4;
  --white: #FFFFFF;
  --tg: #2AABEE;
  --tg-dark: #1A8DC2;
  --font-head: 'Oswald', sans-serif;
  --font-body: 'PT Sans', sans-serif;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.07);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--light);
  line-height: 1.65;
  font-size: 17px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---- Контейнер (ограничение ширины) ---- */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Кнопки ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  border: none;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-align: center;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.btn--primary {
  background: var(--orange);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--orange-dark);
}

.btn--tg {
  background: var(--tg);
  color: var(--white);
}

.btn--tg:hover {
  background: var(--tg-dark);
}

.btn--full {
  width: 100%;
  justify-content: center;
  font-size: 18px;
  padding: 16px 28px;
}

/* ---- Заголовки секций ---- */
.section-title {
  font-family: var(--font-head);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.section-title--light {
  color: var(--white);
}

.section-sub {
  text-align: center;
  color: var(--grey);
  font-size: 17px;
  margin-bottom: 48px;
}

.section-sub--light {
  color: rgba(255,255,255,0.75);
}

/* ============================================================
   ШАПКА
   ============================================================ */
.header {
  background: var(--white);
  border-bottom: 2px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  padding-bottom: 12px;
  gap: 16px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header__logo-icon {
  font-size: 32px;
  line-height: 1;
}

.header__logo-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.header__logo-sub {
  font-size: 13px;
  color: var(--grey);
}

.header__contacts {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.header__phone {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
}

.header__phone i {
  color: var(--orange);
}

.header__tg {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--tg);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s;
}

.header__tg:hover {
  background: var(--tg-dark);
}

/* Бургер-кнопка (мобильные) */
.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.burger span {
  display: block;
  width: 26px;
  height: 3px;
  background: var(--dark);
  border-radius: 2px;
  transition: 0.3s;
}

/* Мобильное меню */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-top: 1px solid #eee;
  padding: 10px 20px 16px;
  gap: 4px;
}

.mobile-nav a {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  color: var(--dark);
}

.mobile-nav.open {
  display: flex;
}

/* ============================================================
   ГЕРОЙ (главный блок)
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 60%, #3D2B10 100%);
  color: var(--white);
  padding: 70px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero__bg-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.07;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: var(--orange);
  top: -150px;
  right: -100px;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: var(--orange);
  bottom: -100px;
  left: -50px;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero__title {
  font-family: var(--font-head);
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.hero__title span {
  color: var(--orange);
}

.hero__desc {
  font-size: 18px;
  color: rgba(255,255,255,0.82);
  margin-bottom: 32px;
  max-width: 520px;
  line-height: 1.7;
}

.hero__btns {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero__badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 7px 14px;
  border-radius: 30px;
  font-size: 14px;
  color: rgba(255,255,255,0.90);
}

.badge i {
  color: var(--orange);
}

.hero__image-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  backdrop-filter: blur(8px);
  min-width: 180px;
}

.hero__stat {
  text-align: center;
}

.hero__stat span {
  display: block;
  font-family: var(--font-head);
  font-size: 48px;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
}

.hero__stat {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
}

/* ============================================================
   УСЛУГИ
   ============================================================ */
.services {
  padding: 80px 0;
  background: var(--light);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid #eee;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.service-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.service-card h3 {
  font-family: var(--font-head);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.service-card p {
  font-size: 15px;
  color: var(--grey);
  line-height: 1.6;
}

/* ============================================================
   ПОЧЕМУ МЫ
   ============================================================ */
.why {
  background: linear-gradient(135deg, var(--orange-dark) 0%, var(--orange) 100%);
  color: var(--white);
  padding: 80px 0;
}

.why__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.why-card {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: var(--radius);
  padding: 28px 22px;
  transition: background 0.2s;
}

.why-card:hover {
  background: rgba(255,255,255,0.18);
}

.why-card__num {
  font-family: var(--font-head);
  font-size: 42px;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
  line-height: 1;
  margin-bottom: 12px;
}

.why-card h3 {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}

.why-card p {
  font-size: 15px;
  color: rgba(255,255,255,0.80);
  line-height: 1.6;
}

/* ============================================================
   КАК РАБОТАЕМ
   ============================================================ */
.how {
  padding: 80px 0;
  background: var(--white);
}

.how__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  position: relative;
}

.how-step {
  text-align: center;
  padding: 0 32px;
  position: relative;
}

.how-step__circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 16px rgba(232,98,10,0.35);
}

.how-step__line {
  position: absolute;
  top: 32px;
  left: calc(50% + 32px);
  width: calc(100% - 64px);
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--orange) 0, var(--orange) 8px, transparent 8px, transparent 16px);
}

.how-step__line--none {
  display: none;
}

.how-step h3 {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
}

.how-step p {
  font-size: 15px;
  color: var(--grey);
  line-height: 1.6;
}

/* ============================================================
   КОНТАКТЫ
   ============================================================ */
.contact {
  background: linear-gradient(135deg, #1A1A1A 0%, #2D2D2D 100%);
  color: var(--white);
  padding: 80px 0;
}

.contact__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.contact__info {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contact__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact__item i {
  font-size: 22px;
  color: var(--orange);
  margin-top: 3px;
  flex-shrink: 0;
  width: 26px;
  text-align: center;
}

.contact__label {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.contact__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-head);
}

a.contact__value:hover {
  color: var(--orange);
}

/* ---- Форма ---- */
.contact__form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 32px;
  color: var(--dark);
}

.contact__form h3 {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--dark);
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--grey);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--dark);
  background: var(--white);
  transition: border-color 0.2s;
  outline: none;
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--orange);
}

.form-note {
  font-size: 12px;
  color: #9CA3AF;
  margin-top: 12px;
  text-align: center;
  line-height: 1.5;
}

/* ============================================================
   ПОДВАЛ
   ============================================================ */
.footer {
  background: #111;
  color: rgba(255,255,255,0.70);
  padding: 28px 0;
  font-size: 14px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.footer__contacts {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer__contacts a:hover {
  color: var(--orange);
}

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

/* ============================================================
   ВСПЛЫВАЮЩЕЕ ОКНО (после отправки формы)
   ============================================================ */
.popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.popup.active {
  display: flex;
}

.popup__box {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.30);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.popup__icon {
  font-size: 52px;
  margin-bottom: 16px;
}

.popup__box h3 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}

.popup__box p {
  color: var(--grey);
  margin-bottom: 24px;
}

/* ============================================================
   ПЛАВНОЕ ПОЯВЛЕНИЕ ЭЛЕМЕНТОВ
   ============================================================ */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   АДАПТИВ (мобильные телефоны и планшеты)
   ============================================================ */
@media (max-width: 900px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__inner {
    grid-template-columns: 1fr;
  }

  .hero__image {
    display: none;
  }
}

@media (max-width: 680px) {
  .header__contacts {
    display: none;
  }

  .burger {
    display: flex;
  }

  .services__grid {
    grid-template-columns: 1fr;
  }

  .why__grid {
    grid-template-columns: 1fr;
  }

  .how__steps {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .how-step__line {
    display: none;
  }

  .contact__inner {
    grid-template-columns: 1fr;
  }

  .hero__btns {
    flex-direction: column;
  }

  .hero__btns .btn {
    width: 100%;
    justify-content: center;
  }
}
