/* Дополнения к css/a.css старого сайта (сам a.css не меняется). */

/* Кнопка «Скопировать» рядом с телефоном и почтой в шапке (AGENTS.md). Без JS скрыта: копирует scripts/copy.ts. */
.copy-button {
  display: none;
  position: relative;
  margin: 0 0 0 0.35em;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  line-height: 0;
  vertical-align: -0.12em;
  opacity: 0.6;
  cursor: pointer;
}
.js .copy-button {
  display: inline-block;
}
.copy-button:hover,
.copy-button:focus-visible {
  opacity: 1;
}
.copy-button svg {
  width: 1em;
  height: 1em;
}
.copy-button.is-copied::after {
  content: 'Скопировано';
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  padding: 3px 6px;
  border-radius: 3px;
  background-color: #333;
  color: #fff;
  font: 12px/1.3 Arial, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

/* Кнопка «Получить расчёт», пока заявка отправляется (scripts/forms.ts): .disabled из Bootstrap делает её бледной */
[data-calc-submit].disabled {
  cursor: progress;
}

/* Форма ДМС: карточка и плитки выбора по решению владельца 02.11.2026. */
#calc_med {
  position: relative;
  padding: 20px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
  color: #3a3a3a;
}
/* «скрыть» в углу карточки на уровне «Для кого ДМС» (решение владельца 03.11.2026): видна только у раскрытой формы. */
/* z-index: колонка Bootstrap .col-12 с легендой идёт в разметке позже и тоже position: relative, без него
   она ложится поверх кнопки и забирает клик. */
#calc_med .calc-med-collapse {
  position: absolute;
  z-index: 1;
  top: 22px;
  right: 20px;
  padding: 0;
  border: 0;
  border-bottom: 1px dashed currentColor;
  background: none;
  color: #777;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}
