/* RTS FLY — онбординг нового клиента (подсветка + подсказки + празднование) */

.ob-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15, 31, 53, .14);
  pointer-events: none;
}
.ob-spotlight {
  position: fixed; border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(26, 95, 212, .9), 0 0 0 9999px rgba(15, 31, 53, .14);
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
  pointer-events: none;
}
.ob-target { position: relative; z-index: 9001; }

/* Карточка-подсказка */
.ob-tip {
  position: fixed; z-index: 9002; width: 320px; max-width: calc(100vw - 24px);
  background: #fff; border-radius: 16px; padding: 18px 18px 14px;
  box-shadow: 0 18px 48px rgba(13, 27, 52, .32);
  animation: obTipIn .3s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes obTipIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
.ob-tip-badge {
  position: absolute; top: -16px; left: 18px; width: 34px; height: 34px;
  background: linear-gradient(160deg, #1a5fd4, #2f6fe0); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: 0 6px 16px rgba(26, 95, 212, .4);
}
.ob-tip-title { font-size: 15px; font-weight: 800; color: #0f1f35; margin: 6px 0 6px; }
.ob-tip-body { font-size: 13px; line-height: 1.55; color: #44546b; }
.ob-tip-body b { color: #0f1f35; }
.ob-tip-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ob-tip-btn {
  border: none; cursor: pointer; font-family: inherit;
  background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff;
  font-size: 13px; font-weight: 700; padding: 9px 16px; border-radius: 10px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .32);
}
.ob-tip-btn:hover { filter: brightness(1.05); }
.ob-tip-skip {
  border: none; background: none; cursor: pointer; font-family: inherit;
  font-size: 12px; color: #8a9bb2; margin-left: auto; padding: 4px;
}
.ob-tip-skip:hover { color: #5a6b82; text-decoration: underline; }

/* Пульсация подсвеченного элемента */
.ob-target::after {
  content: ''; position: absolute; inset: -6px; border-radius: 14px;
  box-shadow: 0 0 0 0 rgba(26, 95, 212, .5);
  animation: obPulse 1.6s ease-out infinite; pointer-events: none;
}
@keyframes obPulse {
  0% { box-shadow: 0 0 0 0 rgba(26, 95, 212, .5); }
  70% { box-shadow: 0 0 0 12px rgba(26, 95, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 95, 212, 0); }
}

/* Подсветка обязательных полей формы (поднимаем над затемнением, добавляем свечение) */
.ob-required-glow {
  position: relative; z-index: 9001;
  background: #ffffff; border-radius: 12px; padding: 10px 12px; margin: -4px -6px;
  box-shadow: 0 0 0 2px #3b82f6, 0 0 0 7px rgba(59, 130, 246, .18), 0 10px 26px rgba(15, 31, 53, .12);
  animation: obFieldPulse 1.7s ease-in-out infinite;
}
.ob-required-glow .input {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, .12) !important;
}
.ob-required-glow .form-label { color: #1e3a5f; font-weight: 700; }
/* Подсветка кнопки «Добавить» на шаге 2 — голубым ореолом, в тон полям. */
.ob-submit-glow {
  position: relative; z-index: 9001;
  border-radius: 12px;
  box-shadow: 0 0 0 3px #3b82f6, 0 0 0 8px rgba(59, 130, 246, .22), 0 10px 26px rgba(30, 86, 214, .3) !important;
  animation: obSubmitPulse 1.5s ease-in-out infinite;
}
@keyframes obSubmitPulse {
  0%, 100% { box-shadow: 0 0 0 3px #3b82f6, 0 0 0 8px rgba(59, 130, 246, .22), 0 10px 26px rgba(30, 86, 214, .3); transform: translateY(0); }
  50% { box-shadow: 0 0 0 3px #3b82f6, 0 0 0 13px rgba(59, 130, 246, .07), 0 14px 30px rgba(30, 86, 214, .36); transform: translateY(-2px); }
}
@keyframes obFieldPulse {
  0%, 100% { box-shadow: 0 0 0 2px #3b82f6, 0 0 0 7px rgba(59, 130, 246, .18), 0 10px 26px rgba(15, 31, 53, .12); }
  50% { box-shadow: 0 0 0 2px #3b82f6, 0 0 0 11px rgba(59, 130, 246, .05), 0 10px 26px rgba(15, 31, 53, .16); }
}

/* Празднование успеха */
.ob-celebrate {
  position: fixed; inset: 0; z-index: 9100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13, 27, 52, .45); animation: obFadeIn .25s ease;
}
.ob-celebrate-out { animation: obFadeOut .4s ease forwards; }
@keyframes obFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes obFadeOut { to { opacity: 0; } }
.ob-celebrate-card {
  background: #fff; border-radius: 20px; padding: 30px 36px; text-align: center;
  box-shadow: 0 24px 60px rgba(13, 27, 52, .4);
  animation: obPop .45s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes obPop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.ob-celebrate-title { font-size: 20px; font-weight: 800; color: #0f7b3e; margin-top: 8px; }
.ob-celebrate-text { font-size: 13.5px; color: #44546b; margin-top: 4px; }

.ob-check svg { width: 72px; height: 72px; }
.ob-check-c { stroke: #22c55e; stroke-width: 2.5; stroke-dasharray: 151; stroke-dashoffset: 151; animation: obStroke .5s ease forwards; }
.ob-check-m { stroke: #22c55e; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 48; stroke-dashoffset: 48; animation: obStroke .35s .45s ease forwards; }
@keyframes obStroke { to { stroke-dashoffset: 0; } }

/* Конфетти */
.ob-confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ob-confetti i {
  position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px;
  animation: obFall 2.1s linear forwards;
}
@keyframes obFall {
  to { transform: translateY(105vh) rotate(620deg); opacity: .2; }
}

/* ═══════════════════════════════════════════════════════════════
   ФИКС: панели с backdrop-filter создают stacking context,
   из-за чего z-index подсвеченных полей и кнопки не поднимал их
   над затемняющей вуалью (.ob-overlay, z-index:9000).
   Поднимаем контейнеры-предки и снимаем обрезку.
   ═══════════════════════════════════════════════════════════════ */
.ob-lift{
  position: relative;
  z-index: 9001;
  overflow: visible !important;          /* .panel имеет overflow:hidden */
  backdrop-filter: none !important;      /* убирает stacking context */
  -webkit-backdrop-filter: none !important;
}
/* Пока идёт обучение — вуаль не перехватывает клики (уже pointer-events:none),
   а подсвеченные элементы кликабельны. */
body.ob-running .ob-required-glow,
body.ob-running .ob-submit-glow{ pointer-events: auto; }

/* Приглушаем НЕподсвеченные поля формы, чтобы взгляд шёл на обязательные.
   Рекомендованные (телефон / контакт / почта) НЕ приглушаем — они должны
   оставаться заметными наравне с обязательными. */
body.ob-running [data-onboard-company-form] .form-field:not(.ob-required-glow):not(.form-recommended):not(.form-submit){
  opacity:.45;
  filter:saturate(.6);
  transition:opacity .25s ease, filter .25s ease;
}
/* Рекомендованные поля во время обучения поднимаем над вуалью и подсвечиваем
   ГОЛУБЫМ свечением — тем же, что и обязательные поля (ИНН/Название). */
body.ob-running [data-onboard-company-form] .form-recommended{
  opacity:1; filter:none; position:relative; z-index:9001;
  box-shadow:0 0 0 2px #3b82f6, 0 0 0 7px rgba(59,130,246,.18), 0 10px 26px rgba(15,31,53,.12);
  animation:obRecPulse 1.7s ease-in-out infinite;
}
@keyframes obRecPulse{
  0%,100%{ box-shadow:0 0 0 2px #3b82f6, 0 0 0 7px rgba(59,130,246,.18), 0 10px 26px rgba(15,31,53,.12); }
  50%{ box-shadow:0 0 0 2px #3b82f6, 0 0 0 11px rgba(59,130,246,.05), 0 10px 26px rgba(15,31,53,.16); }
}
body.ob-running [data-onboard-company-form] .form-field.form-submit{
  opacity:1 !important;
  filter:none !important;
}
/* Кнопка «Добавить» — контейнер тоже поднимаем, иначе кнопка тонет */
body.ob-running [data-onboard-company-form] .form-submit{
  position:relative; z-index:9001;
}

/* Модальное окно «Новая компания»: во время обучения поднимаем его
   над затемняющей вуалью, иначе подсвеченные поля тонут под ней.
   Неподсвеченные поля всё равно приглушаются правилом выше. */
body.ob-running .mc-modal-overlay{
  z-index:9001;
  background:rgba(15,31,53,.42);
}
