/* ══════════════════════════════════════════════════════════════
   ПОПАП «СВЯЗАТЬСЯ С ОСНОВАТЕЛЯМИ» (кнопка в шапке и пункт мобильного меню).
   Разметку создаёт lead-popup.js при первом открытии. Поля формы используют
   общие классы сайта из style7.css (.cform, .cf-field, .cf-btn, .form-consent,
   .hp-field), здесь — только окно.
   z-index 6000: выше мобильной шапки (#nav 4500) и полосы прогресса (4700),
   ниже своего курсора (#cursor 8999) — иначе на десктопе пропадёт курсор.
══════════════════════════════════════════════════════════════ */
html.igm-popup-open,
html.igm-popup-open body { overflow: hidden !important; }
html.igm-popup-open body { padding-right: var(--lp-sbw, 0px); }
html.igm-popup-open #nav { right: var(--lp-sbw, 0px); }   /* шапка fixed: не прыгает, когда пропадает полоса прокрутки */

.lp-overlay {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 8, 8, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .25s ease;
}
.lp-overlay[hidden] { display: none; }
.lp-overlay.is-open { opacity: 1; }

.lp-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--graphite, #111);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--igm-card-radius, 8px);
  padding: 44px 40px 36px;
  color: var(--white, #f0ede8);
  font-family: var(--font, 'Inter', system-ui, sans-serif);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  transform: translateY(14px);
  transition: transform .3s var(--expo, cubic-bezier(.16, 1, .3, 1));
  text-align: left;
}
.lp-overlay.is-open .lp-dialog { transform: none; }
.lp-dialog:focus { outline: none; }

.lp-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: var(--igm-control-radius, 4px);
  color: var(--g5, #999);
  transition: color .2s, background .2s;
}
.lp-close:hover { color: var(--white, #f0ede8); background: rgba(255, 255, 255, .05); }
.lp-close svg { width: 18px; height: 18px; }

.lp-title {
  margin: 0 40px 10px 0;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--white, #f0ede8);
}
.lp-lead {
  margin: 0 0 28px;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--g5, #999);
}

/* .cform из style7.css задаёт display:flex и перебивает атрибут hidden */
.lp-dialog [hidden] { display: none !important; }
.lp-form .form-consent { flex-wrap: wrap; margin: 2px 0 14px; }
.lp-form .form-consent .igm-field-err { flex-basis: 100%; margin-top: 2px; }
.lp-form .cf-btn { width: 100%; }
.lp-form .cf-btn[disabled] { opacity: .7; }
.lp-turnstile:empty { display: none; }
.lp-error {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--red, #cc1122);
}
.lp-error a { color: inherit; text-decoration: underline; }
.lp-error[hidden] { display: none; }

.lp-dialog.is-done .lp-title,
.lp-dialog.is-done .lp-lead { display: none; }
.lp-success { padding: 12px 0 4px; text-align: center; }
.lp-success[hidden] { display: none; }
.lp-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--red, #cc1122);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lp-success-title { margin: 0 0 8px; font-size: 22px; font-weight: 800; color: var(--white, #f0ede8); }
.lp-success-text { margin: 0 0 28px; font-size: 14px; color: rgba(255, 255, 255, .55); }
.lp-success .cf-btn { width: 100%; }

/* Телефоны: окно на весь экран, поля 16px (iOS не увеличивает страницу при фокусе). */
@media (max-width: 600px) {
  .lp-overlay { padding: 0; align-items: stretch; }
  .lp-dialog {
    width: 100%;
    max-height: none;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
    padding: calc(56px + env(safe-area-inset-top, 0px)) 20px calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .lp-close { top: calc(8px + env(safe-area-inset-top, 0px)); right: 8px; }
}
@media (max-width: 900px), (hover: none), (pointer: coarse) {
  .lp-form .cf-field input,
  .lp-form .cf-field textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .lp-overlay, .lp-dialog { transition: none; }
  .lp-dialog { transform: none; }
}
