/* /assets/css/knopka.css */
@import url('https://fonts.googleapis.com/css2?family=Neucha&display=swap');


/* ==========================================================
   БОКОВАЯ КНОПКА ОБРАТНОГО ЗВОНКА
   ========================================================== */

.callback-widget {
  position: relative;
  z-index: 10020;
}

.callback-widget__trigger {
  position: fixed;
  top: 56%;
  right: 0;
  z-index: 10010;

  display: flex;
  align-items: center;
  gap: .7rem;

  min-height: 72px;
  padding: .75rem .85rem .75rem .8rem;

  border: 1px solid rgba(72, 88, 68, .14);
  border-right: 0;
  border-radius: 20px 0 0 20px;

  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, .96),
      rgba(239, 248, 235, .96)
    );

  color: #35543d;

  box-shadow:
    -10px 16px 34px rgba(34, 51, 38, .15),
    inset 0 1px 0 rgba(255, 255, 255, .9);

  cursor: pointer;

  transform:
    translateY(-50%)
    translateX(6px);

  transform-origin: center left;

  animation:
    callbackFloat 3.6s ease-in-out infinite;

  transition:
    transform .24s ease,
    box-shadow .24s ease,
    background .24s ease;
}

.callback-widget__trigger:hover {
  transform:
    translateY(-50%)
    translateX(0);

  box-shadow:
    -14px 20px 42px rgba(34, 51, 38, .2),
    inset 0 1px 0 rgba(255, 255, 255, .94);

  animation-play-state: paused;
}

.callback-widget__trigger:focus-visible {
  outline: 3px solid rgba(181, 75, 89, .2);
  outline-offset: 3px;
}


/* ==========================================================
   ИКОНКА ТЕЛЕФОНА
   ========================================================== */

.callback-widget__trigger-icon {
  position: relative;

  width: 42px;
  height: 42px;
  flex: 0 0 42px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: #b54b59;
  color: #fff;

  box-shadow:
    0 8px 18px rgba(181, 75, 89, .25),
    inset 0 1px 0 rgba(255, 255, 255, .25);

  transform-origin: center;

  animation:
    callbackRing 4.2s ease-in-out infinite;
}


/* Пульсирующее кольцо вокруг телефона */

.callback-widget__trigger-icon::after {
  content: "";

  position: absolute;
  inset: -6px;

  border: 1px solid rgba(181, 75, 89, .22);
  border-radius: inherit;

  animation:
    callbackPulse 2.2s ease-out infinite;
}

.callback-widget__trigger-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}


/* ==========================================================
   ТЕКСТ КНОПКИ
   ========================================================== */

.callback-widget__trigger-copy {
  display: grid;
  gap: .08rem;

  text-align: left;
}

.callback-widget__trigger-copy strong {
  font-family: 'Neucha', cursive;
  font-size: 1.12rem;
  font-weight: 400;
  line-height: 1;

  white-space: nowrap;
}

.callback-widget__trigger-copy small {
  color: rgba(53, 84, 61, .72);

  font-size: .72rem;
  line-height: 1.15;

  white-space: nowrap;
}


/* ==========================================================
   МОДАЛЬНОЕ ОКНО
   ========================================================== */

.callback-modal {
  position: fixed;
  inset: 0;
  z-index: 10030;

  display: grid;
  place-items: center;

  padding: 1rem;

  visibility: hidden;
  opacity: 0;
  pointer-events: none;

  transition:
    opacity .25s ease,
    visibility .25s ease;
}

.callback-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}


/* Затемнение заднего фона */

.callback-modal__backdrop {
  position: absolute;
  inset: 0;

  background: rgba(27, 35, 29, .6);

  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}


/* ==========================================================
   КАРТОЧКА МОДАЛКИ
   ========================================================== */

.callback-modal__dialog {
  position: relative;
  z-index: 2;

  width: min(520px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);

  overflow: auto;

  padding:
    clamp(1.35rem, 4vw, 2.2rem);

  border:
    1px solid rgba(67, 84, 67, .12);

  border-radius: 28px;

  background:
    radial-gradient(
      circle at 14% 10%,
      rgba(236, 247, 233, .92),
      transparent 30%
    ),
    radial-gradient(
      circle at 88% 88%,
      rgba(255, 236, 239, .72),
      transparent 28%
    ),
    #fffdf7;

  box-shadow:
    0 34px 90px rgba(25, 35, 28, .28),
    0 12px 34px rgba(25, 35, 28, .14);

  transform:
    translateY(22px)
    scale(.975);

  transition:
    transform .25s ease;
}

.callback-modal.is-open
.callback-modal__dialog {
  transform:
    translateY(0)
    scale(1);
}


/* ==========================================================
   КНОПКА ЗАКРЫТИЯ
   ========================================================== */

.callback-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;

  padding: 0;

  border:
    1px solid rgba(67, 84, 67, .12);

  border-radius: 50%;

  background:
    rgba(255, 255, 255, .9);

  color: #35543d;

  font:
    400 1.7rem/1
    system-ui,
    sans-serif;

  cursor: pointer;

  transition:
    transform .2s ease,
    background .2s ease;
}

