/* ============================================================
   TESTIFY — coverflow carousel of testimonials (screen 9)
   Central focused phone + 4 receding side cards (2 left, 2 right)
   ============================================================ */

.testify {
  text-align: center;
  isolation: isolate;
}

/* Локальные blob-фоны (.testify::before/::after) удалены — фон секции
   управляется глобальной зеброй в shared.css (testify = tinted). */

/* -------- HEAD -------- */
.testify__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin: 0 auto 48px;
  max-width: 748px;
}
.testify__title {
  font-size: clamp(32px, 4.6vw, 58px);
}
.testify__lead {
  text-align: center;
  max-width: 510px;
}

/* -------- COVERFLOW STAGE -------- */
.testify__cover {
  position: relative;
  height: 612px;
  margin: 0 auto;
  user-select: none;
  /* резервируем горизонтальные жесты под наш swipe-handler — браузер не
     перехватывает их под back/forward gesture. вертикальный pan остаётся
     для скролла страницы. */
  touch-action: pan-y;
}

.testify__track {
  position: absolute;
  inset: 0 0 94px 0; /* нижний слой под caption/dots */
}

/* -------- SLIDE -------- */
.slide {
  position: absolute;
  left: 50%;
  top: 50%;       /* якорь — горизонтальная ось трека */
  width: 320px;   /* ширина фикс, высота — от картинки */
  transform: translate(-50%, -50%);
  transition: transform .55s cubic-bezier(.22,.68,.16,1),
              opacity   .45s ease,
              filter    .45s ease;
  cursor: pointer;
  will-change: transform, opacity;
}

/* slider positions: -2 -1 0 +1 +2 + far (strictly vertical, центр по оси Y) */
.slide[data-pos="0"] {
  transform: translate(-50%, -50%) scale(1.04);
  z-index: 10;
  cursor: default;
}
.slide[data-pos="-1"] {
  transform: translate(calc(-50% - 270px), -50%) scale(.78);
  opacity: .92;
  z-index: 6;
  filter: saturate(.92);
}
.slide[data-pos="1"] {
  transform: translate(calc(-50% + 270px), -50%) scale(.78);
  opacity: .92;
  z-index: 6;
  filter: saturate(.92);
}
.slide[data-pos="-2"] {
  transform: translate(calc(-50% - 460px), -50%) scale(.58);
  opacity: .55;
  z-index: 3;
  filter: saturate(.85);
}
.slide[data-pos="2"] {
  transform: translate(calc(-50% + 460px), -50%) scale(.58);
  opacity: .55;
  z-index: 3;
  filter: saturate(.85);
}
.slide[data-pos="far"] {
  transform: translate(-50%, -50%) scale(.4);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

/* -------- РЕАЛЬНЫЙ СКРИН (вариант с настоящими картинками) --------
   .slide__shot — img внутри слайда. Универсальное паспарту:
   белая рамка 6px, скруглённые углы, мягкая тень.
   object-fit: contain — скрин любого ratio влезает целиком,
   снизу/сверху доберётся белым (паспарту-эффект). */
.slide__shot {
  display: block;
  width: 100%;
  height: auto;
  /* min-height гарантирует, что очень короткий скрин (вроде «Выявила причины…» —
     340×193) всё равно занимает узнаваемый размер карточки, добирая белым паспарту.
     max-height страхует от ультра-длинных скринов, если такие появятся. */
  min-height: 380px;
  max-height: 510px;
  object-fit: contain;
  background: #fff;
  border-radius: 24px;
  padding: 5px;
  box-shadow:
    0 26px 51px -24px rgba(28, 34, 54, .28),
    0 9px 20px -9px rgba(28, 34, 54, .10);
  user-select: none;
  -webkit-user-drag: none;
}

/* halo за активным телефоном */
.slide[data-pos="0"]::before {
  content: '';
  position: absolute;
  inset: -31px -48px;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 18% 22%, rgba(255,122,69,.55), transparent 70%),
    radial-gradient(55% 60% at 82% 30%, rgba(155,95,223,.55), transparent 70%),
    radial-gradient(60% 55% at 50% 90%, rgba(233,74,161,.45), transparent 70%);
  filter: blur(27px);
  opacity: .9;
  border-radius: 51px;
}

