/* ============================================================
   palette-fix.css — финальная палитра по ТЗ
   Переопределяет все цвета сайта на спецификацию ТЗ.
   Подключается ПОСЛЕДНИМ, чтобы перекрыть все предыдущие стили.
   ============================================================ */

:root {
  /* --- Палитра по ТЗ --- */
  --white: #FFFFFF;
  --paper: #F7F5F1;            /* Фон альтернативный */
  --ink: #1F2A2A;              /* Текст основной */
  --teal: #0F5C5C;             /* Акцент главный */
  --teal-soft: #E6F0EE;        /* Акцент мягкий */
  --muted: #5C6B6B;            /* Текст вторичный */
  --line: #DDE3E1;             /* Границы */
  --warm: #E8DFD3;             /* Тёплый природный (СВО) */
  --urgent: #B86A4C;           /* Срочная кнопка (терракота) */
  --success: #4A7C59;          /* Успех */

  /* Совместимость со старыми именами */
  --bg: #FFFFFF;
  --sage: #E6F0EE;
  --night: #E6F0EE;
  --sub: #5C6B6B;
  --zv-g1: #0F5C5C;
  --zv-g2: #0F5C5C;
  --zv-g3: #0F5C5C;
}

/* --- Принудительно по ТЗ --- */
body {
  background: var(--white) !important;
  color: var(--ink) !important;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
  font-size: 17px !important;
  line-height: 1.65 !important;
}

/* Заголовки — по ТЗ */
h1 { font-size: clamp(40px, 4.5vw, 48px) !important; font-weight: 600 !important; letter-spacing: -1px !important; }
h2 { font-size: clamp(28px, 3vw, 32px) !important; font-weight: 600 !important; letter-spacing: -0.5px !important; }
h3 { font-size: clamp(20px, 2vw, 22px) !important; font-weight: 600 !important; }
p  { font-size: 17px !important; }

/* Мелкие подписи — 14px */
.fine, .illustration-note, .chat-note, .footer { font-size: 14px !important; }

