/* ============================================================
   tsr-form-section — переиспользуемая секция формы записи.
   Вариант --1a: без подложки (на фоне страницы).
   Вариант --2a: в стеклянной карточке (как FAQ/booking на women.*).
   Реальные шрифты темы: Gilroy (400/500/700), TrajanPro3Regular (400).
   ============================================================ */

.tsr-form-section {
  position: relative;
  /* Без своего фона: страница вокруг уже тёмная (main{background:#0B0B0B}),
     а #08060B поверх неё давал заметный, чуть другого оттенка прямоугольник —
     нужно, чтобы секция сливалась со страницей, а не лежала на подложке. */
  background: transparent;
  padding: 100px 24px;
  font-family: "Gilroy", Helvetica, Arial, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.tsr-form-section__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.tsr-form-section__decor::before {
  content: "";
  position: absolute;
  top: -90px; right: -140px;
  width: 520px; height: 520px;
  border: 1px solid rgba(197, 57, 255, .18);
  border-radius: 50%;
}
.tsr-form-section__decor::after {
  content: "";
  position: absolute;
  top: 18%; left: 50%;
  width: 420px; height: 420px;
  border-radius: 50%;
  filter: blur(100px);
  background: radial-gradient(circle, rgba(197, 57, 255, .16), rgba(197, 57, 255, 0) 70%);
}

.tsr-form-section__inner {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
}

/* -------- 2A: стеклянная карточка -------- */
/* В отличие от 1A (там страница вокруг уже тёмная — на главной/akcii/#0B0B0B),
   2A используется и на страницах со светлым фоном секции (например
   .dt-archive-posts.vs_programs на girls/men — #F2F2F2) — без своего тёмного
   фона стеклянная карточка rgba(11,11,11,.62) на светлом фоне даёт блёклый
   серый прямоугольник вместо стекла. Возвращаем фон только для 2a. */
.tsr-form-section--2a {
  background: #08060B;
  /* на programs (category-1.php/archive.php) секция сидит глубоко внутри
     .container с ограниченной шириной — без full-bleed фон обрезается по
     контейнеру вместо всей ширины экрана. Классический приём растягивания
     до 100vw независимо от того, где секция реально лежит в разметке. */
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  box-sizing: border-box;
}
.tsr-form-section--2a .tsr-form-section__inner {
  border-radius: 28px;
  background: rgba(11, 11, 11, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .09);
  padding: 64px 56px 60px;
  isolation: isolate;
}
.tsr-form-section--2a .tsr-form-section__inner::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(197,57,255,0), rgba(197,57,255,.55) 45%, rgba(197,57,255,0));
}

/* ============================================================
   tsr-popup — поп-ап с формой (204) для альтернативных вариантов
   кнопки в блоке «Мастера-девушки» («Забронировать» / «Записаться
   на посещение»). Открывается/закрывается тем же приёмом :target,
   что и родной .modalDialog темы — без лишнего JS.
   ============================================================ */
.tsr-popup {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tsr-popup:target {
  display: flex;
}
body:has(.tsr-popup:target) {
  overflow: hidden; /* блокируем скролл страницы под открытым поп-апом */
}
.tsr-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 8, .78);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.tsr-popup__dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 28px;
}
.tsr-popup__close {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
  transition: background .15s ease;
}
.tsr-popup__close:hover {
  background: rgba(255, 255, 255, .16);
}
/* Внутри поп-апа секции не нужен ни full-bleed 100vw (--2a вне поп-апа
   растягивается на весь экран), ни «страничные» отступы — своя, более
   компактная вёрстка под размер диалога. */
.tsr-popup__form.tsr-form-section {
  width: auto;
  margin: 0;
  padding: 0;
}
.tsr-popup__form .tsr-form-section__inner {
  max-width: none;
  padding: 44px 32px 36px;
}

/* -------- заголовок -------- */
.tsr-form-section__head {
  position: relative;
  display: grid;
  gap: 16px;
  max-width: 640px;
}
.tsr-form-section__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(227, 155, 255, .85);
}
.tsr-form-section__eyebrow::before {
  content: "";
  width: 4px; height: 4px;
  background: #C539FF;
  transform: rotate(45deg);
}
.tsr-form-section__title {
  margin: 0;
  font-family: "TrajanPro3Regular", Arial, sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.2;
  color: #F4F1F5;
  text-shadow: none;
}
.tsr-form-section__subtitle {
  margin: 0;
  max-width: 640px;
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  color: rgba(244, 241, 245, .62);
  letter-spacing: .01em;
}

