/* Свои компоненты лендинга «Figma для презентаций»: корзина, формы, аккордеон.
   Токены — design-systems/figma.md (кнопки #4a25b8, радиус 25, TildaSans). */

/* ── общие элементы форм ── */
.fg-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.fg-input {
  width: 100%;
  box-sizing: border-box;
  height: 45px;
  padding: 0 18px;
  background: #fafafa;
  border: 1px solid #000000;
  border-radius: 25px;
  font-family: 'TildaSans', Arial, sans-serif;
  font-size: 15px;
  color: #000000;
  outline: none;
}
.fg-input:focus { border-color: #4a25b8; box-shadow: 0 0 0 2px rgba(74,37,184,.15); }
.fg-input--err { border-color: #ff383b; }

.fg-btn {
  display: inline-block;
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  padding: 0 24px;
  background: #4a25b8;
  color: #ffffff;
  border: none;
  border-radius: 25px;
  font-family: 'TildaSans', Arial, sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease;
}
.fg-btn:hover { background: #000000; }
.fg-btn[disabled] { opacity: .6; cursor: default; }
.fg-btn--ghost {
  background: transparent;
  color: #4a25b8;
  border: 1px solid #4a25b8;
}
.fg-btn--ghost:hover { background: #4a25b8; color: #fff; }

.fg-form__row { margin-bottom: 12px; }
.fg-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 8px 0;
  font-family: 'TildaSans', Arial, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  color: #303030;
  cursor: pointer;
}
.fg-check input { margin-top: 2px; accent-color: #4a25b8; flex: 0 0 auto; }
/* !important — иначе цвет ссылок перебивают правила тильда-текстов страницы */
.fg-check a { color: #4a25b8 !important; }
.fg-form__msg {
  margin-top: 10px;
  font-family: 'TildaSans', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
.fg-form__msg--err { color: #ff383b; }
.fg-form__msg--ok { color: #1d8a3c; }

/* форма «Свяжитесь с нами» живёт внутри зеро-элемента (ширина от артборда).
   Компактнее обычного: высота ограничена белой карточкой дизайна. */
.tn-atom__form .fg-form { width: 100%; }
.tn-atom__form .fg-form__row { margin-bottom: 6px; }
.tn-atom__form .fg-input { height: 42px; font-size: 14px; }
.tn-atom__form .fg-check { font-size: 11px; line-height: 1.3; margin: 2px 0; }
.tn-atom__form .fg-form__submit { height: 44px; }
.tn-atom__form .fg-form__msg { margin-top: 6px; font-size: 13px; }

/* телефон с флажком, как в оригинальной тильда-форме */
.fg-phone { position: relative; }
.fg-phone__flag {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  display: flex; align-items: center; gap: 5px;
  pointer-events: none;
}
.fg-phone__flag svg { display: block; border-radius: 2px; }
.fg-phone__flag i {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #757575;
}
.fg-input--phone { padding-left: 56px; }

/* ── корзина ── */
.fg-cart {
  position: fixed;
  inset: 0;
  z-index: 10000002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
}
.fg-cart[hidden] { display: none; }
.fg-cart__bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.fg-cart__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #ffffff;
  border-radius: 30px;
  padding: 28px;
  box-sizing: border-box;
  font-family: 'TildaSans', Arial, sans-serif;
  animation: fg-cart-in .3s ease;
}
@keyframes fg-cart-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fg-cart__close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.fg-cart__title { font-size: 22px; font-weight: 700; margin: 0 0 16px; color: #000; }
.fg-cart__product {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 0; margin-bottom: 14px;
  border-top: 1px solid #eee; border-bottom: 1px solid #eee;
  font-size: 15px; color: #000;
}
.fg-cart__product b { white-space: nowrap; }
.fg-cart__submit { margin-top: 6px; }
@media (max-width: 479px) {
  .fg-cart { padding: 10px; align-items: flex-end; }
  .fg-cart__panel { border-radius: 24px 24px 16px 16px; padding: 22px; }
}

/* ── холст масштабируемых зеро-блоков (режим upscale=window) ── */
.fg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  transform-origin: top center;
  /* transform создаёт свой контекст наложения: без z-index холст с элементами
     оказался бы ПОД фильтром артборда (у .t396__filter z-index:1) */
  z-index: 2;
}

/* ── подложка попапов t1093: в оригинале её растягивал JS Тильды ── */
.t1093 .t-popup__bg {
  position: fixed;
  inset: 0;
  z-index: 10000000;   /* под самим попапом (10000001), над страницей */
  display: none;
}
.t1093 .t-popup__bg.fg-bg-show { display: block; }

/* ── кнопки «Начать бесплатно» (зеро-элементы, вставляет сборщик).
   Селектор с #allrecords — чтобы перебить тильдовские правила ссылок
   (у них специфичность #rec… a). ── */
#allrecords a.fg-free-btn,
.fg-free-btn {
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: transparent;
  border: 1px solid #ffffff;
  border-radius: 30px;
  color: #ffffff !important;
  font-family: 'TildaSans', Arial, sans-serif;
  font-weight: 500;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
#allrecords a.fg-free-btn:hover,
.fg-free-btn:hover { background: #ffffff; color: #4a25b8 !important; }

/* текст-описание в попапе бесплатного курса */
.fg-free__text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: #303030;
}

/* ── аккордеон FAQ: блоки ответов скрыты до клика (как делал скрипт Тильды) ── */
#rec2059600491, #rec2059608021, #rec2069420321, #rec2069417211 { display: none; }
#rec2059600491.fg-open, #rec2059608021.fg-open,
#rec2069420321.fg-open, #rec2069417211.fg-open { display: block; }

/* иконка «+» в ссылке вопроса поворачивается на 45° (220ms — как в оригинале) */
a[href*="#vopros"] img, a[href*="#vopros"] .tn-atom {
  transition: transform .22s ease;
  will-change: transform;
}
a[href*="#vopros"].fg-open img, a[href*="#vopros"].fg-open .tn-atom { transform: rotate(45deg); }

/* (тост ?paid=0 удалён 2026-08-20: страницы успеха/неуспеха теперь у узла /pay/) */
