/* ==========================================================================
   Дизайн-токены — сайт доктора Курасова
   ========================================================================== */
:root {
  --color-bg: #FFFFFF;
  --color-surface: #F6F9FA;
  --color-text: #1F1F1F;
  --color-text-muted: #556066;
  --color-border: #E2E8EA;
  --color-accent: #00A7B5;
  --color-accent-hover: #008C99;
  --color-footer: #1F2A2E;

  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-round: 999px;

  --shadow-sm: 0 1px 3px rgba(31, 41, 46, 0.08);
  --shadow-md: 0 12px 28px rgba(31, 41, 46, 0.12);
  --shadow-lg: 0 20px 45px rgba(31, 41, 46, 0.18);

  --header-h: 72px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

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

h1, h2, h3 { font-family: var(--font-body); font-weight: 600; margin: 0 0 .5em; color: var(--color-text); }
h1 { font-size: 30px; line-height: 1.25; }
h2 { font-size: 24px; line-height: 1.3; }
h3 { font-size: 18px; line-height: 1.4; margin-top: 1.4em; }
p { margin: 0 0 1em; }
a { color: var(--color-accent); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--color-accent);
  color: #fff; padding: 10px 16px; z-index: 2000; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.btn-brand {
  background: var(--color-accent); border-color: var(--color-accent); color: #fff;
  font-weight: 600; border-radius: var(--radius-md); padding: .65rem 1.25rem;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn-brand:hover, .btn-brand:focus-visible {
  background: var(--color-accent-hover); border-color: var(--color-accent-hover);
  color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.btn-outline-brand {
  border: 1.5px solid var(--color-accent); color: var(--color-accent);
  font-weight: 600; border-radius: var(--radius-md); padding: .65rem 1.25rem;
  background: transparent; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn-outline-brand:hover, .btn-outline-brand:focus-visible {
  background: var(--color-surface); color: var(--color-accent-hover);
  border-color: var(--color-accent-hover); transform: translateY(-2px); box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 1000; height: var(--header-h);
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  display: flex; align-items: center;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand__initial {
  width: 40px; height: 40px; border-radius: var(--radius-round);
  background: var(--color-accent); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-weight: 600; font-size: 16px; color: var(--color-text); }
.brand__name--footer { color: #fff; font-size: 18px; }
.brand__role { font-size: 13px; color: var(--color-text-muted); }

.nav-toggle {
  display: none; border: 1px solid var(--color-border); background: #fff;
  border-radius: var(--radius-md); width: 42px; height: 42px; font-size: 18px; color: var(--color-text);
}

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  color: var(--color-text); text-decoration: none; font-weight: 500; font-size: 15px;
  position: relative; padding: 4px 0;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--color-accent); }
.site-nav__cta {
  background: var(--color-accent); color: #fff !important; padding: 8px 18px !important;
  border-radius: var(--radius-round); transition: background-color .15s ease, transform .15s ease;
}
.site-nav__cta:hover { background: var(--color-accent-hover); transform: translateY(-1px); }

/* ==========================================================================
   Signature element — ECG (кардио-линия)
   ========================================================================== */
.ecg-line path, .section-divider path {
  fill: none; stroke: var(--color-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
}
.ecg-line { width: 100%; height: 56px; }
.ecg-line--hero {
  position: absolute; left: 0; right: 0; bottom: -12px; opacity: .55;
  stroke-dasharray: 900; stroke-dashoffset: 900;
  animation: ecg-draw 2.4s ease-out .3s forwards;
}
.section-divider { line-height: 0; }
.section-divider svg { width: 100%; height: 24px; display: block; }
.section-divider path { stroke: var(--color-border); }

@keyframes ecg-draw { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 64px 0 56px; background: var(--color-bg); overflow: hidden; }
.hero__inner {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
}
.eyebrow {
  text-transform: uppercase; letter-spacing: .06em; font-size: 13px; font-weight: 600;
  color: var(--color-accent); margin-bottom: 10px;
}
.hero__role { font-size: 18px; font-weight: 500; color: var(--color-text-muted); margin-bottom: 14px; }
.hero__lead { color: var(--color-text-muted); max-width: 46ch; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.hero__media { position: relative; }
.hero__portrait {
  width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border); display: block; aspect-ratio: 4/5; object-fit: cover;
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section { padding: 64px 0; }
.section--muted { background: var(--color-surface); }
.section__title { margin-bottom: 8px; }
.section__subtitle { color: var(--color-text-muted); margin-bottom: 32px; max-width: 60ch; }

/* О враче — одноколоночный читаемый текст */
.doctor-copy { max-width: 72ch; }
.lead-text { font-size: 17px; color: var(--color-text); }
.timeline-list, .plain-list { list-style: none; padding: 0; margin: 0 0 1em; }
.timeline-list li, .plain-list li {
  padding: 10px 0; border-bottom: 1px solid var(--color-border);
  display: flex; gap: 16px; color: var(--color-text-muted);
}
.timeline-list li:last-child, .plain-list li:last-child { border-bottom: none; }
.timeline-list__period {
  flex: 0 0 150px; font-weight: 600; color: var(--color-accent); font-size: 14px;
}
.plain-list li::before { content: "\2022"; color: var(--color-accent); font-weight: 700; }

/* Операции — карточки, 1 колонка на мобильном */
.operations-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
.op-card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  padding: 26px; transition: transform .18s ease, box-shadow .18s ease;
}
.op-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.op-card__icon {
  width: 48px; height: 48px; border-radius: var(--radius-md); background: rgba(0,167,181,.1);
  color: var(--color-accent); display: flex; align-items: center; justify-content: center; font-size: 20px;
  margin-bottom: 14px;
}
.op-card p { color: var(--color-text-muted); font-size: 15px; margin-bottom: 0; }

/* Карта */
.map-block { position: relative; }
.map-block__frame {
  width: 100%; height: 420px; border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--color-border); box-shadow: var(--shadow-sm);
}
.map-block__frame iframe { width: 100%; height: 100%; border: 0; }
.map-block__card {
  position: absolute; left: 24px; bottom: 24px; background: #fff; border-radius: var(--radius-md);
  padding: 20px 22px; box-shadow: var(--shadow-md); max-width: 320px; border: 1px solid var(--color-border);
}
.map-block__card-img {
  width: 100%; height: 110px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; display: block;
}
.map-block__card h3 { margin-top: 0; font-size: 16px; }
.map-block__card p { margin-bottom: 6px; font-size: 14px; color: var(--color-text-muted); }
.map-block__card i { color: var(--color-accent); width: 18px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--color-footer); color: #C7D0D3; padding: 48px 0; }
.site-footer__inner { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; }
.site-footer p { font-size: 14px; margin-bottom: 8px; }
.site-footer i { color: var(--color-accent); width: 18px; }
.site-footer h3 { color: #fff; font-size: 15px; }
.site-footer__disclaimer p {
  font-size: 13px; color: #9FADB1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 14px;
}

/* ==========================================================================
   Assistant — floating button + panel
   ========================================================================== */
.assistant-fab {
  position: fixed; right: 26px; bottom: 26px; width: 60px; height: 60px; border-radius: var(--radius-round);
  background: var(--color-accent); color: #fff; border: none; font-size: 22px; box-shadow: var(--shadow-lg);
  z-index: 1200; display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, background-color .15s ease;
}
.assistant-fab:hover, .assistant-fab:focus-visible { background: var(--color-accent-hover); transform: translateY(-3px); }
.assistant-fab.is-pulsing { animation: fab-pulse 1.8s ease-out infinite; }
@keyframes fab-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,167,181,.55), var(--shadow-lg); }
  70% { box-shadow: 0 0 0 16px rgba(0,167,181,0), var(--shadow-lg); }
  100% { box-shadow: 0 0 0 0 rgba(0,167,181,0), var(--shadow-lg); }
}

.assistant-backdrop {
  position: fixed; inset: 0; background: rgba(31,42,46,.35); z-index: 1190;
}

.assistant-panel {
  position: fixed; right: 26px; bottom: 100px; width: 380px; max-width: calc(100vw - 32px);
  height: min(600px, calc(100vh - 140px)); background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--color-border);
  z-index: 1195; display: flex; flex-direction: column; overflow: hidden;
}
.assistant-panel__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 20px; border-bottom: 1px solid var(--color-border); background: var(--color-surface);
}
.assistant-panel__title { font-weight: 600; font-size: 15px; margin: 0; }
.assistant-panel__subtitle { font-size: 13px; color: var(--color-text-muted); margin: 2px 0 0; }
.assistant-panel__close {
  border: none; background: transparent; color: var(--color-text-muted); font-size: 18px; padding: 4px 8px;
  border-radius: 8px;
}
.assistant-panel__close:hover { background: #E9EFF0; color: var(--color-text); }

.assistant-panel__messages { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }

.assistant-msg {
  max-width: 92%; padding: 12px 14px; border-radius: var(--radius-md); font-size: 14.5px;
  animation: msg-in .25s ease both;
}
.assistant-msg p:last-child { margin-bottom: 0; }
.assistant-msg--bot { background: var(--color-surface); align-self: flex-start; border: 1px solid var(--color-border); }
.assistant-msg--user { background: var(--color-accent); color: #fff; align-self: flex-end; }
.assistant-msg--error { background: #FDEDEC; border: 1px solid #F3C7C2; color: #7A2E24; align-self: flex-start; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.assistant-examples { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.assistant-example {
  text-align: left; background: #fff; border: 1px solid var(--color-border); border-radius: 10px;
  padding: 8px 12px; font-size: 13.5px; color: var(--color-accent); transition: background-color .15s ease;
}
.assistant-example:hover { background: rgba(0,167,181,.08); }
.assistant-disclaimer { font-size: 12.5px; color: var(--color-text-muted); margin-top: 8px; margin-bottom: 0; }

.assistant-typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.assistant-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--color-text-muted);
  animation: typing-dot 1.1s infinite ease-in-out;
}
.assistant-typing span:nth-child(2) { animation-delay: .15s; }
.assistant-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.assistant-panel__input {
  display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--color-border);
}
.assistant-panel__input input {
  flex: 1; border: 1px solid var(--color-border); border-radius: var(--radius-round);
  padding: 10px 16px; font-size: 14px; font-family: var(--font-body);
}
.assistant-panel__input input:focus-visible { outline: 2px solid var(--color-accent); }
.assistant-panel__input button { border-radius: var(--radius-round); width: 44px; height: 44px; padding: 0; flex-shrink: 0; }