/* -------- CF7-форма: гасим родную вёрстку темы -------- */
.tsr-form-section .form__title,
.tsr-form-section .form__subtitle {
  display: none;
}
.tsr-form-section form.wpcf7-form {
  position: relative;
  margin-top: 40px;
  display: grid;
  gap: 28px;
}
.tsr-form-section .form__row {
  display: grid;
  gap: 28px;
  /* тема сама вешает .form__row{margin-top:62px} — это и есть тот лишний
     воздух между подзаголовком и полями, глушим его */
  margin-top: 0;
  /* grid-элементы по умолчанию min-width:auto (= ширина их контента) —
     на страницах с плотным контейнером (girls/men/programs) это раздувало
     .form__row шире карточки и обрезалось overflow:hidden секции.
     min-width:0 разрешает элементам сжиматься до ширины трека. */
  min-width: 0;
}
.tsr-form-section .form__inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: flex-start;
}
.tsr-form-section .form__inputs br { display: none; }

/* подсказка под «Удобное время посещения» — 4й элемент грида, ставим точно
   под 3-е поле (колонка 3, строка 2) на десктопе */
.tsr-form-hint {
  grid-column: 3;
  grid-row: 2;
  margin: -6px 0 0;
  font-size: 12px;
  letter-spacing: .02em;
  color: rgba(244, 241, 245, .34);
}

/* !important + задвоенный .tsr-form-section — тот же ".form .form__inputs
   .wpcf7-text{height:95px!important}" и его сосед "input[type=text]" бьют и на
   десктопе, не только на мобилке. Первая попытка (3 класса) СОВПАЛА по
   специфичности с их 4-м вариантом ".form .form__inputs input[type=text]"
   (тоже 3 класса + type) — при равенстве решает порядок в источнике, и их
   инлайн-<style> оказался позже. Добавляем .form__inputs, как в мобильном
   блоке, чтобы точно быть на класс больше и не зависеть от порядка. */
.tsr-form-section.tsr-form-section .form__inputs input.form__input,
.tsr-form-section.tsr-form-section .form__inputs input[name="visit-time"] {
  width: 100%;
  box-sizing: border-box !important;
  height: 64px !important;
  line-height: normal !important;
  padding: 0 22px !important;
  margin: 0 !important;
  max-width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 255, .03) !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  color: #F4F1F5 !important;
  font-family: "Gilroy", Helvetica, Arial, sans-serif;
  font-size: 15px !important;
  letter-spacing: .02em;
  outline: none;
  text-shadow: none;
  transition: border-color .25s ease, background .25s ease;
}
.tsr-form-section input.form__input::placeholder,
.tsr-form-section input[name="visit-time"]::placeholder {
  color: rgba(244, 241, 245, .38);
}
.tsr-form-section.tsr-form-section .form__inputs input.form__input:focus,
.tsr-form-section.tsr-form-section .form__inputs input[name="visit-time"]:focus {
  border-color: rgba(200, 55, 254, .75) !important;
  background: rgba(197, 57, 255, .05) !important;
}
.tsr-form-section input[name="visit-time"] {
  cursor: text;
}
.tsr-form-section .wpcf7-not-valid-tip {
  margin-top: 8px;
  font-size: 12px;
  letter-spacing: .02em;
  color: rgba(255, 120, 145, .9);
}
.tsr-form-section input.wpcf7-not-valid {
  border-color: rgba(255, 90, 120, .7) !important;
}

/* -------- «Как связаться» — чипы -------- */
.tsr-form-channel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.tsr-form-channel__label {
  margin-right: 6px;
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(244, 241, 245, .45);
}
.tsr-form-chip {
  height: 44px;
  padding: 0 22px;
  border-radius: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .16);
  color: rgba(244, 241, 245, .6);
  font-family: "Gilroy", Helvetica, Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: .04em;
  cursor: pointer;
  text-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .25s ease, background .25s ease, color .25s ease;
  /* когда сетке не хватает места (узкие карточки на girls/men/programs),
     чипы сжимаются до 1/3 колонки минус gap — «Мессенджер» туда не влезает
     буквально. Без этого текст просто вылезает за рамку на соседний чип. */
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tsr-form-chip.is-active {
  background: rgba(197, 57, 255, .12);
  border-color: rgba(200, 55, 254, .75);
  color: #FFFFFF;
}
@media (hover: hover) {
  .tsr-form-chip:not(.is-active):hover {
    border-color: rgba(255, 255, 255, .32);
    color: rgba(244, 241, 245, .85);
  }
}
.tsr-form-messengers {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: -14px;
}
.tsr-form-messengers.is-shown {
  display: flex;
}