.callback-modal__close:hover {
  transform:
    rotate(7deg)
    scale(1.04);

  background: #fff;
}


/* ==========================================================
   ВЕРХНЯЯ МЕТКА
   ========================================================== */

.callback-modal__eyebrow {
  display: inline-flex;
  align-items: center;

  min-height: 30px;

  padding:
    .28rem .7rem;

  border-radius: 999px;

  background:
    rgba(236, 247, 233, .95);

  color: #35543d;

  font-size: .78rem;
  font-weight: 700;
}


/* ==========================================================
   ЗАГОЛОВОК
   ========================================================== */

.callback-modal h2 {
  margin:
    .75rem
    2.6rem
    .6rem
    0;

  color: #35543d;

  font-family:
    'Neucha',
    cursive;

  font-size:
    clamp(2.35rem, 7vw, 3.65rem);

  font-weight: 400;
  line-height: .95;
}


/* ==========================================================
   ОПИСАНИЕ
   ========================================================== */

.callback-modal__lead {
  margin: 0;

  color: #667069;

  font-size: 1rem;
  line-height: 1.65;
}


/* ==========================================================
   ПРЕИМУЩЕСТВА
   ========================================================== */

.callback-modal__benefits {
  display: flex;
  flex-wrap: wrap;

  gap: .45rem;

  margin-top: 1rem;
}

.callback-modal__benefits span {
  display: inline-flex;
  align-items: center;

  min-height: 30px;

  padding:
    .3rem .65rem;

  border-radius: 999px;

  background:
    rgba(255, 246, 224, .96);

  color: #875c2d;

  font-family:
    'Neucha',
    cursive;

  font-size: .95rem;
  line-height: 1;
}

.callback-modal__benefits span:nth-child(2) {
  background:
    rgba(233, 244, 255, .96);

  color: #325f87;
}

.callback-modal__benefits span:nth-child(3) {
  background:
    rgba(236, 247, 233, .96);

  color: #35543d;
}


/* ==========================================================
   ФОРМА
   ========================================================== */

.callback-modal__form {
  margin-top: 1.3rem;
}

.callback-modal__field {
  display: block;
}

.callback-modal__field > span {
  display: block;

  margin-bottom: .42rem;

  color: #3f4942;

  font-size: .84rem;
  font-weight: 700;
}


/* ==========================================================
   ПОЛЕ ТЕЛЕФОНА
   ========================================================== */

.callback-modal__field input {
  width: 100%;

  box-sizing: border-box;

  padding: 1rem;

  border:
    1px solid rgba(67, 84, 67, .18);

  border-radius: 14px;

  outline: none;

  background: #fffaf1;

  color: #29332c;

  font-size: 1.08rem;

  transition:
    border-color .2s ease,
    box-shadow .2s ease,
    background .2s ease;
}

.callback-modal__field input:focus {
  border-color:
    rgba(181, 75, 89, .52);

  background: #fff;

  box-shadow:
    0 0 0 3px
    rgba(181, 75, 89, .1);
}


/* ==========================================================
   КНОПКА ОТПРАВКИ
   ========================================================== */

.callback-modal__submit {
  width: 100%;
  min-height: 50px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: .9rem;

  padding:
    .8rem 1rem;

  border: 0;

  border-radius: 14px;

  background:
    linear-gradient(
      135deg,
      #b54b59,
      #9f3f4d
    );

  color: #fff;

  font-family:
    'Neucha',
    cursive;

  font-size: 1.25rem;

  cursor: pointer;

  box-shadow:
    0 12px 26px rgba(181, 75, 89, .22),
    inset 0 1px 0 rgba(255, 255, 255, .2);

  transition:
    transform .2s ease,
    box-shadow .2s ease,
    opacity .2s ease;
}

.callback-modal__submit:hover {
  transform:
    translateY(-1px);

  box-shadow:
    0 16px 30px rgba(181, 75, 89, .27),
    inset 0 1px 0 rgba(255, 255, 255, .24);
}

.callback-modal__submit:disabled {
  opacity: .65;

  cursor: wait;

  transform: none;
}


/* ==========================================================
   СОГЛАСИЕ
   ========================================================== */

.callback-modal__consent {
  margin:
    .8rem
    0
    0;

  text-align: center;

  color: #7b847e;

  font-size: .68rem;
  line-height: 1.4;
}


/* ==========================================================
   УСПЕШНАЯ ОТПРАВКА
   ========================================================== */

.callback-modal__success {
  display: none;

  margin-top: 1.2rem;

  padding: 1rem;

  border-radius: 16px;

  background:
    rgba(236, 247, 233, .96);

  color: #35543d;

  text-align: center;

  font-weight: 700;
  line-height: 1.45;
}

.callback-modal__success.show {
  display: block;
}


/* ==========================================================
   БЛОКИРОВКА СКРОЛЛА
   ========================================================== */

body.callback-modal-open {
  overflow: hidden;
}


/* ==========================================================
   АНИМАЦИЯ:
   МЯГКОЕ ПОКАЧИВАНИЕ ВСЕЙ КНОПКИ
   ========================================================== */

