/* Лендинг «Клиника Турсунова» — фаза 1.
   Палитра и типографика — по дизайн-спецификации (teal + янтарный акцент,
   системный sans-serif). Без внешних шрифтов и запросов (CSP-friendly). */

:root {
  --primary: #0E7490;
  --primary-dark: #155E75;
  --accent: #F59E0B;
  --accent-dark: #D97706;
  --bg: #FFFFFF;
  --bg-alt: #F0F9FF;
  --text: #1E293B;
  --text-muted: #64748B;
  --footer-bg: #0F172A;
  --footer-text: #E2E8F0;
  --border: #E2E8F0;
  --success: #16A34A;
  --error: #DC2626;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08);
  --radius: 10px;
}

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

html {
  scroll-behavior: smooth;
  /* якоря не прячутся под sticky-хедером */
  scroll-padding-top: 76px;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img, svg { max-width: 100%; }

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

h1 { font-size: 48px; line-height: 1.15; font-weight: 700; }
h2 { font-size: 30px; line-height: 1.25; font-weight: 600; margin-bottom: 32px; }
h3 { font-size: 19px; font-weight: 600; }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: 12px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-lg { padding: 14px 28px; font-size: 17px; }
.btn-accent { background: var(--accent); color: #FFFFFF; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-ghost:hover { color: var(--primary-dark); border-color: var(--primary-dark); }
.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- Хедер ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
}
.site-nav a:hover { color: var(--primary); }
.site-nav .nav-cta { display: none; } /* CTA внутри меню — только mobile */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-phone {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.header-wa { padding: 8px 14px; font-size: 15px; }
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ---------- Хиро ---------- */
.hero { padding: 80px 0; }
.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-sub {
  margin-top: 20px;
  font-size: 19px;
  color: var(--text-muted);
  max-width: 34em;
}
.hero-cta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}
.hero-phone {
  align-self: center;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
}
.hero-phone:hover { color: var(--primary-dark); }

/* ---------- Доверие: рейтинг 2ГИС + счётчики ---------- */
.trust-strip { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.rating-badge { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px;
  text-decoration: none; color: var(--text); }
.rating-stars { color: var(--accent-dark); font-weight: 700; font-size: 18px; }
.rating-count { font-size: 14px; color: var(--text-muted); text-decoration: underline; }
.trust-fact strong { display: block; font-size: 20px; color: var(--primary); }
.trust-fact span { font-size: 13px; color: var(--text-muted); }

/* плейсхолдеры под фото/карту */
.placeholder-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-alt);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--primary);
  min-height: 280px;
}
.placeholder-media svg { width: 56px; height: 56px; }
.placeholder-media span { font-size: 14px; color: var(--text-muted); }

/* ---------- Секции ---------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }

/* ---------- Карточки ---------- */
.cards-grid {
  display: grid;
  gap: 24px;
}
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.icon-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--primary);
  margin-bottom: 20px;
}
.icon-circle svg { width: 32px; height: 32px; }
.icon-sm { width: 52px; height: 52px; }
.icon-sm svg { width: 26px; height: 26px; }
.service-card p { margin-top: 8px; color: var(--text-muted); font-size: 15px; }

/* ---------- Врачи ---------- */
.doctor-card { padding: 0; overflow: hidden; }
.doctor-photo {
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  color: var(--primary);
}
.doctor-photo svg { width: 72px; height: 72px; }
.doctor-card .doctor-info { padding: 20px; }
.doctor-card .doctor-name { font-size: 18px; }
.doctor-card .doctor-spec { margin-top: 4px; color: var(--text-muted); font-size: 15px; }

/* ---------- Отзывы ---------- */
.section-sub { margin: -16px 0 32px; color: var(--text-muted); }
.review-card p { font-size: 19px; }
.review-card footer { margin-top: 12px; font-size: 14px; color: var(--text-muted); }
.reviews-link { margin-top: 28px; }
.reviews-link a { color: var(--primary); }

/* ---------- Рассрочка ---------- */
.installments { max-width: 760px; }
.installments-lead { margin-bottom: 28px; max-width: 38em; }
.installments-lead strong { color: var(--primary); }

/* ---------- Почему мы ---------- */
.brand-promise {
  font-size: 30px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  max-width: 22em;
  margin: 0 auto 56px;
}
.why-grid { text-align: left; }
.why-item .icon-circle { margin-bottom: 14px; }
.why-item h3 { font-size: 17px; }
.why-item p { margin-top: 6px; color: var(--text-muted); font-size: 15px; }

/* ---------- Форма записи ---------- */
.form-container { max-width: 760px; }
.form-intro { color: var(--text-muted); margin: -16px 0 32px; }
.form-alt { margin: -16px 0 32px; font-size: 15px; color: var(--text-muted); }
.form-alt a { color: var(--primary); }
.form-trust { margin-top: 24px; }
.form-trust + #form-submit { margin-top: 16px; }
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: 15px; font-weight: 600; }
.req { color: var(--error); margin-left: 2px; }
.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 44px; /* тач-таргеты */
  width: 100%;
}
.field textarea { resize: vertical; min-height: 88px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}
.field input.invalid { border-color: var(--error); }

