/* ===== CSS Variables & Reset ===== */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-text: #1f2937;
  --color-text-light: #6b7280;
  --color-bg: #ffffff;
  --color-bg-light: #f9fafb;
  --color-bg-dark: #111827;
  --color-border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --radius: 8px;
  --transition: all 0.2s ease;
  --container: 1200px;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  color: var(--color-text);
  line-height: 1.6;
  background: var(--color-bg);
}

/* ===== Utilities ===== */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.text-center { text-align: center; }
.bg-light { background: var(--color-bg-light); }
.bg-dark { background: var(--color-bg-dark); color: #fff; }
.section { padding: 80px 0; }
.section__title { font-size: 2rem; font-weight: 700; margin-bottom: 1.5rem; line-height: 1.2; }
@media (min-width: 768px) { .section__title { font-size: 2.5rem; } }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; border-radius: var(--radius); font-weight: 600; text-decoration: none; cursor: pointer; border: none; transition: var(--transition); gap: 8px; }
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-dark); transform: translateY(-2px); }
.btn--outline { background: transparent; border: 2px solid var(--color-primary); color: var(--color-primary); }
.btn--outline:hover { background: var(--color-primary); color: #fff; }
.btn--small { padding: 8px 16px; font-size: 0.9rem; }
.btn--full { width: 100%; }

/* ===== Header & Nav (ИСПРАВЛЕНО ПОД МОБИЛЬНЫЕ) ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
  min-height: 56px;
}
.header__inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-weight: 700; font-size: 1.25rem; color: var(--color-text); text-decoration: none; white-space: nowrap; }

.nav { position: static; width: auto; }
.nav__list { display: none; list-style: none; gap: 24px; margin: 0; padding: 0; }
.nav__link { color: var(--color-text); text-decoration: none; font-weight: 500; transition: var(--transition); }
.nav__link:hover { color: var(--color-primary); }

.nav__toggle {
  background: none; border: none; font-size: 1.6rem; cursor: pointer;
  padding: 8px; line-height: 1; z-index: 102; color: var(--color-text);
}

/* Мобильное выпадающее меню (FIX) */
@media (max-width: 767px) {
  .nav__list {
    position: fixed;
    top: 56px; left: 0; right: 0;
    width: 100%;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    background: #ffffff;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-top: 1px solid var(--color-border);
    z-index: 99;
  }
  .nav__list--open { display: flex; }
  .nav__link {
    display: block;
    padding: 16px 24px;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.1rem;
    line-height: 1.4;
  }
  .nav__link:last-child { border-bottom: none; }
  .nav__link--cta {
    background: var(--color-primary);
    color: #fff;
    text-align: center;
    margin: 16px 16px 12px;
    padding: 14px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
  }
}

/* Десктоп */
@media (min-width: 768px) {
  .nav__list { display: flex !important; }
  .nav__toggle { display: none; }
}

/* ===== Hero ===== */
.hero { padding: 100px 0 60px; background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%); text-align: center; }
.hero__title { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.2; }
.hero__subtitle { font-size: 1.25rem; color: var(--color-text-light); margin-bottom: 0.5rem; }
.hero__specialization { color: var(--color-text-light); margin-bottom: 2rem; }
.hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
@media (min-width: 768px) { .hero__title { font-size: 3rem; } .hero__subtitle { font-size: 1.5rem; } }