/* Toasts */
.toast-stack { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1400; display: flex; flex-direction: column; gap: 10px; }
.app-toast {
  background: #1F2A2E; color: #fff; padding: 12px 18px; border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); font-size: 14px; display: flex; align-items: center; gap: 12px;
  animation: toast-in .2s ease both;
}
.app-toast button {
  background: var(--color-accent); border: none; color: #fff; font-size: 13px; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-round);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ==========================================================================
   Responsive < 768px
   ========================================================================== */
@media (max-width: 767.98px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; background: #fff;
    flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 16px;
    border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-sm);
  }
  .site-nav.show { display: flex; }
  .site-nav a { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--color-border); }
  .site-nav__cta { margin-top: 10px; text-align: center; border-bottom: none !important; }

  .hero { padding: 40px 0 44px; }
  .hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .hero__media { order: -1; max-width: 260px; margin: 0 auto; }
  h1 { font-size: 26px; }

  .section { padding: 44px 0; }
  .operations-grid { grid-template-columns: 1fr; }

  .map-block__frame { height: 320px; }
  .map-block__card { position: static; margin-top: 16px; max-width: none; }

  .site-footer__inner { grid-template-columns: 1fr; gap: 28px; }

  .assistant-panel {
    right: 8px; left: 8px; bottom: 8px; top: 8px; width: auto; height: auto; max-width: none;
  }
  .assistant-fab { right: 18px; bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ecg-line--hero { animation: none; stroke-dashoffset: 0; }
  .assistant-fab.is-pulsing { animation: none; }
  .op-card, .btn-brand, .btn-outline-brand, .assistant-fab { transition: none; }
  .assistant-msg, .app-toast { animation: none; }
}