/* -------- нижняя строка: кнопка + согласие -------- */
.tsr-form-section .form__btn.btn.btn-colored {
  display: none !important;
}
.tsr-form-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  min-width: 0;
}
.tsr-form-consent {
  margin: 0;
  max-width: 340px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(244, 241, 245, .45);
  letter-spacing: .01em;
}
.tsr-form-consent a {
  color: rgba(227, 155, 255, .85);
  text-decoration: none;
  border-bottom: 1px solid rgba(227, 155, 255, .35);
  transition: color .2s ease, border-color .2s ease;
}
@media (hover: hover) {
  .tsr-form-consent a:hover {
    color: #E39BFF;
    border-bottom-color: #E39BFF;
  }
}

.tsr-form-section .wpcf7-response-output {
  margin: 24px 0 0 !important;
  border-radius: 0;
  font-family: "Gilroy", Helvetica, Arial, sans-serif;
  font-size: 14px;
  letter-spacing: .01em;
}
.tsr-form-section form.sent .wpcf7-response-output {
  border-color: rgba(200, 55, 254, .42) !important;
  background: rgba(197, 57, 255, .06) !important;
  color: rgba(244, 241, 245, .9) !important;
}
.tsr-form-section form.invalid .wpcf7-response-output,
.tsr-form-section form.failed .wpcf7-response-output {
  color: rgba(255, 190, 200, .95) !important;
}

/* ============================================================
   tsr-cta — та же кнопка «Заказать звонок», что и на women.*
   ============================================================ */
.tsr-cta {
  --tsr-cta-bg:        #C539FF;
  --tsr-cta-bg-hover:  #D766FF;
  --tsr-cta-bg-active: #A821E0;
  --tsr-cta-tip:       #9E17D6;
  --tsr-cta-tip-hover: #B32FE8;
  --tsr-cta-tip-active:#8410B8;
  --tsr-cta-fg:        #FFFFFF;

  display: inline-flex;
  align-items: stretch;
  height: 64px;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: none;
  font-family: "Gilroy", Helvetica, Arial, sans-serif;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.tsr-cta__label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 0 30px;
  background: var(--tsr-cta-bg);
  color: var(--tsr-cta-fg);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: none;
  transition: background .25s ease, color .25s ease;
}
.tsr-cta__tip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 64px;
  background: var(--tsr-cta-tip);
  transition: background .25s ease;
}
.tsr-cta__arrow {
  width: 0; height: 0;
  border-style: solid;
  border-width: 6px 0 6px 9px;
  border-color: transparent transparent transparent #FFFFFF;
}
.tsr-cta__spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: tsr-cta-spin .8s linear infinite;
}
.tsr-cta__check {
  display: none;
  width: 16px; height: 9px;
  margin-top: -4px;
  border-left: 2px solid #FFFFFF;
  border-bottom: 2px solid #FFFFFF;
  transform: rotate(-45deg);
}
@keyframes tsr-cta-spin { to { transform: rotate(360deg); } }

