/* ---------- Шапка ---------- */

.header {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  width: min(100% - 40px, var(--page));
  margin-inline: auto;
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 74px;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink);
  min-height: 44px; }
.logo__mark { color: var(--indicator); display: flex; }
.logo__name {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem; letter-spacing: 0.01em; line-height: 1.1;
}
.logo__kind {
  display: block; font-size: 0.75rem; color: var(--ink-faint);
  letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}

.nav { margin-left: auto; }
.nav__list { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.nav__item { margin: 0; }
.nav__link {
  color: var(--ink-soft); text-decoration: none; font-size: var(--text-sm);
  padding-block: 6px; border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.nav__link:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.nav__link--active { color: var(--indicator); border-bottom-color: var(--indicator); }

.header__tools { display: flex; align-items: center; gap: 10px; }
.header__phone {
  font-family: var(--font-display); font-weight: 500; font-size: 0.95rem;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.header__phone:hover { color: var(--indicator); }

.iconbtn {
  width: 44px; height: 44px; display: grid; place-items: center; flex: none;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-s);
  color: var(--ink-soft); cursor: pointer; font-size: 1rem;
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.iconbtn:hover { border-color: var(--indicator); color: var(--indicator); }
.iconbtn[aria-pressed="true"] { border-color: var(--indicator); color: #fff; background: var(--indicator); }

.burger {
  display: none; width: 44px; height: 44px; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: transparent; cursor: pointer;
  padding: 12px 11px; flex-direction: column; justify-content: space-between;
}
.burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 1100px) {
  .nav { display: none; }
  .burger { display: flex; }
  .header__inner { min-height: 64px; }
}
@media (max-width: 560px) {
  .header__phone { display: none; }
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: var(--radius-s);
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 500;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease),
              border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn--primary { background: var(--indicator); color: #fff; }
.btn--primary:hover { background: var(--indicator-deep); color: #fff; transform: translateY(-1px); }
.btn--primary:active { transform: none; }
.btn--primary:disabled { background: var(--paper-deep); color: var(--ink-faint); cursor: not-allowed; transform: none; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
/* Тёмных поверхностей три: секция, герой и шапка внутренней страницы.
   Забыть любую из них — значит получить тёмный текст на тёмном фоне. */
.section--steel .btn--ghost, .hero .btn--ghost, .pagehead .btn--ghost, .cookie .btn--ghost {
  color: var(--ink-on-steel); border-color: var(--line-steel);
}
.section--steel .btn--ghost:hover, .hero .btn--ghost:hover,
.pagehead .btn--ghost:hover, .cookie .btn--ghost:hover { border-color: var(--ink-on-steel); }

.btn--sm { min-height: 40px; padding: 0 16px; font-size: 0.875rem; }

/* ---------- Формы ---------- */

.form { max-width: 560px; }
.form__lead { color: var(--ink-soft); font-size: var(--text-sm); margin-bottom: var(--s-3); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }

.field { display: block; }
.field__label {
  display: block; font-size: var(--text-xs); color: var(--ink-soft);
  margin-bottom: 6px; letter-spacing: 0.02em;
}
.field__input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--paper-white); color: var(--ink);
  font-family: var(--font-text); font-size: 1rem;
  transition: border-color var(--fast) var(--ease);
}
.field__input::placeholder { color: var(--ink-faint); }
.field__input:focus { border-color: var(--indicator); outline: none; box-shadow: 0 0 0 3px var(--indicator-wash); }
.field__input[aria-invalid="true"] { border-color: #9c2a2a; }

.consent {
  display: flex; gap: 12px; align-items: flex-start;
  margin: var(--s-3) 0; font-size: var(--text-sm); color: var(--ink-soft);
  border-left: 1px solid var(--line-strong); padding-left: 14px;
}
.consent input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--indicator); flex: none; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form__submit { width: 100%; }
.form__status { margin-top: var(--s-2); font-size: var(--text-sm); min-height: 1.4em; }
.form__status--ok { color: var(--indicator); }
.form__status--err { color: #9c2a2a; }

@media (max-width: 560px) {
  .form__row { grid-template-columns: 1fr; }
}

.anketa { max-width: 560px; }
.anketa__q { border-top: 1px solid var(--line); padding: var(--s-2) 0 var(--s-1);
  display: flex; flex-wrap: wrap; gap: 8px; }
.anketa__legend { flex: 1 0 100%; font-family: var(--font-display); font-size: 0.95rem; margin: 0 0 4px; }
.anketa__opt {
  min-height: 44px; padding: 0 14px; cursor: pointer;
  background: var(--paper-white); color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: var(--radius-pill);
  font-family: var(--font-text); font-size: var(--text-sm);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}
.anketa__opt:hover { border-color: var(--ink); color: var(--ink); }
.anketa__opt[aria-checked="true"] {
  background: var(--indicator); border-color: var(--indicator); color: #fff;
}
.anketa__send { margin-top: var(--s-3); }

.callbox {
  max-width: 560px; border: 1px solid var(--line-strong); border-radius: var(--radius-m);
  padding: var(--s-3); background: var(--paper-white);
}
.section--steel .callbox { background: var(--steel-lift); border-color: var(--line-steel); }
.callbox__lead { font-size: var(--text-lead); margin-bottom: var(--s-2); }
.callbox__btn { width: 100%; }
.callbox__note { margin-top: var(--s-2); font-size: var(--text-xs); color: var(--ink-faint); }
.section--steel .callbox__note { color: var(--ink-on-steel-soft); }

/* ---------- Подвал ---------- */

.footer { background: var(--steel); color: var(--ink-on-steel-soft); padding-top: var(--s-5); }
.footer__inner {
  width: min(100% - 40px, var(--page)); margin-inline: auto;
  display: grid; grid-template-columns: 2.2fr 1fr 1.4fr 1fr; gap: var(--s-4);
  padding-bottom: var(--s-4);
}
.footer__org { font-family: var(--font-display); color: var(--ink-on-steel); font-size: 1.05rem; }
.footer__req { font-size: var(--text-xs); line-height: 1.65; }
.footer__head {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-on-steel); margin-bottom: var(--s-2);
}
.footer__list { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.footer__list li { margin: 0; }
/* Тач-цель не меньше 44px по высоте: ссылка подвала — такая же цель, как кнопка */
.footer__list a { display: inline-block; padding-block: 12px; }
.footer a { color: var(--ink-on-steel-soft); text-decoration-color: var(--line-steel); }
.footer a:hover { color: var(--indicator-lit); }

.footer__bottom {
  border-top: 1px solid var(--line-steel);
  padding-block: var(--s-3) var(--s-4);
}
.footer__bottom > * {
  width: min(100% - 40px, var(--page)); margin-inline: auto;
}
.footer__warn {
  color: var(--ink-on-steel); font-size: var(--text-sm);
  border-left: 2px solid var(--indicator-lit); padding-left: 12px;
}
.footer__demo {
  font-size: var(--text-xs); color: var(--ink-on-steel-soft);
  background: var(--steel-lift); border: 1px solid var(--line-steel);
  border-radius: var(--radius-s); padding: 14px 16px;
  width: min(100% - 40px, var(--page));
}
.footer__made { font-size: var(--text-xs); color: var(--ink-on-steel-soft); }

@media (max-width: 900px) {
  .footer__inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .footer__inner { grid-template-columns: 1fr; gap: var(--s-3); }
}

/* ---------- Выдвижное меню (вынесено из шапки: backdrop-filter и transform
     в шапке создают containing block и ломают position: fixed) ---------- */

.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer::before {
  content: ''; position: absolute; inset: 0; background: rgba(12, 18, 16, 0.55);
}
.drawer__panel {
  position: absolute; inset: 0 0 0 auto; width: min(88vw, 380px);
  background: var(--paper); padding: var(--s-3);
  display: flex; flex-direction: column; gap: var(--s-2);
  overflow-y: auto;
}
.drawer__close {
  align-self: flex-end; width: 44px; height: 44px; border: 1px solid var(--line);
  background: transparent; border-radius: var(--radius-s); cursor: pointer; font-size: 1rem;
}
.drawer__list { list-style: none; margin: 0; padding: 0; }
.drawer__list li { margin: 0; border-bottom: 1px solid var(--line); }
.drawer__list a {
  display: block; padding: 14px 4px; color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-size: 1.05rem;
}
.drawer__list a:hover { color: var(--indicator); }
.drawer__call { margin-top: auto; }

/* ---------- Поиск по сайту (Приложение № 2 приказа Минздрава № 118н) ---------- */

.search { position: fixed; inset: 0; z-index: 70; }
.search::before {
  content: ''; position: absolute; inset: 0; background: rgba(12, 18, 16, 0.6);
}
.search__panel {
  position: relative; width: min(100% - 32px, 720px); margin: 8vh auto 0;
  background: var(--paper); border-radius: var(--radius-m); padding: var(--s-3);
  max-height: 78vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow-panel);
}
.search__head { display: flex; gap: 12px; align-items: center; }
.search__field { flex: 1; }
.search__input {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--paper-white); font-family: var(--font-text); font-size: 1rem;
}
.search__input:focus { border-color: var(--indicator); outline: none; }
.search__results { margin-top: var(--s-2); overflow-y: auto; }
.search__hit { display: block; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; }
.search__hit strong { display: block; color: var(--ink); font-family: var(--font-display); }
.search__hit span { display: block; color: var(--ink-soft); font-size: var(--text-sm); }
.search__hit mark { background: var(--indicator-wash); color: var(--indicator-deep); }
.search__empty { color: var(--ink-soft); font-size: var(--text-sm); padding-top: 12px; }

/* ---------- Cookie ---------- */

/* Уведомление стоит в потоке первой полосой страницы, а не всплывает над контентом:
   фиксированная плашка на 360px накрывает интерактив (в нашем случае — зубы на схеме),
   и до перекрытого нельзя дотянуться, пока баннер не закрыт. */
.cookie {
  background: var(--steel); color: var(--ink-on-steel);
  padding: var(--s-2) 20px; border-bottom: 1px solid var(--line-steel);
}
.cookie__inner {
  width: min(100%, var(--page)); margin-inline: auto;
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
}
.cookie__text { flex: 1 1 320px; font-size: var(--text-sm); margin: 0; }
.cookie__text a { color: var(--indicator-lit); }
.cookie__actions { display: flex; gap: 10px; flex: 0 1 auto; }
.cookie__actions .btn--ghost { color: var(--ink-on-steel); border-color: var(--line-steel); }
/* Обе кнопки одного размера: неравнозначность выбора — то, к чему возникают претензии
   в первую очередь. И обе не мельче 44px по высоте. */
.cookie__actions .btn { flex: 1 1 0; min-width: 132px; min-height: 48px; }