/* ===== About ===== */
.about__grid { display: grid; gap: 40px; }
@media (min-width: 992px) { .about__grid { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.about__highlight { background: #eff6ff; padding: 16px; border-radius: var(--radius); border-left: 4px solid var(--color-primary); margin: 1.5rem 0; }
.certificates__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.certificate-card { background: var(--color-bg-light); padding: 16px; border-radius: var(--radius); text-align: center; font-weight: 500; border: 1px solid var(--color-border); }

/* ===== Services ===== */
.services__grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.service-card { background: #fff; padding: 24px; border-radius: var(--radius); box-shadow: var(--shadow-md); transition: var(--transition); border: 1px solid var(--color-border); }
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.service-card__icon { font-size: 2rem; margin-bottom: 12px; }
.service-card h3 { font-size: 1.25rem; margin-bottom: 8px; }
.service-card p { color: var(--color-text-light); }

/* ===== Cases ===== */
.cases__note { color: var(--color-text-light); margin-bottom: 32px; }
.cases__grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.case-card { background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--color-border); }
.case-card h3 { margin-bottom: 8px; }
.case-card p { color: var(--color-text-light); margin-bottom: 16px; }

/* ===== Process ===== */
.process__subtitle { color: var(--color-text-light); margin-bottom: 40px; font-size: 1.1rem; }
.process__steps { display: grid; gap: 32px; }
@media (min-width: 768px) { .process__steps { grid-template-columns: repeat(3, 1fr); } }
.process__step { background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--color-border); position: relative; padding-top: 50px; }
.process__step-number { position: absolute; top: -12px; left: 24px; width: 36px; height: 36px; background: var(--color-primary); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; }

/* ===== Partner ===== */
.partner__subtitle { color: var(--color-text-light); margin-bottom: 32px; font-size: 1.1rem; }
.partner__benefits { display: grid; gap: 24px; margin-bottom: 32px; }
@media (min-width: 768px) { .partner__benefits { grid-template-columns: repeat(3, 1fr); } }
.partner__benefit { background: #fff; padding: 24px; border-radius: var(--radius); border: 1px solid var(--color-border); text-align: center; }
.partner__benefit strong { display: block; margin-bottom: 8px; color: var(--color-primary); }

/* ===== Contacts ===== */
.contacts__grid { display: grid; gap: 40px; }
@media (min-width: 992px) { .contacts__grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.contacts__details p { margin: 8px 0; }
.contacts__details a { color: #93c5fd; text-decoration: none; }
.contacts__details a:hover { text-decoration: underline; }
.contacts__social { display: flex; gap: 16px; margin: 24px 0; }
.social-link { color: #93c5fd; text-decoration: none; font-weight: 500; padding: 8px 16px; border: 1px solid #374151; border-radius: var(--radius); transition: var(--transition); }
.social-link:hover { background: #374151; }
.contacts__hours { background: rgba(255,255,255,0.1); padding: 16px; border-radius: var(--radius); }
.contacts__note { font-size: 0.9rem; opacity: 0.9; margin-top: 8px; }

/* ===== Form ===== */
.contact-form { background: #fff; padding: 24px; border-radius: var(--radius); color: var(--color-text); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group textarea { width: 100%; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius); font-size: 1rem; transition: var(--transition); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-group--checkbox label { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.form-group--checkbox input { width: auto; margin-top: 4px; }
.form-note { font-size: 0.85rem; color: var(--color-text-light); margin-top: 12px; }
.form-message { margin-top: 16px; font-weight: 500; }
.form-message--success { color: #10b981; }
.form-message--error { color: #ef4444; }

/* ===== Footer ===== */
.footer { padding: 24px 0; background: var(--color-bg-dark); color: #9ca3af; text-align: center; }
.footer__inner { display: flex; flex-direction: column; gap: 8px; }
.footer a { color: #93c5fd; text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ===== Cookie Banner ===== */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: var(--color-bg-dark); color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 16px; z-index: 1000; transform: translateY(100%); transition: transform 0.3s ease; }
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { margin: 0; font-size: 0.95rem; }
.cookie-banner a { color: #93c5fd; text-decoration: none; }
@media (max-width: 640px) { .cookie-banner { flex-direction: column; text-align: center; } }

/* ===== Accessibility & Animations ===== */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } html { scroll-behavior: auto; } }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* ===== Авторское фото ===== */
.author-photo-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.author-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  background-color: var(--color-bg-light);
  transition: transform 0.3s ease;
}
.author-photo:hover {
  transform: scale(1.03);
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
  .author-photo { width: 140px; height: 140px; }
}
/* ===== Круглое фото автора ===== */
.author-photo-wrapper {
  display: flex;
  justify-content: center; /* Центрируем фото в блоке */
  margin-bottom: 20px;
}

.author-photo {
  width: 234px;   /* Фиксированная ширина */
  height: 234px;  /* Фиксированная высота (равна ширине!) */
  border-radius: 50%; /* ЭТА СТРОКА ДЕЛАЕТ ФОТО КРУГЛЫМ */
  object-fit: cover; /* Эта строка обрезает края, не искажая лицо */
  border: 3px solid #fff; /* Белая окантовка для красоты */
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Лёгкая тень */
  background-color: #eee; /* Цвет фона, пока фото грузится */
}

/* Адаптив: на телефонах круг чуть меньше */
@media (max-width: 480px) {
  .author-photo {
    width: 182px;
    height: 182px;
  }
}


/* ===== Блок с графиками ===== */
.case-charts { padding: 80px 0; }
.section-subtitle { 
  color: var(--color-text-light); 
  font-size: 1.1rem; 
  margin-bottom: 48px; 
}

.chart-wrapper {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}

.chart-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.chart-period {
  background: var(--color-bg-light);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-weight: 500;
  white-space: nowrap;
}

.chart-image-container {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: var(--color-bg-light);
  margin-bottom: 16px;
}

.chart-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.chart-image:hover {
  transform: scale(1.02);
}

.chart-caption {
  background: var(--color-bg-light);
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid var(--color-primary);
}

.chart-caption p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--color-text);
}

.chart-caption strong {
  color: var(--color-primary);
}

/* === Адаптивность для мобильных === */
@media (max-width: 767px) {
  .chart-wrapper {
    padding: 16px;
    margin-bottom: 24px;
  }
  
  .chart-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .chart-header h3 {
    font-size: 1.15rem;
  }
  
  .chart-period {
    font-size: 0.8rem;
  }
  
  .chart-caption {
    padding: 12px;
    font-size: 0.9rem;
  }
}

/* === Горизонтальный скролл для очень широких графиков === */
@media (max-width: 480px) {
  .chart-image-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
  }
  
  .chart-image {
    min-width: 100%;
  }
}

.modal-content { position: relative; }
.modal-close {
  position: absolute; top: -40px; right: 0;
  color: #fff; font-size: 32px; cursor: pointer;
}