/* Повторяющиеся детали: кнопки, значки, звёзды */

/* ── Кнопка ───────────────────────────────────────────────
   Объём делается тремя слоями: градиент сверху вниз,
   тёмная нижняя грань и двойная тень под кнопкой. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  /* поля симметричные: справа больше нет кружка со стрелкой */
  padding: 22px 40px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 21px;
  line-height: 1;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

/* Золото сохраняет фирменный характер; тёмная надпись читается на всём градиенте. */
.btn--gold {
  color: var(--ink);
  background: linear-gradient(180deg, #f7dc8a, var(--gold) 55%, #e5b12b);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 1px 2px rgba(120, 80, 20, .22),
    0 8px 18px rgba(180, 130, 50, .22);
}

.btn--gold:hover {
  transform: translateY(-1px);
  filter: saturate(1.06) brightness(1.03);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 2px 4px rgba(140, 105, 10, .24),
    0 14px 30px rgba(205, 160, 30, .42);
}

.btn--gold:active { transform: translateY(1px); }

/* Стрелка: белый кружок, сама стрелка приглушённо-синяя, как в макете */
.btn__arrow {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: #fff;
  color: #5b6270;
  box-shadow: 0 1px 2px rgba(110, 82, 8, .22);
}

/* ── Значок Яндекса: оригинальный знак картинкой ──────── */
.ya-mark {
  display: block;
  width: 40px; height: 40px;
  flex: 0 0 40px;
  object-fit: contain;
}

/* в карточках отзывов знак мелкий */
.ya-mark--sm { width: 22px; height: 22px; flex-basis: 22px; }

.stars { display: inline-flex; }

/* ── Карточка ─────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--sh-card);
  transition: transform .2s ease, box-shadow .2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-hover);
}

/* ── Круглая стрелка в карточках направлений ──────────── */
.btn--sm { padding: 13px 22px; font-size: var(--fs-body); }
.btn--sm .btn__arrow { width: 28px; height: 28px; flex-basis: 28px; }

.arrow-pill {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  transition: background .18s ease, color .18s ease;
}

.card:hover .arrow-pill { background: var(--gold); color: #fff; }

/* Стрелка, которой некуда листать */
.slider-arrow[disabled] {
  opacity: .35;
  cursor: default;
  box-shadow: none;
}
.slider-arrow[disabled]:hover { transform: none; }

/* ── Окно записи ──────────────────────────────────────── */
.modal {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
/* прокрутка внутри окна не «пробивает» страницу под ним */
.modal { overscroll-behavior: contain; }

.modal::backdrop {
  background: rgba(10, 40, 50, .45);
  backdrop-filter: blur(3px);
}
/* появление снизу вверх — окно «выезжает», а не мигает */
.modal[open] { animation: modal-in .22s cubic-bezier(.2, 0, .2, 1); }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .modal[open] { animation: none; }
}

.modal__card {
  position: relative;
  padding: 38px 38px 30px;
  border-radius: var(--r-lg);
  background: linear-gradient(168deg, #fff 0%, #fff 62%, #f2fafc 100%);
  box-shadow: 0 4px 12px rgba(10, 40, 50, .12), 0 30px 70px rgba(10, 40, 50, .28);
}
.modal__close {
  position: absolute;
  top: 16px; right: 16px;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f7;
  color: var(--text);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.modal__close:hover { background: var(--brand); color: #fff; }

.modal__title {
  font-family: var(--font-display);
  font-size: 34px;
  padding-right: 30px;
  color: var(--ink);
  line-height: 1.05;
}
.modal__lead {
  margin-top: 12px;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--text);
}
.modal__phone {
  margin-top: 16px;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--muted);
}
.modal__phone a { display: inline-block; white-space: nowrap; font-weight: 700; color: var(--ink); }
.modal__phone a:hover { color: var(--brand); }

/* ── Поля формы ───────────────────────────────────────── */
.field { display: block; margin-top: 18px; }
.field__label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--fs-tiny);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.field__input {
  width: 100%;
  padding: 14px 18px;
  font: inherit;
  font-size: var(--fs-body);
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field__input::placeholder { color: var(--muted); }
.field__input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(5, 188, 211, .16);
}

.field--check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 20px;
  font-size: var(--fs-tiny);
  line-height: 1.5;
  color: var(--muted);
}
.field--check input {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  margin-top: 1px;
  accent-color: var(--brand);
}
.field--check a { color: var(--brand-deep); text-decoration: underline; }

.btn--wide { width: 100%; margin-top: 22px; justify-content: center; }

.form__status {
  margin-top: 14px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}
.form__status--ok  { color: #0a8a3f; }
.form__status--err { color: #c2432c; }
.form__status a { color: inherit; font-weight: 700; text-decoration: underline; }

@media (max-width: 560px) {
  .modal__card { padding: 30px 22px 24px; }
  .modal__title { font-size: 27px; }
}

/* ── Просмотр фотографий ──────────────────────────────────
   Снимок вписывается в экран целиком: вертикальные кадры не обрезаются,
   горизонтальные не упираются в края. */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  border: 0;
  background: transparent;
  overscroll-behavior: contain;
}
.lightbox::backdrop {
  background: rgba(6, 24, 30, .88);
  backdrop-filter: blur(4px);
}
.lightbox[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 2vw, 28px);
  padding: clamp(16px, 4vw, 48px);
  animation: lightbox-in .2s ease;
}
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(.985); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lightbox[open] { animation: none; }
}