/* honeypot: визуально спрятан, но доступен наивным ботам */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

#form-submit { margin-top: 28px; min-width: 220px; }
.form-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}
.form-error {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 8px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--error);
  font-size: 15px;
}
.form-success {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius);
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  color: var(--success);
}
.form-success svg { width: 40px; height: 40px; flex-shrink: 0; }
.form-success p { color: var(--text); }

/* ---------- Контакты ---------- */
.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: stretch;
}
.contact-row { margin-bottom: 24px; }
.contact-row dt {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: 4px;
}
.contact-row dd { font-size: 18px; }
.contact-phone { font-weight: 600; }
.contacts-map { min-height: 320px; }

/* ---------- Футер ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 64px 0 40px;
  margin-top: 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr;
  gap: 48px;
}
.footer-logo { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.footer-about p { font-size: 15px; margin-bottom: 12px; color: #94A3B8; }
.footer-about .footer-logo { color: var(--footer-text); }
.footer-nav { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a, .footer-legal a {
  color: var(--footer-text);
  text-decoration: none;
  font-size: 15px;
}
.footer-nav a:hover, .footer-legal a:hover { text-decoration: underline; }
.footer-legal p { margin-top: 12px; font-size: 14px; color: #94A3B8; }

/* ---------- Липкая мобильная панель CTA ---------- */
.mobile-cta-bar { display: none; }

/* ================= Планшет (<=1024) ================= */
/* Хиро-фото — ДО медиазапросов, иначе они не переопределят высоту (ревью #168) */
.hero-media { margin: 0; align-self: stretch; min-height: 380px; }
.hero-media picture { display: block; height: 100%; }
.hero-media img { display: block; width: 100%; height: 100%; object-fit: cover;
  object-position: center 28%; border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08); }

@media (max-width: 1024px) {
  h1 { font-size: 36px; }

  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: 1fr; }
  .header-wa { display: none; } /* WhatsApp в хедере — только desktop */
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { min-height: 0; height: 280px; }

  /* навигация схлопывается в бургер */
  .burger { display: flex; }
  .header-phone { font-weight: 600; }
  .header-cta { display: none; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 8px 20px 20px;
  }
  .site-nav.open { display: flex; }
  .site-nav a {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .site-nav .nav-cta {
    display: block;
    margin-top: 16px;
    border-bottom: none;
    padding: 14px 20px;
  }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* ================= Мобильный (<=640) ================= */
@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .brand-promise { font-size: 24px; }

  .section { padding: 52px 0; }
  .hero { padding: 48px 0; }
  .hero-sub { font-size: 17px; }
  .hero-cta .btn { width: 100%; }
  .trust-strip { gap: 16px; }

  /* липкая панель «Позвонить / WhatsApp» */
  .mobile-cta-bar { display: flex; gap: 12px; position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 60; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(15, 23, 42, .08); }
  .mobile-cta-bar .btn { flex: 1; }
  body { padding-bottom: 72px; }

  .cards-4 { grid-template-columns: 1fr; }
  .contacts-grid { grid-template-columns: 1fr; gap: 32px; }
  .form-grid { grid-template-columns: 1fr; }
  #form-submit { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }

  /* хедер: логотип + телефон-иконка + бургер */
  .header-inner { gap: 12px; }
  .logo { font-size: 17px; }
  .header-phone { font-size: 14px; }
}

/* совсем узкие экраны (360px): телефон в хедере прячем, он есть в меню и хиро */
@media (max-width: 420px) {
  .header-phone { display: none; }
}

/* The hidden attribute must ALWAYS win: .form-success { display:flex }
   was silently defeating it — the success box showed on page load. */
[hidden] { display: none !important; }

/* Цены на карточках услуг (сверены с фактическими приёмами) */
.price-from { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--primary); }
.prices-note { margin-top: 24px; font-size: 14px; color: var(--text-muted); max-width: 640px; }

/* Командное фото живёт в хиро (реальное фото клиники и людей) */

/* Цены списком, а не строкой через точку */
.price-list { margin-top: 14px; padding: 0; list-style: none;
  border-top: 1px solid var(--border); }
.price-list li { display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; font-size: 14px; color: var(--text-muted);
  border-bottom: 1px solid var(--border); }
.price-list b { color: var(--primary); white-space: nowrap; }

/* «Как доехать» вместо заглушки карты */
.contacts-map-links { display: flex; flex-direction: column; align-items: flex-start;
  gap: 12px; padding: 24px; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 12px; }
.contacts-map-links .btn { width: 100%; text-align: center; }
.map-address { margin: 0 0 4px; font-weight: 600; color: var(--text); }

/* Портреты врачей: фиксированное соотношение, чтобы карточки не прыгали */
.doctor-photo picture { display: block; width: 100%; height: 100%; }
.doctor-photo img { width: 100%; height: 100%; object-fit: cover;
  object-position: center 20%; display: block; border-radius: 10px; }
