/* ===== VARIABLES ===== */
:root {
  --primary: #0a1f3f;
  --primary-light: #132d5e;
  --accent: #c9a84c;
  --accent-hover: #b8952f;
  --teal: #1a9e8f;
  --teal-light: #22c4b2;
  --white: #ffffff;
  --gray-50: #f8f9fa;
  --gray-100: #f0f2f5;
  --gray-200: #e2e6ea;
  --gray-300: #cdd3da;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --text: #2c3e50;
  --text-light: #5a6a7a;
  --shadow: 0 2px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: .3s ease;
  --max-w: 1200px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
ul, ol { list-style: none; }
h1, h2, h3, h4 { line-height: 1.3; color: var(--primary); }

/* ===== CONTAINER ===== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: 0 1px 10px rgba(0,0,0,.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 44px; width: auto; }
.logo-text { font-size: 14px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.logo-text small { display: block; font-weight: 400; font-size: 11px; color: var(--text-light); }

/* Nav */
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}
.nav a:hover, .nav a.active { color: var(--accent); background: var(--gray-50); }
/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a::after { content: ' ▾'; font-size: 10px; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  min-width: 260px;
  padding: 8px 0;
  z-index: 100;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 14px;
  border-radius: 0;
}
.dropdown-menu a:hover { background: var(--gray-50); }

/* Header right */
.header-right { display: flex; align-items: center; gap: 16px; }
.header-phone {
  font-weight: 700;
  color: var(--primary);
  font-size: 15px;
  white-space: nowrap;
}
.header-phone a { color: var(--primary); }
.header-phone a:hover { color: var(--accent); }
.header-buttons { display: flex; gap: 10px; }
.header-buttons .btn { white-space: nowrap; }
.header-icons { display: none; gap: 12px; }
.header-icon { font-size: 22px; text-decoration: none; }

/* Language switcher */
.lang-switch { position: relative; }
.lang-switch > span {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--gray-100);
  border-radius: 6px;
}
.lang-switch > span:hover { background: var(--gray-200); }
.lang-switch-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-sm);
  min-width: 140px;
  padding: 8px 0;
  z-index: 1000;
}
.lang-switch:hover .lang-switch-dropdown { display: block; }
.lang-switch-dropdown a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text);
}
.lang-switch-dropdown a:hover { background: var(--gray-100); }
.lang-switch-dropdown a.active { background: var(--primary); color: var(--white); }

/* Burger */
.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.burger span { display: block; width: 24px; height: 2px; background: var(--primary); transition: all var(--transition); }
.burger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ===== HERO ===== */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 100px 0 80px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero-bg.jpg') center bottom/cover no-repeat;
  opacity: .25;
}
.hero-content { position: relative; z-index: 1; max-width: 700px; }
.hero h1 { font-size: 42px; font-weight: 800; margin-bottom: 20px; color: var(--white); }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 18px; opacity: .9; margin-bottom: 32px; line-height: 1.8; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-phone { margin-top: 24px; }
.hero-phone a { color: var(--white); font-size: 22px; font-weight: 700; }
.hero-phone a:hover { color: var(--accent); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-align: center;
}
.btn-primary { background: var(--accent); color: var(--primary); }
.btn-primary:hover { background: var(--accent-hover); color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 20px rgba(201,168,76,.4); }
.btn-outline { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.4); }
.btn-outline:hover { border-color: var(--white); color: var(--white); background: rgba(255,255,255,.1); }
.btn-teal { background: var(--teal); color: var(--white); }
.btn-teal:hover { background: var(--teal-light); color: var(--white); transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 14px; }

/* ===== SECTIONS ===== */
.section { padding: 80px 0; }
.section-gray { background: var(--gray-50); }
.section-dark { background: var(--primary); color: var(--white); }
.section-dark h2 { color: var(--white); }
.section-title {
  font-size: 34px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 16px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-light);
  font-size: 17px;
  max-width: 600px;
  margin: 0 auto 50px;
}

/* ===== SERVICES CARDS ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 28px;
}
.service-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.service-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.service-card-img {
  height: 200px;
  overflow: hidden;
}
.service-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.service-card:hover .service-card-img img { transform: scale(1.05); }
.service-card-body { padding: 28px; flex: 1; display: flex; flex-direction: column; }
.service-card-body h3 { font-size: 20px; margin-bottom: 10px; }
.service-card-body p { color: var(--text-light); font-size: 15px; margin-bottom: 20px; flex: 1; }
.service-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 16px;
}
.service-price small { font-size: 14px; font-weight: 400; color: var(--text-light); }

/* ===== FEATURES ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}
.feature-item { text-align: center; padding: 32px 20px; }
.feature-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
}
.feature-item h3 { font-size: 18px; margin-bottom: 10px; }
.feature-item p { color: var(--text-light); font-size: 14px; }

/* ===== ABOUT ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-text h2 { font-size: 30px; margin-bottom: 20px; text-align: left; }
.about-text p { margin-bottom: 16px; color: var(--text-light); }
.about-image { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }

/* ===== ARTICLES ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.article-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  transition: all var(--transition);
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.article-card h3 { font-size: 18px; margin-bottom: 12px; }
.article-card h3 a { color: var(--primary); }
.article-card h3 a:hover { color: var(--accent); }
.article-card p { color: var(--text-light); font-size: 14px; margin-bottom: 16px; }

/* ===== CTA ===== */
.cta-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  text-align: center;
  padding: 70px 0;
}
.cta-section h2 { color: var(--white); font-size: 32px; margin-bottom: 16px; }
.cta-section p { opacity: .85; font-size: 17px; max-width: 600px; margin: 0 auto 32px; }
.cta-buttons { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

/* ===== CALLBACK FORM ===== */
.callback-form {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.callback-form input {
  padding: 14px 20px;
  border: 2px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.1);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 15px;
  flex: 1;
  min-width: 200px;
  transition: border var(--transition);
}
.callback-form input::placeholder { color: rgba(255,255,255,.5); }
.callback-form input:focus { outline: none; border-color: var(--accent); }

/* Page callback form (light bg) */
.form-light { max-width: 500px; }
.form-light input, .form-light select {
  padding: 14px 20px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 15px;
  width: 100%;
  margin-bottom: 12px;
  transition: border var(--transition);
}
.form-light input:focus, .form-light select:focus, .form-light textarea:focus { outline: none; border-color: var(--accent); }
.form-light textarea {
  padding: 14px 20px;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 15px;
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  margin-bottom: 12px;
}
.form-light .btn { width: 100%; justify-content: center; }

/* ===== PRICING TABLE ===== */
.pricing-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.pricing-table th, .pricing-table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--gray-200); }
.pricing-table th { background: var(--primary); color: var(--white); font-weight: 600; }
.pricing-table tr:hover { background: var(--gray-50); }
.pricing-table .price { font-weight: 700; color: var(--teal); white-space: nowrap; }