.lightbox__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 0;
  margin: 0;
}
.lightbox__stage img {
  max-width: 100%;
  /* оставляем место подписи, иначе она уезжает за нижний край */
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
  border-radius: var(--r-md);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  cursor: default;
}
.lightbox__stage figcaption {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: var(--fs-small);
  color: rgba(255, 255, 255, .82);
  text-align: center;
}
.lightbox__counter {
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .5);
}

.lightbox__nav,
.lightbox__close {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, .13);
  cursor: pointer;
  transition: background .16s ease, transform .16s ease;
}
.lightbox__nav { width: 56px; height: 56px; }
.lightbox__nav:hover { background: var(--brand); transform: scale(1.06); }

.lightbox__close {
  position: absolute;
  top: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
  width: 46px; height: 46px;
}
.lightbox__close:hover { background: var(--brand); }

@media (max-width: 760px) {
  /* На узком экране стрелки под снимком: по бокам они закрывают сам кадр */
  .lightbox[open] {
    grid-template-columns: 1fr;
    grid-template-areas: 'stage' 'nav';
    align-content: center;
    justify-items: center;
    gap: 20px;
  }
  .lightbox__stage { grid-area: stage; }
  .lightbox__stage img { max-height: calc(100vh - 260px); }
  .lightbox__nav { width: 50px; height: 50px; }
  /* обе кнопки в одной ячейке: центрируем и разводим отступами,
     иначе justify-self прижимает их к краям и они меняются местами */
  .lightbox__nav--prev { grid-area: nav; justify-self: center; margin-right: 96px; }
  .lightbox__nav--next { grid-area: nav; justify-self: center; margin-left: 96px; }
}

/* ── Пульсация главной кнопки ──────────────────────────────
   Кнопка первого экрана мягко «дышит»: движение притягивает взгляд,
   но не дёргает страницу — меняются только масштаб и тень, а они
   не заставляют браузер пересчитывать раскладку. */
@keyframes fm-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .55),
      0 1px 2px rgba(120, 80, 20, .22),
      0 8px 18px rgba(180, 130, 50, .30);
  }
  50% {
    transform: scale(1.032);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .55),
      0 2px 4px rgba(120, 80, 20, .26),
      0 14px 30px rgba(200, 150, 40, .42);
  }
}

.hero__cta {
  animation: fm-pulse 2.4s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
}

/* под курсором пульсация мешает попасть по кнопке — останавливаем */
.hero__cta:hover,
.hero__cta:focus-visible {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .hero__cta { animation: none; }
}
/* Подтверждение выбранной услуги и управление галереями. */
.modal__service { margin-bottom: 16px; color: var(--brand-deep); font-weight: 600; overflow-wrap: anywhere; }
.modal__service:empty { display: none; }
.doctor-docs-link, .slider-toggle {
  min-height: 44px; padding: 8px 0; color: var(--brand-deep);
  text-decoration: underline; text-underline-offset: 4px;
  font-size: 14px; line-height: 1.4;
}
.doctor-docs-link { display: block; margin-top: 6px; text-align: left; }
.slider-toggle {
  display: flex; align-items: center; gap: 9px; margin: 18px auto 24px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--card); text-decoration: none; font-weight: 600;
}
.slider-toggle::before {
  content: ''; width: 9px; height: 11px; border-inline: 3px solid currentColor;
}
.slider-toggle[aria-pressed="true"]::before {
  width: 0; height: 0; border: 6px solid transparent;
  border-left: 9px solid currentColor; border-right: 0;
}
.slider-toggle:hover { background: var(--glow); }