@media (hover: hover) {
  .tsr-cta:not([disabled]):not([data-state="loading"]):not([data-state="done"]):hover .tsr-cta__label { background: var(--tsr-cta-bg-hover); }
  .tsr-cta:not([disabled]):not([data-state="loading"]):not([data-state="done"]):hover .tsr-cta__tip   { background: var(--tsr-cta-tip-hover); }
}
.tsr-cta:not([disabled]):not([data-state="loading"]):not([data-state="done"]):active .tsr-cta__label {
  background: var(--tsr-cta-bg-active);
}
.tsr-cta:not([disabled]):not([data-state="loading"]):not([data-state="done"]):active .tsr-cta__tip {
  background: var(--tsr-cta-tip-active);
}
.tsr-cta:focus { outline: none; }
.tsr-cta:focus-visible {
  outline: 2px solid rgba(255,255,255,.85);
  outline-offset: 2px;
}
.tsr-cta[data-state="loading"] { cursor: wait; }
.tsr-cta[data-state="loading"] .tsr-cta__label { background: #8C2FB0; }
.tsr-cta[data-state="loading"] .tsr-cta__tip   { background: #701F90; }
.tsr-cta[data-state="loading"] .tsr-cta__arrow   { display: none; }
.tsr-cta[data-state="loading"] .tsr-cta__spinner { display: block; }
.tsr-cta[data-state="done"] { cursor: default; }
.tsr-cta[data-state="done"] .tsr-cta__label { background: #2E7D4F; }
.tsr-cta[data-state="done"] .tsr-cta__tip   { background: #1F5E39; }
.tsr-cta[data-state="done"] .tsr-cta__arrow { display: none; }
.tsr-cta[data-state="done"] .tsr-cta__check { display: block; }
@media (prefers-reduced-motion: reduce) {
  .tsr-cta__label, .tsr-cta__tip { transition: none; }
  .tsr-cta__spinner { animation-duration: 1.6s; }
}

/* ============================================================
   Мобильная адаптация
   ============================================================ */
@media (max-width: 640px) {
  .tsr-form-section { padding: 64px 16px; }
  .tsr-form-section--2a .tsr-form-section__inner { padding: 40px 20px 36px; border-radius: 20px; }
  .tsr-form-section__title { font-size: 24px; }
  .tsr-popup { padding: 12px; }
  .tsr-popup__form .tsr-form-section__inner { padding: 36px 20px 28px; }
  /* чуть плотнее между блоком полей, «Как связаться» и кнопкой на мобилке.
     Реальный управляющий gap тут — на .form__row (он же родитель для полей,
     чипов и кнопки, все три вставлены JS-ом внутрь него), а не на <form> —
     .form__row{gap:28px} общий унаследовался бы иначе и с десктопа. */
  .tsr-form-section .form__row { gap: 20px; }

  /* поля: по мобильному хендоффу высота 58px (не 64, как на десктопе).
     !important обязателен, и число классов в селекторе тоже важно — на сайте
     минимум два конкурирующих инлайн-<style>, оба !important:
     - главная: ".form .form__inputs .wpcf7-text{height:95px!important}" (3 класса,
       завязан на html_class="form", которого нет на akcii — поэтому туда не лезем)
     - akcii: ".akcii-form-section .wpcf7-text{height:50px!important}" (2 класса)
     Селектор ниже не завязан на .form (которого на akcii нет) и специально
     задвоен по .tsr-form-section, чтобы дать 4 класса — с запасом больше любого
     из них на обеих страницах. */
  .tsr-form-section .form__inputs { grid-template-columns: 1fr; gap: 6px; }
  .tsr-form-hint { grid-column: 1; grid-row: auto; margin: -2px 0 0; }
  .tsr-form-section.tsr-form-section .form__inputs input.form__input,
  .tsr-form-section.tsr-form-section .form__inputs input[name="visit-time"] {
    height: 58px !important;
    line-height: normal !important;
    padding: 0 18px !important;
    font-size: 16px !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    border: 1px solid rgba(255, 255, 255, .16) !important;
    border-radius: 0 !important;
    color: #F4F1F5 !important;
    background: rgba(255, 255, 255, .03) !important;
  }
  .tsr-form-section.tsr-form-section .form__inputs input.form__input:focus,
  .tsr-form-section.tsr-form-section .form__inputs input[name="visit-time"]:focus {
    border-color: rgba(200, 55, 254, .75) !important;
  }
  .tsr-form-section.tsr-form-section .form__inputs input.form__input:not(:last-child) {
    margin: 0 !important;
  }

  /* «Как связаться»: подпись своей строкой НАД чипами, чипы — жёстко в один ряд
     (3 явные колонки грида вместо flex-wrap, чтобы никогда не съезжали в 2 строки) */
  .tsr-form-channel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: center;
  }
  .tsr-form-channel__label {
    grid-column: 1 / -1;
    margin: 0 0 2px;
  }
  .tsr-form-messengers.is-shown {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .tsr-form-chip {
    width: 100%;
    height: 46px;
    padding: 0 10px;
    font-size: 12.5px;
    letter-spacing: .02em;
  }

  .tsr-form-bottom { flex-direction: column; align-items: stretch; gap: 20px; }

  /* кнопка: по мобильному хендоффу высота 60px (не 64, как на десктопе) */
  .tsr-cta { width: 100%; height: 60px; }
  .tsr-cta__label { flex: 1; height: 60px; padding: 0 18px; letter-spacing: .14em; }
  .tsr-cta__tip { height: 60px; }

  .tsr-form-consent { max-width: none; }
}