/* --- Запрет тёмной темы по ТЗ --- */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #FFFFFF;
    --paper: #F7F5F1;
    --ink: #1F2A2A;
    --teal: #0F5C5C;
    --teal-soft: #E6F0EE;
    --muted: #5C6B6B;
    --line: #DDE3E1;
    --warm: #E8DFD3;
    --urgent: #B86A4C;
    --success: #4A7C59;
  }
  body { background: white !important; color: #1F2A2A !important; }
  .header, .card, .service, .background-panel, .form { background: white !important; }
  .hero-panel { background: rgba(255, 255, 255, 0.94) !important; }
  .entrance { background: rgba(255, 255, 255, 0.94) !important; }
  .footer { background: var(--paper) !important; }
  input, select, textarea { background: white !important; color: #1F2A2A !important; }
  .top, .cookie-banner { background: white !important; }
}

/* --- Кнопки по ТЗ --- */
.button {
  background: var(--teal) !important;
  color: white !important;
  border: 1px solid var(--teal) !important;
  border-radius: 10px !important;
  padding: 14px 22px !important;
  min-height: 48px !important;
  font-size: 16px !important;
  font-weight: 600 !important;
}
.button:hover { background: #0a4747 !important; }
.button.secondary {
  background: transparent !important;
  color: var(--teal) !important;
  border: 1px solid var(--teal) !important;
}
.button.secondary:hover { background: var(--teal-soft) !important; }

/* Срочная кнопка (терракота) — для «Нужна неотложная помощь» */
.button.urgent, .urgent .button {
  background: var(--urgent) !important;
  border-color: var(--urgent) !important;
  color: white !important;
}
.button.urgent:hover { background: #9e5840 !important; }

/* --- Карточки СВО — тёплый фон --- */
#svo.section, #svo .section.tint {
  background: var(--warm) !important;
}
#svo .card {
  background: rgba(255, 255, 255, 0.7) !important;
  border-color: rgba(184, 106, 76, 0.2) !important;
}

/* --- Шапка: убрать "Размер", оставить только A+/A- --- */
.font-label {
  display: none !important;
}
.font-controls {
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 4px 6px !important;
}
.font-controls button {
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 8px 12px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
}

/* --- Телефоны в шапке — крупно --- */
.identity .phone {
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
}
@media (max-width: 650px) {
  .identity .phone { font-size: 17px !important; }
}

/* --- Навигация — без подчёркиваний, контрастная --- */
.navigation a {
  color: var(--ink) !important;
  font-size: 15px !important;
  font-weight: 500 !important;
}
.navigation a:hover, .navigation a.is-active {
  color: var(--teal) !important;
}

/* --- Карточки — softer тени --- */
.card, .service, .background-panel, .map-card {
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  background: white !important;
  box-shadow: 0 1px 3px rgba(31, 42, 42, 0.04) !important;
}

/* --- Чат-виджет по ТЗ --- */
.chat-launcher {
  background: var(--teal) !important;
  color: white !important;
  border: 0 !important;
  border-radius: 28px !important;
  padding: 12px 18px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  min-height: 48px !important;
  box-shadow: 0 4px 14px rgba(15, 92, 92, 0.25) !important;
}
.chat-launcher img {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
}

/* Убираем пульсацию по ТЗ (запрещены мигания) */
.chat-launcher:not(.is-opened) {
  animation: none !important;
}

/* Чат-панель — без длинного дисклеймера в шапке */
.chat-panel {
  background: white !important;
  border-radius: 16px !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 12px 36px rgba(31, 42, 42, 0.18) !important;
}
.chat-header {
  background: var(--teal) !important;
  color: white !important;
  padding: 16px 20px !important;
  border-radius: 16px 16px 0 0 !important;
}
.chat-header h2 { color: white !important; font-size: 18px !important; margin: 0 !important; }
.chat-header small { color: rgba(255,255,255,0.85) !important; }
.chat-close {
  background: rgba(255,255,255,0.15) !important;
  color: white !important;
  border: 0 !important;
  border-radius: 8px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
}

/* Скрыть длинный дисклеймер в шапке чата */
.chat-note {
  font-size: 13px !important;
  color: var(--muted) !important;
  margin: 0 0 12px !important;
}

/* --- Вкладки чата (новые по ТЗ) --- */
.chat-tabs {
  display: flex !important;
  border-bottom: 2px solid var(--line) !important;
  margin-bottom: 16px !important;
}
.chat-tab {
  flex: 1 !important;
  padding: 12px !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  color: var(--muted) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: color 0.2s, border-color 0.2s !important;
  margin-bottom: -2px !important;
}
.chat-tab.is-active {
  color: var(--teal) !important;
  border-bottom-color: var(--teal) !important;
}
.chat-tab:hover {
  color: var(--teal) !important;
}
.chat-tabpanel { display: none !important; }
.chat-tabpanel.is-active { display: block !important; }

/* --- Краткий дисклеймер внизу виджета --- */
.chat-disclaimer {
  padding: 8px 12px !important;
  font-size: 12px !important;
  color: var(--muted) !important;
  background: var(--paper) !important;
  border-radius: 8px !important;
  text-align: center !important;
  margin-top: 12px !important;
}

/* --- Гарантии — успех зелёный --- */
.status-badge.is-open { background: var(--teal-soft) !important; color: var(--success) !important; }
.status-badge.is-closed { background: #fbeae5 !important; color: var(--urgent) !important; }
.status-badge.is-urgent { background: #fff3e0 !important; color: #8a4a30 !important; }

/* --- Skip-link — по ТЗ первая ссылка --- */
.skip {
  position: fixed !important;
  top: -100px !important;
  left: 16px !important;
  z-index: 100 !important;
  background: white !important;
  padding: 12px 18px !important;
  border: 2px solid var(--teal) !important;
  border-radius: 8px !important;
  color: var(--teal) !important;
  font-weight: 600 !important;
  transition: top 0.2s !important;
}
.skip:focus { top: 12px !important; }

/* --- Убираем все эмодзи из контента --- */
.chat-launcher-icon,
.utility::before,
.section::before {
  content: none !important;
}

/* --- Запрет градиентов с переливом --- */
.scroll-progress {
  background: var(--teal) !important;
}

/* --- Footer — спокойный --- */
.footer {
  background: var(--paper) !important;
  color: var(--muted) !important;
  padding: 32px 0 !important;
  font-size: 14px !important;
}
.footer a { color: var(--teal) !important; }

/* --- Focus-visible — по ТЗ видимая обводка --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--teal) !important;
  outline-offset: 2px !important;
  border-radius: 4px !important;
}

/* --- Анимации по ТЗ: 400-500 мс, ease-out, один раз --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Ссылка "Запросить обратный звонок" --- */
.chat-switch-link {
  margin: 12px 0 0 !important;
  text-align: center !important;
  font-size: 13px !important;
}
.chat-switch-link a {
  color: var(--teal) !important;
  text-decoration: underline !important;
  cursor: pointer !important;
}
.chat-switch-link a:hover {
  color: #0a4747 !important;
}

/* --- Статус во вкладке обратного звонка --- */
#chat-callback-status {
  margin: 8px 0 0 !important;
  font-size: 13px !important;
  color: var(--muted) !important;
}

/* --- Чат-контент — отступы --- */
.chat-content {
  padding: 16px 18px !important;
}

/* --- Поля форм в чате — крупнее --- */
.chat-compose textarea,
#chat-contact-form input {
  font-size: 16px !important;
  padding: 12px 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  min-height: 44px !important;
}
.chat-compose textarea:focus,
#chat-contact-form input:focus {
  border-color: var(--teal) !important;
  outline: 2px solid var(--teal-soft) !important;
}