#calc_med .calc-med-collapse:hover {
  color: #3a3a3a;
}
#calc_med .calc-med-collapse:focus-visible {
  outline: 2px solid #3a3a3a;
  outline-offset: 2px;
}
#calc_med .form-group {
  margin-bottom: 16px;
}
#calc_med > .form-group {
  margin-bottom: 0;
}
#calc_med .calc-med-fields {
  padding-top: 16px;
}
#calc_med .calc-med-fields > .form-group:last-child {
  margin-bottom: 0;
}
/* Без JS все поля видны. Открывает класс is-open из forms.ts, не :has: в браузере без :has форма иначе не раскроется. */
.js #calc_med .calc-med-reveal {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
}
.js #calc_med .calc-med-reveal-inner {
  min-height: 0;
  overflow: hidden;
}
/* Переходы включаются только при выборе: загрузка и возврат из истории без анимации. */
.js #calc_med.calc-med-animate .calc-med-reveal {
  transition: grid-template-rows 250ms ease, opacity 250ms ease, visibility 0s 250ms;
}
.js #calc_med .calc-med-reveal.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
#calc_med label:not(.form-check-label),
#calc_med legend,
#calc_med .calc-med-label {
  margin-bottom: 6px;
  color: #3a3a3a;
  font-size: 15px;
  line-height: 1.4;
}
#calc_med .calc-med-required {
  color: #777;
}
#calc_med .form-control {
  height: 46px;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  color: #3a3a3a;
  font-size: 16px;
  line-height: 1.5;
}
#calc_med .form-control::placeholder {
  color: #9a9a9a;
  opacity: 1;
}
#calc_med select.form-control {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23777' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}
#calc_med select:required:invalid {
  color: #9a9a9a;
}
#calc_med select option {
  color: #3a3a3a;
}
#calc_med textarea.form-control {
  height: auto;
  min-height: 100px;
  resize: vertical;
}
#calc_med .form-control:focus {
  border-color: #777;
  box-shadow: 0 0 0 3px rgb(254 227 81 / 35%);
}
#calc_med .form-control.is-invalid,
#calc_med .calc-med-audience.is-invalid label {
  border-color: #c0392b;
}
#calc_med input.form-control.is-invalid,
#calc_med textarea.form-control.is-invalid {
  background-image: none;
}
#calc_med .calc-error {
  color: #c0392b !important;
  font-size: 14px;
  line-height: 1.4;
}
#calc_med .form-check {
  padding-left: 24px;
  margin-bottom: 8px;
}
#calc_med .form-check-input {
  width: 16px;
  height: 16px;
  margin-left: -24px;
  accent-color: #3a3a3a;
}
#calc_med .form-check-label {
  color: #3a3a3a;
  font-size: 15px;
  line-height: 1.4;
}
#calc_med .form-text {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
}
#calc_med [data-calc-submit] {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border-radius: 6px;
  background: #fee351;
  color: #3a3a3a;
  font-size: 16px;
  box-shadow: 0 2px 4px rgb(0 0 0 / 12%);
}
#calc_med [data-calc-submit]:hover {
  box-shadow: 0 3px 6px rgb(0 0 0 / 20%);
}
#calc_med [data-calc-submit]:focus-visible {
  outline: 2px solid #3a3a3a;
  outline-offset: 3px;
}
#calc_med .calc-med-audience {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
/* Подсказка под плитками: после выбора сворачивается, и на её месте раскрываются поля, плитки не сдвигаются. */
#calc_med .calc-med-hint {
  max-height: 3em;
  margin: 10px 0 0;
  overflow: hidden;
  color: #777;
  font-size: 14px;
  line-height: 1.4;
}
.js #calc_med .calc-med-hint.is-hidden {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
}
.js #calc_med.calc-med-animate .calc-med-hint {
  transition: max-height 250ms ease, margin-top 250ms ease, opacity 200ms ease;
}
/* Две равные плитки даже на экране 320 px; длинная подпись переносится внутри своей колонки. */
#calc_med .calc-med-options {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#calc_med .calc-med-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
#calc_med .calc-med-options label {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Сверху, а не по центру: подписи в одну и две строки, иконки должны стоять на одной высоте */
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 14px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  cursor: pointer;
}
#calc_med .calc-med-icon {
  flex: none;
  width: 24px;
  height: 24px;
}
/* Кружок повторяет состояние нативного радио; управление стрелками и Tab остаётся браузерным. */
#calc_med .calc-med-options label::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 16px;
  height: 16px;
  border: 1px solid #777;
  border-radius: 50%;
  background: #fff;
}
#calc_med .calc-med-options input:checked + label {
  border-color: #d6b832;
  background-color: #fee351;
}
#calc_med .calc-med-options input:checked + label::after {
  border-color: #3a3a3a;
  background: #3a3a3a;
  box-shadow: inset 0 0 0 3px #fff;
}
#calc_med .calc-med-options label:hover {
  border-color: #8a7625;
  box-shadow: 0 0 0 1px #8a7625;
}
#calc_med .calc-med-options input:focus-visible + label {
  outline: 2px solid #3a3a3a;
  outline-offset: 3px;
}
#calc_med .calc-med-options input:disabled + label {
  opacity: 0.65;
  cursor: progress;
}
@media (prefers-reduced-motion: no-preference) {
  .js #calc_med.calc-med-nudge .calc-med-options label {
    animation: calc-med-nudge 800ms ease-in-out 2;
  }
}
@keyframes calc-med-nudge {
  0%, 100% {
    border-color: #ccc;
    box-shadow: 0 0 0 0 rgb(254 227 81 / 0%);
  }
  50% {
    border-color: #d6b832;
    box-shadow: 0 0 0 3px rgb(254 227 81 / 30%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .js #calc_med.calc-med-animate :is(.calc-med-reveal, .calc-med-hint) {
    transition: none;
  }
}
@media (max-width: 575.98px) {
  #calc_med {
    padding: 16px;
  }
  #calc_med .calc-med-collapse {
    top: 18px;
    right: 16px;
  }
}

/* Пустой выбор города серым, как подсказки в соседних полях; варианты списка обычным цветом. */
select[name="Город"]:invalid {
  color: #6c757d;
}
select[name="Город"] option {
  color: #212529;
}

/* Общая типографика текстовых страниц. Ширины внешней колонки и сайдбара — из a.css.
   .kind-html-text остаётся исключительно маркером редакционных проверок. */
