/* =========================================================
   Kamilovs Clinic — каналы связи и состояния форм (Спринт 1)
   Использует токены из kc-redesign.css, подключается после него.
   ========================================================= */

/* ---------- Текст юридического документа ---------- */
.kc-legal {
  max-width: 780px;
  margin: 0 auto;
  color: var(--slate);
  font-size: 16px;
  line-height: 1.7;
}
.kc-legal h2 {
  margin: 34px 0 12px;
  font-size: 21px;
  line-height: 1.3;
  color: var(--ink);
}
.kc-legal h2:first-of-type {
  margin-top: 12px;
}
.kc-legal p {
  margin: 0 0 14px;
}
.kc-legal ul {
  margin: 0 0 14px;
  padding-left: 22px;
}
.kc-legal li {
  margin-bottom: 8px;
}
.kc-legal a {
  color: var(--blue-700);
  text-decoration: underline;
}
.kc-legal strong {
  color: var(--ink);
}
.kc-legal__meta {
  font-size: 14px;
  color: var(--muted);
}
.kc-legal__dl {
  margin: 0 0 14px;
  padding: 18px 20px;
  background: var(--bg-soft);
  border-radius: var(--r-md);
}
.kc-legal__dl dt {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.kc-legal__dl dd {
  margin: 2px 0 12px;
  color: var(--ink);
  font-weight: 600;
}
.kc-legal__dl dd:last-child {
  margin-bottom: 0;
}
.kc-legal__note {
  margin-top: 30px;
  padding: 16px 18px;
  border-left: 3px solid var(--blue-500);
  background: var(--blue-100);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 15px;
  color: var(--blue-900);
}

/* ---------- Карточка реквизитов на странице контактов ---------- */
.kc-legal-card__list {
  margin: 10px 0 0;
}
.kc-legal-card__list dt {
  font-size: 13px;
  color: var(--muted);
}
.kc-legal-card__list dd {
  margin: 0 0 10px;
  color: var(--ink);
}
.kc-legal-card__link {
  display: inline-block;
  margin-top: 6px;
  font-size: 14px;
  color: var(--blue-700);
  text-decoration: underline;
}

/* ---------- Блок отзывов (виджет Яндекс.Карт) ---------- */
.kc-reviews {
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.kc-reviews__frame {
  /* Высота задана заранее: iframe подгружается лениво, и без резерва
     места страница дёргалась бы в момент его появления. */
  height: 560px;
}
.kc-reviews__frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
@media (max-width: 600px) {
  .kc-reviews__frame {
    height: 620px;
  }
}

/* ---------- Галерея: <picture> не должен ломать растяжку ----------
   .kc-gallery__item img рассчитан на height:100% от ячейки грида. После
   оборачивания в <picture> родителем картинки становится он, а он inline —
   поэтому явно делаем его блоком нужного размера. */
.kc-gallery__item picture {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- Honeypot ----------
   Поле должно быть невидимым для человека, но оставаться в DOM и в отправке,
   чтобы бот его нашёл и заполнил. Часть ботов игнорирует display:none,
   поэтому уводим поле за пределы экрана. */
.kc-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Ошибка валидации поля ---------- */
.kc-field__error {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #c0392b;
}
.kc-input[aria-invalid="true"] {
  border-color: #e08074;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}

/* ---------- Панель результата отправки ---------- */
.kc-lead-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 22px;
  text-align: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}
.kc-lead-result:focus {
  outline: none;
}
.kc-lead-result:focus-visible {
  outline: 3px solid var(--blue-500);
  outline-offset: 3px;
}
.kc-lead-result h3 {
  margin: 0;
  font-size: 20px;
  color: var(--ink);
}
.kc-lead-result p {
  margin: 0;
  color: var(--slate);
  font-size: 15px;
}

.kc-lead-result__icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-pill);
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
}
.kc-lead-result__icon--ok {
  background: var(--grad);
}
.kc-lead-result__icon--err {
  background: linear-gradient(120deg, #e2725b, #c0392b);
}

.kc-lead-result__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.kc-lead-result__phone {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  background: var(--grad);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-blue);
}

/* ---------- Ссылки на мессенджеры (футер и страница контактов) ---------- */
.kc-footer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
}
.kc-social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: inherit;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.kc-social-link svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.kc-social-link:hover,
.kc-social-link:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.55);
}

/* Вариант для светлого фона — карточка на странице контактов.
   Селектор с тегом (0,1,1) нужен, чтобы перебить `.kc-contact-card a`
   из kc-redesign.css, который иначе красит ссылку в --slate. */
a.kc-social-link--light {
  border-color: var(--line);
  color: var(--blue-700);
  font-weight: 600;
}
a.kc-social-link--light:hover,
a.kc-social-link--light:focus-visible {
  background: var(--blue-100);
  border-color: var(--blue-500);
}

.kc-contact-card__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* ---------- Плавающий виджет связи ---------- */
.kc-contact-widget {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.kc-contact-widget__list {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease),
    visibility 0.25s;
}
.kc-contact-widget.is-open .kc-contact-widget__list {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.kc-contact-widget__item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--white);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}
.kc-contact-widget__item svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.kc-contact-widget__item--telegram svg {
  color: #229ed9;
}
.kc-contact-widget__item--instagram svg {
  color: #d6249f;
}
.kc-contact-widget__item:hover,
.kc-contact-widget__item:focus-visible {
  transform: translateX(-2px);
}

.kc-contact-widget__toggle {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  border-radius: var(--r-pill);
  background: var(--grad);
  color: var(--white);
  cursor: pointer;
  box-shadow: var(--shadow-blue);
  transition: transform 0.25s var(--ease);
}
.kc-contact-widget__toggle svg {
  width: 27px;
  height: 27px;
}
.kc-contact-widget__toggle:hover {
  transform: scale(1.06);
}
.kc-contact-widget.is-open .kc-contact-widget__toggle {
  transform: rotate(90deg);
}

@media (max-width: 600px) {
  .kc-contact-widget {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .kc-contact-widget__toggle {
    width: 52px;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-contact-widget__list,
  .kc-contact-widget__toggle,
  .kc-social-link {
    transition: none;
  }
  .kc-contact-widget__toggle:hover,
  .kc-contact-widget.is-open .kc-contact-widget__toggle,
  .kc-contact-widget__item:hover {
    transform: none;
  }
}