/* ===== FOOTER ===== */
.footer {
  background: var(--primary);
  color: rgba(255,255,255,.75);
  padding: 60px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
}
.footer h4 { color: var(--white); font-size: 17px; margin-bottom: 20px; }
.footer p { font-size: 14px; line-height: 1.8; margin-bottom: 10px; }
.footer a { color: rgba(255,255,255,.75); }
.footer a:hover { color: var(--accent); }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { font-size: 14px; }
.footer-logo { margin-bottom: 16px; font-size: 22px; font-weight: 700; color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
  margin-top: 40px;
  text-align: center;
  font-size: 13px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  position: relative;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 60px 0 50px;
  text-align: center;
  overflow: hidden;
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero-bg.jpg') center bottom/cover no-repeat;
  opacity: .25;
}
.page-header .container { position: relative; z-index: 1; }
.page-header h1 { font-size: 36px; color: var(--white); margin-bottom: 10px; }
.page-header p { opacity: .8; font-size: 16px; }
.breadcrumb {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 14px;
  opacity: .7;
}
.page-header-buttons { display: flex; justify-content: center; gap: 16px; margin-top: 24px; }
.page-header-phone { margin-top: 16px; }
.page-header-phone a { color: var(--white); font-size: 20px; font-weight: 600; }
.page-header-phone a:hover { color: var(--accent); }
.btn-outline-light { border: 2px solid var(--white); color: var(--white); background: transparent; }
.btn-outline-light:hover { background: var(--white); color: var(--primary); }
.breadcrumb a { color: var(--white); }
.breadcrumb span { opacity: .5; }

/* ===== CONTENT PAGE ===== */
.content-page { padding: 60px 0; }
/* на 9 страницах content-page вложен в .section — их паддинги складывались
   (80 + 60) и вместе с margin первого h2 давали ~180px пустоты после шапки */
.section .content-page { padding: 0; }
.content-page > :first-child { margin-top: 0; }
.content-page h2 { font-size: 26px; margin: 40px 0 16px; }
.content-page h3 { font-size: 20px; margin: 30px 0 12px; }
.content-page p { margin-bottom: 16px; color: var(--text-light); }
.content-page ul { margin: 16px 0; padding-left: 24px; }
.content-page ul li { margin-bottom: 8px; position: relative; padding-left: 20px; color: var(--text-light); }
.content-page ul li::before { content: '✓'; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.content-max { max-width: 800px; margin: 0 auto; }

/* ===== CONTACT PAGE ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-info-item { display: flex; gap: 16px; margin-bottom: 28px; }
.contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.contact-info-item h4 { font-size: 15px; margin-bottom: 4px; }
.contact-info-item p { color: var(--text-light); font-size: 14px; }
.contact-info-item a { color: var(--text); font-weight: 600; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 460px;
  width: 90%;
  position: relative;
}
.modal h3 { margin-bottom: 20px; text-align: center; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  cursor: pointer;
  color: var(--gray-600);
  background: none;
  border: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
  .nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); box-shadow: var(--shadow-lg); padding: 20px; }
  .nav.active { display: flex; }
  .nav-dropdown:hover .dropdown-menu { display: none; }
  .nav-dropdown.open .dropdown-menu { display: block; position: static; box-shadow: none; padding-left: 16px; }
  .burger { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
  .hero { padding: 70px 0 60px; }
}
@media (max-width: 600px) {
  .header-phone { display: none; }
  .header-buttons { display: none; }
  .header-icons { display: flex; }
  .services-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .section-title { font-size: 26px; }
  .hero-buttons { flex-direction: row; justify-content: center; }
  .hero-buttons .btn { padding: 10px 16px; font-size: 14px; }
  .hero-phone { text-align: center; }
  .hero-phone a { font-size: 20px; }
  .callback-form { flex-direction: column; }
  .callback-form input { min-width: unset; }
  .section { padding: 50px 0; }
  /* длинные названия услуг + nowrap на цене растягивали таблицу
     шире экрана (390 → 396) и давали горизонтальный скролл всей страницы */
  .pricing-table th, .pricing-table td { padding: 12px 10px; font-size: 14px; }
  .pricing-table td:first-child { word-break: break-word; }
  /* номер телефона рвался на две строки внутри кнопки */
  .page-header-buttons { gap: 10px; }
  .page-header-buttons .btn { padding: 10px 14px; font-size: 14px; white-space: nowrap; }
  /* «Психофизиологическая» длиннее 390px и обрезалось краем контейнера */
  .page-header h1, .content-page h2, .content-page h3 { overflow-wrap: anywhere; }
}