.text-main { min-width: 0; }
.text-column {
  width: 100%;
  max-width: 720px;
  min-width: 0;
  margin: 0;
  display: flow-root;
}
.zagol > h1 {
  max-width: 720px;
  margin-left: 0;
  padding-right: 0;
}
.prose, .text-aux {
  color: #3a3a3a;
  font-size: 17px;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: break-word;
}
.prose :is(h2, h3, h4, h5, h6, p),
.text-aux :is(h2, h3, p) {
  padding: 0;
  margin-left: 0;
  color: inherit;
}
.prose p, .text-aux p {
  margin: 0 0 0.9em;
  font-size: inherit;
  line-height: inherit;
}
.prose h2 {
  margin: 32px 0 12px;
  font-size: 25px !important;
  line-height: 1.25;
  font-weight: 600;
}
.prose h3 {
  margin: 24px 0 10px;
  font-size: 20px !important;
  line-height: 1.3;
  font-weight: 600;
}
.prose :is(h4, h5, h6) {
  margin: 20px 0 8px;
  font-size: 18px;
  line-height: 1.3;
}
.prose > :first-child { margin-top: 0; }
/* Старые font/align и стили Word не задают отдельный кегль и отступы. */
.prose font, .prose span[style] {
  font-family: inherit !important;
  font-size: inherit !important;
  line-height: inherit !important;
  color: inherit !important;
}
.prose :is(p, ul, ol, li)[style], .prose [align] {
  text-align: left !important;
  text-indent: 0 !important;
}
.prose p[style] {
  margin: 0 0 0.9em !important;
  padding: 0 !important;
  font-size: inherit !important;
  line-height: inherit !important;
}
/* Маркеры снаружи; перенос строки пункта остаётся под его текстом. */
.prose :is(ul, ol) {
  margin: 0 0 0.9em !important;
  padding: 0 0 0 1.25em !important;
}
.prose li, .text-aux li {
  margin: 0 0 0.5em;
  line-height: 1.5;
}
.prose li > :is(ul, ol) { margin-top: 0.5em !important; }
/* nl2br между элементами старых списков не добавляет пустые строки. */
.prose :is(ul, ol) > br { display: none; }
.prose a, .text-aux a {
  color: #365f73;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: #a3b6bf;
  text-underline-offset: 0.18em;
}
.prose .phone { white-space: nowrap; }
.prose a:hover, .prose a:focus-visible,
.text-aux a:hover, .text-aux a:focus-visible {
  color: #234758;
  text-decoration-color: currentColor;
}
.text-column img { max-width: 100%; height: auto; }
/* Иллюстрация отдельным блоком: у абзацев один левый край. */
.text-column img[style*="float"] {
  float: none !important;
  display: block;
  margin: 0 0 16px !important;
}
/* Прокручивается только таблица, включая широкие старые таблицы с width/style. */
.text-table {
  max-width: 100%;
  margin: 0 0 1.2em;
  overflow-x: auto;
}
.prose table {
  width: 100% !important;
  margin: 0 !important;
  border-collapse: collapse;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
.prose :is(th, td) {
  padding: 10px 16px 10px 0 !important;
  border-top: 0;
  border-bottom: 1px solid #ddd;
  text-align: left;
  vertical-align: top;
}
.prose tr > :last-child { padding-right: 0 !important; }
.prose thead th { border-bottom: 2px solid #ddd; font-weight: 600; }
/* Ссылки, тэги, источники и примечания — единый тихий служебный стиль. */
.text-aux, .prose .fact-sources {
  margin-top: 24px;
  color: #626262;
  font-size: 15px;
  line-height: 1.5;
  font-style: normal;
}
.text-aux :is(h2, h3), .prose .fact-sources h2 {
  margin: 0 0 8px;
  font-size: 16px !important;
  font-weight: 600;
  line-height: 1.4;
}
.text-aux ul, .prose :is(.text-aux, .fact-sources) ul {
  margin: 0 0 0.9em !important;
  padding: 0 !important;
  list-style: none;
}
.text-aux a, .prose :is(.text-aux, .fact-sources) a {
  color: inherit;
  text-decoration-color: #bbb;
}
/* Каталоги ссылок (разделы, архивы, КАСКО): ссылки идут через <br>, без зазора по ним трудно попасть пальцем. */
.text-directory a {
  display: inline-block;
  padding: 3px 0;
}
/* Старые тексты выделяли заголовки и слова тегом <u>: подчёркивание путают со ссылкой (владелец 03.11.2026).
   Ссылки остаются подчёркнутыми: их линию рисует сам <a>. */
.prose u, .kind-html-text u {
  text-decoration: none;
}
.text-aux i { font-style: normal; }
.text-aux + .prose { margin-top: 24px; }
.text-back {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 20px;
}
@media (max-width: 799px) {
  .prose { font-size: 16px; }
  .prose h2 { font-size: 21px !important; }
  .prose h3 { font-size: 18px !important; }
  .prose :is(.text-aux, .fact-sources) :is(h2, h3) { font-size: 16px !important; }
}

/* Пилот СОГАЗа: контакты, помощник и карта, только внутри текста этой страницы. */
.kind-html-text :is(.sogaz-contacts, .sogaz-refusal, .sogaz-offices) {
  color: #3a3a3a;
  font-size: 17px;
}
.kind-html-text .sogaz-contacts {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  background: #fff;
}
.kind-html-text .sogaz-contacts h2 {
  margin: 0 0 16px;
  font-size: 20px !important;
}
.kind-html-text .sogaz-contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 20px;
  margin-bottom: 16px;
}
.kind-html-text .sogaz-contact-row > div {
  flex: 1 1 280px;
}
.kind-html-text .sogaz-service {
  display: block;
  margin: 4px 0 0;
  color: #626262;
  font-size: 15px;
}
.kind-html-text .sogaz-phone {
  white-space: nowrap;
}
.kind-html-text .sogaz-phone .copy-button {
  z-index: 1;
  padding: 6px;
}
/* Плитки столбиком: открытая ситуация раскрывается под своей плиткой во всю ширину, соседние не прыгают. */
.kind-html-text .sogaz-refusal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.kind-html-text .sogaz-refusal-grid details {
  min-width: 0;
}
.kind-html-text .sogaz-refusal-grid summary {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  color: #3a3a3a;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
}
.kind-html-text .sogaz-refusal-grid summary::-webkit-details-marker {
  display: none;
}
.kind-html-text .sogaz-refusal-grid summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 22px;
}
.kind-html-text .sogaz-refusal-grid details[open] > summary {
  border-color: #fee351;
  background: #fee351;
}
.kind-html-text .sogaz-refusal-grid details[open] > summary::after {
  content: '−';
}
.kind-html-text .sogaz-refusal-grid ol {
  margin: 16px 0 0;
  padding-left: 1.4em;
}
.kind-html-text .sogaz-refusal-grid summary:focus-visible,
a.office-map-action:focus-visible {
  outline: 2px solid #3a3a3a;
  outline-offset: 3px;
}
.kind-html-text .sogaz-offices-list {
  padding-left: 1.6em;
}
.kind-html-text .sogaz-offices-list > li {
  margin-bottom: 20px;
  padding-left: 4px;
}
.kind-html-text .sogaz-offices-list h3 {
  margin: 0 0 8px;
}
.kind-html-text .sogaz-offices-list p {
  margin-bottom: 8px;
}
.kind-html-text .sogaz-office-meta {
  color: #626262;
  font-size: 15px;
}
.office-map-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
a.office-map-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  color: #3a3a3a;
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
a.office-map-action:hover,
a.office-map-action:focus-visible {
  border-color: #3a3a3a;
  color: #3a3a3a;
}
a.office-map-show {
  border-color: #fee351;
  background: #fee351;
}
:is(.office-map-action, .office-map)[hidden] {
  display: none;
}
.office-map {
  display: block;
  width: 100%;
  height: 360px;
  margin-top: 16px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  overflow: hidden;
}
.office-map-marker {
  position: relative;
  width: 0;
  height: 0;
  pointer-events: none;
}
.office-map-dot {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #3a3a3a;
}
.office-map-label {
  position: absolute;
  top: 0;
  left: 12px;
  padding: 5px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #3a3a3a;
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  transform: translateY(-50%);
  pointer-events: none;
}
.office-map-marker-left .office-map-label {
  right: 12px;
  left: auto;
}
@media (max-width: 599px) {
  .kind-html-text .sogaz-contacts {
    padding: 16px;
  }
  .office-map {
    height: 300px;
  }
}

