/* ============================================================
   Авиценна — Центр современной медицины
   Палитра: глубокий зелёный + белый + мягкий серо-зелёный фон
   ============================================================ */

:root {
  /* Основная палитра: Navy + Green + Gold */
  --navy-900: #061433;
  --navy-800: #0a1c4a;
  --navy-700: #122b6a;
  
  --green-700: #166b34;
  --green-600: #1f8a45;
  --green-500: #28a745;
  --green-100: #e8f5ec;
  --green-050: #f4faf6;

  --gold-600: #c89b4a;
  --gold-500: #d4af37;
  --gold-100: #f9f3e6;

  --ink-900: #0a1c4a;
  --ink-700: #2c3a32;
  --ink-500: #5c6b63;
  --ink-300: #97a39b;
  --line: #e3ebe5;

  --bg: #ffffff;
  --bg-soft: #f5f8fb;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;

  --shadow-s: 0 1px 2px rgba(10, 28, 74, .06), 0 2px 8px rgba(10, 28, 74, .04);
  --shadow-m: 0 6px 24px rgba(10, 28, 74, .08);
  --shadow-l: 0 18px 48px rgba(10, 28, 74, .12);

  --container: 1200px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-700);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-600); }

h1, h2, h3, h4 { color: var(--ink-900); line-height: 1.15; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 3.15rem); }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { width: min(100% - 40px, var(--container)); margin-inline: auto; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  padding: .9em 1.4em; border-radius: 999px; font-weight: 600; font-size: .98rem;
  border: 2px solid transparent; cursor: pointer; transition: .18s ease; white-space: nowrap;
}
.btn--primary { background: linear-gradient(135deg, var(--green-600), var(--green-700)); color: #fff; box-shadow: 0 8px 20px rgba(31,138,69,.28), inset 0 0 0 1px rgba(255,255,255,.12); }
.btn--primary:hover { background: linear-gradient(135deg, var(--green-500), var(--green-600)); color: #fff; transform: translateY(-1px); box-shadow: 0 12px 26px rgba(31,138,69,.35); }
.btn--ghost { background: transparent; color: var(--green-700); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--green-600); color: var(--green-600); }
.btn--white { background: #fff; color: var(--green-700); }
.btn--white:hover { background: var(--green-050); }
.btn--lg { padding: 1.05em 1.75em; font-size: 1.02rem; }
.btn--block { width: 100%; }

/* ---------- Шапка ---------- */
.topbar {
  background: var(--navy-800); color: #d0d8e8; font-size: .86rem;
}
.topbar__inner { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; justify-content: space-between; padding: .5rem 0; }
.topbar a { color: #fff; font-weight: 600; }
.topbar .topbar__item:nth-child(3) { color: var(--gold-500); }
.topbar__item { display: inline-flex; align-items: center; gap: .4rem; }
.topbar__item svg { width: 14px; height: 14px; flex: none; }

.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.site-header__inner { display: flex; align-items: center; gap: 1.25rem; padding: .7rem 0; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink-900); }
.brand__mark { width: 46px; height: 46px; flex: none; }
.brand__name { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name b { font-family: var(--font-display); font-size: 1.55rem; color: var(--navy-800); font-weight: 700; }
.brand__name span { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold-600); }

.nav { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.nav a { padding: .55em .85em; border-radius: 8px; color: var(--ink-700); font-weight: 500; font-size: .96rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--navy-800); background: var(--gold-100); }
.header-cta { display: flex; align-items: center; gap: .75rem; }

.burger { display: none; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.burger span, .burger span::before, .burger span::after { display: block; width: 20px; height: 2px; background: var(--ink-900); margin-inline: auto; position: relative; transition: .2s; }
.burger span::before, .burger span::after { content: ""; position: absolute; }
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg-soft); }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(1200px 500px at 80% -10%, rgba(31,138,69,.14), transparent 60%),
              radial-gradient(800px 400px at -10% 110%, rgba(40,167,69,.10), transparent 60%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; padding: clamp(2.5rem, 6vw, 5.5rem) 0; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .35em .9em; border-radius: 999px; background: var(--gold-100); border: 1px solid var(--gold-600); color: var(--navy-800); font-weight: 600; font-size: .82rem; letter-spacing: .02em; }
.hero h1 { margin-top: 1rem; }
.hero h1 em { font-family: var(--font-display); font-style: italic; color: var(--green-600); }
.hero h1 { color: var(--navy-800); }
.hero__lead { font-size: 1.12rem; color: var(--ink-500); max-width: 46ch; margin-bottom: 1.6rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.75rem; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.trust { display: flex; align-items: center; gap: .65rem; font-size: .92rem; color: var(--ink-700); }
.trust b { font-size: 1.25rem; color: var(--ink-900); display: block; line-height: 1.1; }
.trust small { color: var(--ink-500); }
.trust__icon { width: 42px; height: 42px; border-radius: 12px; background: var(--navy-800); color: #fff; display: grid; place-items: center; border: 1px solid var(--navy-700); flex: none; font-weight: 700; font-size: .9rem; }
.trust__icon svg { width: 22px; height: 22px; }

.hero__visual { position: relative; }
.hero__card { background: #fff; border-radius: var(--radius-l); box-shadow: var(--shadow-l); padding: 1.5rem; border: 1px solid var(--line); }
.hero__card h3 { margin: 0 0 1rem; font-size: 1.05rem; }
.quick-form { display: grid; gap: .65rem; }
.quick-form input, .quick-form select, .quick-form textarea {
  width: 100%; padding: .8em 1em; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; color: var(--ink-900); background: #fff; transition: .15s;
}
.quick-form input:focus, .quick-form select:focus, .quick-form textarea:focus { outline: none; border-color: var(--green-500); box-shadow: 0 0 0 3px rgba(40,167,69,.15); }
.quick-form .note { font-size: .78rem; color: var(--ink-300); }
.hero__float { position: absolute; bottom: -22px; left: -18px; background: #fff; border-radius: 14px; padding: .7rem 1rem; box-shadow: var(--shadow-m); display: flex; align-items: center; gap: .6rem; font-size: .85rem; border: 1px solid var(--line); }
.hero__float .stars { color: var(--gold-500); letter-spacing: 2px; }

/* ---------- Секции ---------- */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section--soft { background: var(--bg-soft); }
.section__head { max-width: 720px; margin-bottom: 2.2rem; }
.section__head p { color: var(--ink-500); font-size: 1.05rem; margin: 0; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head h2 { position: relative; padding-bottom: .5rem; }
.section__head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 52px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--green-600), var(--gold-600)); }
.section__head--center h2::after { left: 50%; transform: translateX(-50%); }

.grid { display: grid; gap: 1.25rem; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- Карточки направлений ---------- */
.service-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.5rem;
  transition: .18s ease; display: flex; flex-direction: column; gap: .5rem;
}
.service-card:hover { border-color: var(--green-500); box-shadow: var(--shadow-m); transform: translateY(-3px); }
.service-card__icon { width: 48px; height: 48px; border-radius: 12px; background: var(--green-100); color: var(--green-600); display: grid; place-items: center; margin-bottom: .4rem; }
.service-card__icon svg { width: 24px; height: 24px; }
.service-card h3 { margin: 0; font-size: 1.08rem; }
.service-card p { margin: 0; color: var(--ink-500); font-size: .93rem; }
.service-card a { margin-top: auto; font-weight: 600; font-size: .92rem; }

/* ---------- Карточки врачей ---------- */
.doctor-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden;
  display: flex; flex-direction: column; transition: .18s ease;
}
.doctor-card:hover { box-shadow: var(--shadow-m); transform: translateY(-3px); border-color: var(--green-500); }
.doctor-card__photo {
  aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--green-100), var(--green-050));
  display: grid; place-items: center; color: var(--green-700); font-family: var(--font-display); font-size: 3rem;
}
.doctor-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.doctor-card__body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.doctor-card__name { font-weight: 700; color: var(--ink-900); font-size: 1.02rem; line-height: 1.25; }
.doctor-card__role { color: var(--ink-500); font-size: .9rem; }
.doctor-card__meta { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--green-700); margin-top: .4rem; }
.doctor-card__badge { background: var(--green-100); color: var(--green-700); padding: .15em .65em; border-radius: 999px; font-weight: 600; font-size: .75rem; }
.doctor-card .btn { margin-top: auto; }