@keyframes callbackFloat {
  0%,
  100% {
    transform:
      translateY(-50%)
      translateX(6px)
      rotate(0deg);
  }

  20% {
    transform:
      translateY(calc(-50% - 2px))
      translateX(3px)
      rotate(-1.2deg);
  }

  40% {
    transform:
      translateY(calc(-50% + 1px))
      translateX(1px)
      rotate(.9deg);
  }

  60% {
    transform:
      translateY(calc(-50% - 1px))
      translateX(4px)
      rotate(-.7deg);
  }

  80% {
    transform:
      translateY(calc(-50% + 1px))
      translateX(2px)
      rotate(.6deg);
  }
}


/* ==========================================================
   АНИМАЦИЯ:
   ТРУБКА ДРЕБЕЗЖИТ КАК ПРИ ЗВОНКЕ
   СНАЧАЛА ПАУЗА, ПОТОМ СЕРИЯ ДВИЖЕНИЙ
   ========================================================== */

@keyframes callbackRing {
  0%,
  68%,
  100% {
    transform:
      rotate(0deg)
      scale(1);
  }

  71% {
    transform:
      rotate(-12deg)
      scale(1.03);
  }

  74% {
    transform:
      rotate(12deg)
      scale(1.05);
  }

  77% {
    transform:
      rotate(-11deg)
      scale(1.04);
  }

  80% {
    transform:
      rotate(11deg)
      scale(1.05);
  }

  83% {
    transform:
      rotate(-9deg)
      scale(1.03);
  }

  86% {
    transform:
      rotate(9deg)
      scale(1.04);
  }

  89% {
    transform:
      rotate(-6deg)
      scale(1.02);
  }

  92% {
    transform:
      rotate(6deg)
      scale(1.02);
  }

  95% {
    transform:
      rotate(-3deg)
      scale(1.01);
  }

  97% {
    transform:
      rotate(3deg)
      scale(1);
  }
}


/* ==========================================================
   АНИМАЦИЯ:
   ПУЛЬСИРУЮЩЕЕ КОЛЬЦО
   ========================================================== */

@keyframes callbackPulse {
  0% {
    opacity: .8;

    transform:
      scale(.84);
  }

  75%,
  100% {
    opacity: 0;

    transform:
      scale(1.35);
  }
}


/* ==========================================================
   АНИМАЦИЯ МОБИЛЬНОЙ КНОПКИ
   ========================================================== */

@keyframes callbackFloatMobile {
  0%,
  100% {
    transform:
      translateY(0)
      rotate(0deg);
  }

  20% {
    transform:
      translateY(-2px)
      rotate(-1deg);
  }

  40% {
    transform:
      translateY(1px)
      rotate(.8deg);
  }

  60% {
    transform:
      translateY(-1px)
      rotate(-.6deg);
  }

  80% {
    transform:
      translateY(1px)
      rotate(.5deg);
  }
}


/* ==========================================================
   МОБИЛЬНАЯ ВЕРСИЯ
   ========================================================== */

@media (max-width: 700px) {

  .callback-widget__trigger {
    top: auto;
    right: 14px;
    bottom: 18px;

    min-height: 58px;

    padding:
      .55rem .75rem;

    border-right:
      1px solid rgba(72, 88, 68, .14);

    border-radius: 18px;

    transform: none;

    animation:
      callbackFloatMobile
      3.6s
      ease-in-out
      infinite;
  }

  .callback-widget__trigger:hover {
    transform:
      translateY(-2px);

    animation-play-state: paused;
  }

  .callback-widget__trigger-icon {
    width: 38px;
    height: 38px;

    flex-basis: 38px;
  }

  .callback-widget__trigger-copy strong {
    font-size: 1.02rem;
  }

  .callback-widget__trigger-copy small {
    font-size: .68rem;
  }

  .callback-modal {
    padding: .7rem;
  }

  .callback-modal__dialog {
    width:
      calc(100vw - 1.4rem);

    max-height:
      calc(100vh - 1.4rem);

    border-radius: 22px;
  }
}


/* ==========================================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ
   ========================================================== */

@media (max-width: 420px) {

  .callback-widget__trigger {
    right: 10px;
    bottom: 14px;

    min-height: 54px;

    padding:
      .48rem .65rem;
  }

  .callback-widget__trigger-icon {
    width: 36px;
    height: 36px;

    flex-basis: 36px;
  }

  .callback-widget__trigger-copy strong {
    font-size: .96rem;
  }

  .callback-widget__trigger-copy small {
    font-size: .64rem;
  }
}


/* ==========================================================
   ЕСЛИ ПОЛЬЗОВАТЕЛЬ ОТКЛЮЧИЛ АНИМАЦИИ
   ========================================================== */

@media (prefers-reduced-motion: reduce) {

  .callback-widget__trigger,
  .callback-modal,
  .callback-modal__dialog,
  .callback-modal__close,
  .callback-modal__submit {
    transition: none;
  }

  .callback-widget__trigger,
  .callback-widget__trigger-icon,
  .callback-widget__trigger-icon::after {
    animation: none;
  }
}