/* Квиз msk-polis на всех med-kinds: обычный блок после текста, без перекрытия и пульсации.
   Специфичность выше CSS пакета и локального Quiz.astro при любом порядке подключения. */
.kind-html-quiz .qz-launcher {
  position: relative;
  inset: auto;
  z-index: auto;
  width: 100%;
  max-width: 360px;
  height: auto;
  min-height: 48px;
  margin: 24px 0;
  border-radius: 4px;
  box-shadow: none;
  opacity: 1;
}
.kind-html-quiz .qz-launcher.is-visible {
  animation: none;
}
.kind-html-quiz .qz-launcher::before,
.kind-html-quiz .qz-launcher::after {
  content: none;
}
.kind-html-quiz .qz-launcher-open {
  flex: 1;
  padding: 8px 0;
}
.kind-html-quiz .qz-launcher-icon {
  width: 40px;
  height: 32px;
  margin: 0;
}
.kind-html-quiz .qz-launcher-icon svg {
  width: 20px;
}
.kind-html-quiz .qz-launcher-body {
  padding: 0;
}
.kind-html-quiz :is(.qz-launcher-title, .qz-launcher-text) {
  white-space: normal;
}
.kind-html-quiz .qz-launcher-close {
  position: static;
  flex-shrink: 0;
  align-self: stretch;
  width: 44px;
  height: auto;
  border-radius: 0 4px 4px 0;
  background: transparent;
  color: inherit;
}
.kind-html-quiz .qz-launcher-close svg {
  width: 12px;
  height: 12px;
}