/* ---------- Отзывы ---------- */
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.4rem; display: flex; flex-direction: column; gap: .6rem; }
.review__stars { color: var(--gold-500); letter-spacing: 2px; }
.review__text { color: var(--ink-700); font-size: .96rem; }
.review__author { font-weight: 600; color: var(--ink-900); font-size: .9rem; }
.review__source { color: var(--ink-300); font-size: .8rem; }

/* ---------- CTA ---------- */
.cta { background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); border-radius: var(--radius-l); padding: clamp(2rem, 4vw, 3rem); color: #fff; display: grid; grid-template-columns: 1.4fr .6fr; gap: 2rem; align-items: center; border-bottom: 4px solid var(--gold-600); }
.cta h2 { color: #fff; }
.cta p { color: rgba(255,255,255,.85); margin: 0; }
.cta__actions { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Футер ---------- */
.site-footer { background: var(--navy-900); color: #c5d1e8; padding: 3rem 0 1.5rem; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr .8fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: .08em; }
.site-footer a { color: #c5d1c9; display: block; padding: .2em 0; }
.site-footer a:hover { color: #fff; }
.site-footer .brand__name b { color: #fff; }
.site-footer .brand__name span { color: #8fa39a; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; color: #8fa39a; font-size: .82rem; }

/* ---------- Внутренние страницы ---------- */
.page-hero { background: var(--bg-soft); padding: clamp(2rem, 4vw, 3rem) 0; border-bottom: 1px solid var(--line); }
.page-hero h1 { margin: 0 0 .5rem; }
.page-hero p { color: var(--ink-500); margin: 0; max-width: 60ch; }
.breadcrumbs { display: flex; gap: .5rem; font-size: .85rem; color: var(--ink-300); margin-bottom: .8rem; }
.breadcrumbs a { color: var(--ink-500); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.filter { padding: .5em 1em; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink-700); transition: .15s; }
.filter:hover { border-color: var(--green-500); color: var(--green-700); }
.filter.is-active { background: var(--green-600); border-color: var(--green-600); color: #fff; }

/* ---------- Контакты ---------- */
.contacts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.contact-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1.5rem; display: grid; gap: 1rem; }
.contact-row { display: flex; gap: .8rem; align-items: flex-start; }
.contact-row svg { width: 22px; height: 22px; color: var(--green-600); flex: none; margin-top: 2px; }
.contact-row b { display: block; color: var(--ink-900); }
.contact-row span { color: var(--ink-500); font-size: .93rem; }
.map-embed { border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--bg-soft); display: grid; place-items: center; color: var(--ink-300); }

/* ---------- 404 ---------- */
.error-page { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 3rem 0; }
.error-page h1 { font-size: clamp(4rem, 12vw, 8rem); color: var(--green-600); margin: 0; font-family: var(--font-display); }

/* ---------- Доступность ---------- */
:focus-visible { outline: 3px solid var(--green-500); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: 2rem; }
  .hero__float { display: none; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta { grid-template-columns: 1fr; }
  .cta__actions { justify-content: flex-start; }
  .contacts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav, .header-cta .btn--ghost { display: none; }
  .burger { display: block; margin-left: auto; }
  .nav.is-open {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; padding: 1rem; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-m); gap: .25rem;
  }
  .nav.is-open a { padding: .8em 1em; }
  .grid--3, .grid--4, .reviews, .footer-grid { grid-template-columns: 1fr; }
  .topbar__inner { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