/* --- Кнопка Отправить в чате --- */
.chat-action {
  background: var(--teal) !important;
  color: white !important;
  border: 0 !important;
  border-radius: 8px !important;
  padding: 14px 20px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  min-height: 48px !important;
  cursor: pointer !important;
  margin-top: 8px !important;
}
.chat-action:hover { background: #0a4747 !important; }
.chat-action:disabled { opacity: 0.6 !important; cursor: wait !important; }

/* --- Логотип в шапке — зуб с улыбкой --- */
.mark {
  border-radius: 12px !important;
  background: transparent !important;
}

/* --- Hero — без параллакса, статичный фон по ТЗ --- */
.hero {
  background-attachment: scroll !important;
}

/* --- Запрет мигания и вращения --- */
@keyframes chatPulse { 0%,100%{} }
@keyframes installPulse { 0%,100%{} }

/* --- КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ: все секции ВСЕГДА видимы ---
   Убираем opacity:0 от motion-ready, которое скрывало половину сайта. */
.section,
[data-reveal],
[data-reveal-repeat],
.sitemap__group {
  opacity: 1 !important;
  transform: none !important;
}
body.motion-ready .section[data-reveal],
body.motion-ready [data-reveal],
body.motion-ready [data-reveal-repeat],
body.motion-ready .sitemap__group {
  opacity: 1 !important;
  transform: none !important;
}

/* --- Emergency блок — крупные номера 112/103 --- */
.emergency-block {
  grid-column: 1 / -1;
  background: rgba(184, 106, 76, 0.08);
  border-left: 4px solid var(--urgent);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 12px;
}
.emergency-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
}
.emergency-phones {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.emergency-phone {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 56px;
  padding: 0 20px;
  background: var(--urgent);
  color: white !important;
  font-size: 28px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 12px;
  transition: background 0.2s, transform 0.2s;
}
.emergency-phone:hover {
  background: #9e5840;
  transform: translateY(-1px);
}
.emergency-or {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
.emergency-note {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
}
@media (max-width: 650px) {
  .emergency-phone {
    min-width: 64px;
    height: 48px;
    font-size: 24px;
    padding: 0 16px;
  }
}

/* --- О поликлинике — убираю фоновую плашку слева, делаю чище --- */
#about.about-background {
  background-image: none !important;
}
#about .background-panel {
  background: white !important;
  border: 1px solid var(--line) !important;
  padding: 32px !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 3px rgba(31, 42, 42, 0.04) !important;
}

/* --- Список цен — компактный --- */
.price-list {
  margin: 16px 0;
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.price-row:last-child {
  border-bottom: 0;
}
.price-row span {
  color: var(--ink);
  flex: 1;
}
.price-row strong {
  color: var(--teal);
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- Единый дисклеймер об ИИ-иллюстрациях в footer --- */
.ai-disclaimer {
  background: var(--paper);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13px;
  color: var(--muted);
  border-left: 3px solid var(--teal);
}
.ai-disclaimer strong {
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}
