/* Поп-ап подписки (макет Figma «TUNE»: Desktop/Mobile подписка + Спасибо) */
.sub-popup { position: fixed; inset: 0; z-index: 100001; /* выше чата Битрикс24 (100000) */ display: flex; align-items: center; justify-content: center; padding: 16px; }
.sub-popup[hidden] { display: none; }
.sub-popup .sub-popup__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .25s; }
.sub-popup.is-open .sub-popup__overlay { opacity: 1; }

.sub-popup .sub-popup__box {
  position: relative; width: 520px; max-width: 100%; max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; border-radius: 20px; box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
  padding: 40px 40px 36px; color: #1a1a1a; text-align: left;
  opacity: 0; transform: translateY(16px); transition: opacity .25s, transform .25s;
}
.sub-popup.is-open .sub-popup__box { opacity: 1; transform: none; }
.sub-popup .sub-popup__step { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; margin: 0; }
.sub-popup .sub-popup__step[hidden] { display: none; }
.sub-popup .sub-popup__grabber { display: none; }

.sub-popup .sub-popup__close {
  position: absolute; top: 20px; right: 25px; width: 27px; height: 32px; padding: 0; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; background: #f4f5f7; border-radius: 16px;
}
.sub-popup .sub-popup__close img { display: block; width: 16px; height: 16px; }

.sub-popup .sub-popup__badge {
  display: inline-block; padding: 6px 12px; border-radius: 40px; background: #e2f781;
  font-size: 16px; line-height: 20px; font-weight: 600; color: #262626;
}
.sub-popup .sub-popup__title { margin: 0; font-size: 28px; line-height: 34px; font-weight: 800; text-transform: uppercase; color: #1a1a1a; }
.sub-popup .sub-popup__title span { display: block; color: #e80459; }
.sub-popup .sub-popup__title--ok { font-size: 26px; line-height: 32px; text-transform: none; padding-right: 24px; outline: none; }
.sub-popup .sub-popup__text { margin: 0; font-size: 15px; line-height: 22px; color: #6b6f76; }
.sub-popup .sub-popup__text b { color: #1a1a1a; font-weight: 700; }
.sub-popup .sub-popup__desk { display: block; }
.sub-popup .sub-popup__success .sub-popup__desk { display: inline; }

.sub-popup .sub-popup__row { display: flex; gap: 10px; width: 100%; }
.sub-popup .sub-popup__input {
  flex: 1 1 0; min-width: 0; height: 52px; padding: 0 16px; margin: 0;
  background: #f4f5f7; border: 1px solid #e3e5e9; border-radius: 10px;
  font: inherit; font-size: 15px; color: #1a1a1a; outline: none; transition: border-color .15s;
}
.sub-popup .sub-popup__input::placeholder { color: #8a8e95; }
.sub-popup .sub-popup__input:focus { border-color: #8a8e95; }
.sub-popup .sub-popup__input.is-invalid { border-color: #e80459; }

.sub-popup .sub-popup__btn {
  flex: 0 0 220px; height: 52px; padding: 0 24px; border: 0; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e80459; color: #fff; font: inherit; font-size: 15px; font-weight: 700; letter-spacing: .3px;
  text-transform: uppercase; text-decoration: none; white-space: nowrap; transition: background .15s;
}
.sub-popup .sub-popup__btn:hover, .sub-popup .sub-popup__btn:focus-visible { background: #c90049; color: #fff; text-decoration: none; }
.sub-popup .sub-popup__btn--ok { width: 220px; flex: none; }
.sub-popup .sub-popup__form.is-loading .sub-popup__btn { opacity: .6; pointer-events: none; }

.sub-popup .sub-popup__consent { position: relative; display: flex; gap: 10px; margin: 0; font-size: 12px; line-height: 16px; color: #6b6f76; font-weight: 400; cursor: pointer; }
.sub-popup .sub-popup__consent input { position: absolute; opacity: 0; width: 16px; height: 16px; margin: 0; }
.sub-popup .sub-popup__check { flex: 0 0 16px; height: 16px; border: 1px solid #c4c7cc; border-radius: 5px; background: #fff center / 12px no-repeat; }
.sub-popup .sub-popup__consent input:checked + .sub-popup__check { background-color: #e80459; border-color: #e80459; background-image: url(/_html/img/popup/check.svg); }
.sub-popup .sub-popup__consent input:focus-visible + .sub-popup__check { outline: 2px solid #e80459; outline-offset: 2px; }
.sub-popup .sub-popup__consent.is-invalid .sub-popup__check { border-color: #e80459; }
.sub-popup .sub-popup__consent a { color: #e80459; text-decoration: underline; }
.sub-popup .sub-popup__error { display: none; margin-top: -8px; font-size: 13px; line-height: 18px; color: #e80459; }
.sub-popup .sub-popup__error:not(:empty) { display: block; }

.sub-popup .sub-popup__icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #e2f781; }
.sub-popup .sub-popup__icon img { display: block; width: 28px; height: 28px; }

html.sub-popup-lock, html.sub-popup-lock body { overflow: hidden; }

/* Мобильная версия — шторка снизу */
@media (max-width: 600px) {
  /* плавающая карточка с отступами от краёв экрана */
  .sub-popup { align-items: flex-end; padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .sub-popup .sub-popup__box {
    width: 100%; max-height: calc(100vh - 40px); border-radius: 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
    padding: 10px 24px 24px;
    transform: translateY(calc(100% + 20px));
  }
  .sub-popup .sub-popup__grabber { display: block; width: 40px; height: 4px; margin: 0 auto 22px; border-radius: 2px; background: #d5d8dd; }
  .sub-popup .sub-popup__close { top: 16px; right: 16px; }
  /* мобильная шторка — по центру, компактнее */
  .sub-popup .sub-popup__step { gap: 12px; align-items: center; text-align: center; }
  .sub-popup .sub-popup__badge { padding: 5px 12px; font-size: 13px; line-height: 16px; }
  .sub-popup .sub-popup__title { font-size: 24px; line-height: 28px; letter-spacing: -.3px; }
  .sub-popup .sub-popup__title--ok { font-size: 22px; line-height: 27px; padding: 0 12px; }
  .sub-popup .sub-popup__text { max-width: 310px; font-size: 14px; line-height: 20px; }
  .sub-popup .sub-popup__desk, .sub-popup .sub-popup__success .sub-popup__desk { display: none; }
  .sub-popup .sub-popup__row { flex-direction: column; gap: 10px; margin-top: 6px; }
  .sub-popup .sub-popup__input { flex: none; height: 52px; border-radius: 12px; font-size: 16px; text-align: left; }
  .sub-popup .sub-popup__btn, .sub-popup .sub-popup__btn--ok { flex: none; width: 100%; border-radius: 12px; }
  .sub-popup .sub-popup__btn--ok { margin-top: 8px; }
  .sub-popup .sub-popup__consent { align-self: stretch; text-align: left; font-size: 11px; line-height: 15px; }
  .sub-popup .sub-popup__error { align-self: stretch; text-align: left; margin-top: -4px; }
  .sub-popup .sub-popup__icon { margin-bottom: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .sub-popup .sub-popup__overlay, .sub-popup .sub-popup__box { transition: none; }
}