/* -------- PHONE (внутри slide) -------- */
.phone {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: 32px;
  box-shadow:
    0 26px 51px -24px rgba(28,34,54,.28),
    0 9px 20px -9px rgba(28,34,54,.10),
    inset 0 0 0 2px rgba(28,34,54,.10);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, 'SF Pro Text', 'Inter', sans-serif;
  text-align: left;
}
/* notch */
.phone__bar {
  position: relative;
  height: 19px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.phone__bar span {
  width: 51px;
  height: 5px;
  background: #1c2236;
  border-radius: 999px;
  opacity: .85;
}

/* header */
.phone__hd {
  position: relative;
  padding: 5px 12px 7px;
  background: rgba(247, 247, 250, .92);
  border-bottom: 1px solid rgba(28,34,54,.06);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 4px 7px;
  text-align: center;
}
.phone__back {
  grid-row: 1 / 3;
  grid-column: 1;
  font-size: 12px;
  color: #2a7cf2;
  align-self: center;
  font-weight: 500;
}
.phone__title {
  grid-column: 2;
  grid-row: 1;
  font-size: 12px;
  font-weight: 600;
  color: #1c2236;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone__sparkle { color: #ffb84a; }
.phone__meta {
  grid-column: 2;
  grid-row: 2;
  font-size: 12px;
  color: #8e92a3;
  line-height: 1.2;
}
.phone__hd::after {
  /* зарезервированное место чтоб grid не схлопнулся справа */
  content: '';
  grid-column: 3;
}

/* pinned */
.phone__pinned {
  position: relative;
  background: rgba(252, 252, 254, .96);
  border-bottom: 1px solid rgba(28,34,54,.05);
  padding: 5px 27px 5px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 2px solid #2a7cf2;
}
.phone__pin-title {
  font-size: 12px;
  color: #2a7cf2;
  font-weight: 500;
}
.phone__pin-text {
  font-size: 12px;
  color: #4a4f63;
  line-height: 1.25;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.phone__pin-x {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #8e92a3;
}

/* scroll-зона (фон чата) */
.phone__scroll {
  flex: 1 1 auto;
  position: relative;
  overflow: hidden;
  padding: 12px 10px;
  /* фон по умолчанию — paper */
  background: linear-gradient(180deg, #f3ebe0, #efe4d3);
}

/* варианты фона чата */
.slide[data-bg="peach"]      .phone__scroll {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,200,170,.55), transparent 60%),
    linear-gradient(180deg, #fbe6cf, #f3d4b4);
}
.slide[data-bg="beach"]      .phone__scroll {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(94,178,184,.5), transparent 70%),
    linear-gradient(180deg, #6cc1c9, #4ea2ad 45%, #2e6f78);
}
.slide[data-bg="dark"]       .phone__scroll {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(70,70,90,.7), transparent 70%),
    linear-gradient(180deg, #2c2e3a, #15161e);
}
.slide[data-bg="mint"]       .phone__scroll {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(180,225,205,.6), transparent 60%),
    linear-gradient(180deg, #c8e8d8, #a8d7c2);
}
.slide[data-bg="paper"]      .phone__scroll {
  background:
    linear-gradient(180deg, #f3ebe0, #efe4d3);
}
.slide[data-bg="lavender"]   .phone__scroll {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(210,194,232,.55), transparent 60%),
    linear-gradient(180deg, #d8c9e6, #b9a6cf);
}
.slide[data-bg="rose"]       .phone__scroll {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255,200,210,.55), transparent 60%),
    linear-gradient(180deg, #f6cdd2, #ecb1bb);
}
.slide[data-bg="paper-warm"] .phone__scroll {
  background:
    linear-gradient(180deg, #f8dcc3, #f1c8a4);
}

/* msg bubble */
.phone__msg {
  background: rgba(255, 255, 255, .96);
  border-radius: 14px;
  padding: 9px 10px 5px;
  font-size: 12px;
  line-height: 1.42;
  color: #1c2236;
  box-shadow: 0 1px 2px rgba(28,34,54,.08);
  position: relative;
  max-width: 96%;
}
.phone__msg p { margin: 0 0 5px; }
.phone__msg p:last-of-type { margin-bottom: 12px; }
.phone__time {
  position: absolute;
  bottom: 4px;
  right: 7px;
  font-size: 12px;
  color: #8e92a3;
}

/* подсветка маркером в трёх цветах */
.phone__msg mark {
  background: rgba(255, 220, 80, .55);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.phone__msg mark.mk--y { background: rgba(255, 218, 86, .58); }
.phone__msg mark.mk--t { background: rgba(120, 220, 200, .55); }
.phone__msg mark.mk--p { background: rgba(255, 173, 200, .55); }

/* input bar */
.phone__inp {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px 10px;
  background: rgba(247, 247, 250, .96);
  border-top: 1px solid rgba(28,34,54,.05);
  font-size: 12px;
  color: #8e92a3;
}
.phone__placeholder {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------- ARROWS --------
   Визуал кнопки — общий .slider-arrow в shared.css.
   Здесь только absolute-позиционирование внутри cover и
   перекрытие hover/active transform (нужно сохранить translateY(-50%)). */
.testify__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
}
.testify__arrow:hover  { transform: translateY(-50%) scale(1.06); }
.testify__arrow:active { transform: translateY(-50%) scale(.95); }
.testify__arrow--prev { left: 14px; }
.testify__arrow--next { right: 14px; }

/* -------- CAPTION / DOTS / COUNTER -------- */
.testify__caption {
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  z-index: 12;
}
.testify__chip {
  padding: 10px 22px;
  font-size: 13px;
  background: #fff;
  /* Отменяем gradient-fill text из базового .chip — иначе на белом
     background текст становится прозрачным (color:transparent +
     background-clip:text) и пропадает с экрана. */
  -webkit-background-clip: border-box;
          background-clip: border-box;
  -webkit-text-fill-color: initial;
  color: var(--ink, #1a2236);
  white-space: nowrap;
  box-shadow: 0 9px 26px -14px rgba(28,34,54,.25);
}

/* Точки — визуал общий .slider-dots/.slider-dot в shared.css.
   Здесь только absolute-позиционирование. */
.testify__dots {
  position: absolute;
  left: 50%;
  bottom: 19px;
  transform: translateX(-50%);
  z-index: 12;
}

.testify__counter {
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink-mute);
  z-index: 12;
}
.testify__counter .testify__sep { margin: 0 5px; opacity: .5; }
.testify__current {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* -------- RESPONSIVE -------- */
@media (max-width: 1100px) {
  .slide[data-pos="-2"], .slide[data-pos="2"] {
    opacity: 0;
    pointer-events: none;
  }
  .slide[data-pos="-1"] { transform: translate(calc(-50% - 220px), -50%) scale(.7); }
  .slide[data-pos="1"]  { transform: translate(calc(-50% + 220px), -50%) scale(.7); }
}
@media (max-width: 760px) {
  .testify__cover { height: 561px; }
  .slide { width: 238px; }
  .slide__shot { min-height: 289px; max-height: 459px; }
  .slide[data-pos="-1"], .slide[data-pos="1"] {
    opacity: 0;
    pointer-events: none;
  }
  /* Размер кнопки на мобиле — из общего .slider-arrow (44px).
     Отступы от края — поджимаем, чтобы не наезжать на слайд. */
  .testify__arrow--prev { left: 6px; }
  .testify__arrow--next { right: 6px; }
}
