/* Единая всплывающая форма заявки (components/modals/lead.php, js/lead-popup.js).
   Брейкпоинты как в теме: 1920+, 1440, 1280, 992, 768, 480. */

.hlead {
    --hl-panel: #fff; --hl-ink: #1e1e1e; --hl-sub: #3c3c3c; --hl-mute: #8a8a8a; --hl-line: #d9d9d9;
    --hl-field: #ededed; --hl-btn: #333; --hl-card: #f1f1f1; --hl-overlay: rgba(12, 12, 12, .72); --hl-err: #c0392b;
    --hl-ease: cubic-bezier(.16, 1, .3, 1); --hl-ox: 50%; --hl-oy: 50%;
    --hl-py: 72px; --hl-px: 64px; --hl-py2: 52px; --hl-px2: 52px;
    position: fixed; inset: 0; z-index: 10050; font-family: "Suisse Intl", Arial, sans-serif; color: var(--hl-ink);
    -webkit-font-smoothing: antialiased;
}
.hlead[hidden], .hlead [hidden] { display: none !important; }
.hlead *, .hlead *::before, .hlead *::after { box-sizing: border-box; }
.hlead__overlay { position: absolute; inset: 0; background: var(--hl-overlay); opacity: 0; transition: opacity .2s linear; }
.hlead__stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; pointer-events: none; }
.hlead__panel {
    position: relative; pointer-events: auto; background: var(--hl-panel); border-radius: 20px;
    width: min(1556px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain;
    display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: 84px; padding: var(--hl-py) var(--hl-px);
    opacity: 0; transform: translateY(14px) scale(.965); transform-origin: var(--hl-ox) var(--hl-oy);
    transition: transform .32s var(--hl-ease), opacity .18s linear;
}
.hlead.is-open .hlead__overlay { opacity: 1; }
.hlead.is-open .hlead__panel { opacity: 1; transform: none; }
.hlead.is-closing .hlead__overlay { opacity: 0; transition-duration: .18s; }
.hlead.is-closing .hlead__panel { opacity: 0; transform: translateY(8px) scale(.985); transition: transform .18s ease-in, opacity .18s linear; }
.hlead.is-open [data-st] { animation: hleadRise .26s var(--hl-ease) both; animation-delay: calc(60ms + var(--i, 0) * 30ms); }
@keyframes hleadRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hlead__close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; padding: 0; background: transparent; cursor: pointer; border-radius: 50%; color: var(--hl-ink); z-index: 2; }
.hlead__close::before, .hlead__close::after { content: ""; position: absolute; left: 9px; right: 9px; top: 19px; height: 2px; background: currentColor; transform: rotate(45deg); }
.hlead__close::after { transform: rotate(-45deg); }
.hlead__close:hover { background: var(--hl-card); }
.hlead__close:focus-visible { outline: 2px solid var(--hl-ink); }

.hlead__form { display: grid; align-content: start; min-width: 0; margin: 0; }
.hlead__ctx { justify-self: start; font-size: 12.5px; line-height: 1.25; letter-spacing: .02em; color: var(--hl-sub); background: var(--hl-card); border-radius: 999px; padding: 6px 12px; margin-bottom: 16px; }
.hlead__title { margin: 0; font-size: 38px; line-height: 1.18; font-weight: 500; letter-spacing: -.01em; color: var(--hl-ink); text-wrap: balance; }
.hlead__sub { margin: 16px 0 0; font-size: 18px; line-height: 1.5; color: var(--hl-sub); max-width: 52ch; }
.hlead__fields { display: grid; margin-top: 26px; }
.hlead__f { display: block; margin: 0; border-bottom: 1px solid var(--hl-line); }
.hlead__f input, .hlead__ta textarea {
    display: block; width: 100%; border: 0; border-radius: 0; background: transparent; box-shadow: none;
    font-family: inherit; font-size: 17px; font-weight: 400; line-height: 1.3; letter-spacing: normal; color: var(--hl-ink); padding: 18px 0 14px; margin: 0; outline: 0;
}
.hlead__f input::placeholder, .hlead__ta textarea::placeholder { color: var(--hl-mute); opacity: 1; }
.hlead__f:focus-within { border-bottom-color: var(--hl-ink); }
.hlead__f.is-err { border-bottom-color: var(--hl-err); }
.hlead__f.is-pre input { color: var(--hl-ink); }
.hlead__ta textarea { resize: vertical; min-height: 70px; line-height: 1.4; padding: 16px 0 12px; }
.hlead__lbl { margin: 18px 0 10px; font-size: 16px; color: var(--hl-sub); }
.hlead__lbl label { font: inherit; color: inherit; margin: 0; }
.hlead__sel {
    display: block; width: 100%; height: auto; font-family: inherit; font-size: 16px; font-weight: 400; line-height: 1.3; color: var(--hl-ink);
    background: var(--hl-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231e1e1e' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 0; border-radius: 8px; padding: 12px 40px 12px 14px; margin: 0; appearance: none; -webkit-appearance: none;
}
.hlead__sel.is-top { margin-top: 18px; }
.hlead__sel:focus-visible { outline: 2px solid var(--hl-ink); }
.hlead__file { position: relative; display: flex; align-items: center; gap: 12px; border: 1px dashed #bdbdbd; border-radius: 10px; padding: 14px 16px; margin: 16px 0 0; cursor: pointer; color: var(--hl-sub); font-size: 15px; line-height: 1.35; }
.hlead__file:hover, .hlead__file:focus-within { border-color: var(--hl-ink); }
.hlead__file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hlead__file svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--hl-ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hlead__file small { display: block; color: var(--hl-mute); font-size: 13px; }
.hlead__err { margin: 14px 0 0; font-size: 14px; color: var(--hl-err); }
.hlead__submit { margin: 16px 0 0; width: 100%; font-family: inherit; font-size: 18px; font-weight: 400; line-height: 1; color: #fff; background: var(--hl-btn); border: 0; border-radius: 10px; padding: 21px 20px; cursor: pointer; transition: background .15s; }
.hlead__submit:hover { background: #1f1f1f; }
.hlead__submit:disabled { opacity: .7; cursor: wait; }
.hlead__submit:focus-visible { outline: 2px solid var(--hl-ink); outline-offset: 2px; }
.hlead__policy { position: relative; display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--hl-sub); cursor: pointer; font-weight: 400; }
.hlead__policy input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; left: 0; top: 0; }
.hlead__box { flex: none; width: 20px; height: 20px; border: 1.5px solid #9a9a9a; border-radius: 5px; background: #fff; display: flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
.hlead__box::after { content: ""; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); opacity: 0; }
.hlead__policy input:checked + .hlead__box { background: var(--hl-ink); border-color: var(--hl-ink); }
.hlead__policy input:checked + .hlead__box::after { opacity: 1; }
.hlead__policy input:focus-visible + .hlead__box { outline: 2px solid var(--hl-ink); outline-offset: 2px; }
.hlead__policy.is-err .hlead__box { border-color: var(--hl-err); }
.hlead__policy.is-err { color: var(--hl-err); }
.hlead__policy a { color: var(--hl-ink); text-decoration: none; font-weight: 500; }
.hlead__later { justify-self: center; margin-top: 10px; font: inherit; font-size: 14px; background: none; border: 0; color: var(--hl-mute); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.hlead__seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 4px; }
.hlead__seg label { position: relative; margin: 0; }
.hlead__seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.hlead__seg span { display: block; text-align: center; font-size: 14px; padding: 12px 4px; border-radius: 8px; background: var(--hl-field); color: var(--hl-ink); cursor: pointer; }
.hlead__seg input:checked + span { background: var(--hl-ink); color: #fff; }
.hlead__seg input:focus-visible + span { outline: 2px solid var(--hl-ink); outline-offset: 2px; }

.hlead__info { display: grid; gap: 14px; justify-items: start; margin-top: 16px; }
.hlead__sub--info { margin: 0; }
.hlead__mail { font-size: 28px; line-height: 1.2; font-weight: 500; color: var(--hl-ink); text-decoration: none; border-bottom: 1px solid var(--hl-line); padding-bottom: 6px; margin-top: 8px; }
.hlead__mail:hover { border-bottom-color: var(--hl-ink); color: var(--hl-ink); }
.hlead__copy { font: inherit; font-size: 15px; color: var(--hl-ink); background: var(--hl-field); border: 0; border-radius: 8px; padding: 11px 16px; cursor: pointer; }
.hlead__mail:focus-visible, .hlead__copy:focus-visible { outline: 2px solid var(--hl-ink); outline-offset: 3px; }
.hlead__note { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--hl-mute); }

.hlead__aside { display: grid; gap: 14px; align-content: start; min-width: 0; }
.hlead__vis { position: relative; border-radius: 14px; overflow: hidden; background: #e2e2df; aspect-ratio: 960 / 500; }
.hlead__vis img { display: block; width: 100%; height: 100%; object-fit: cover; max-width: none; }
.hlead__cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hlead__card { background: var(--hl-card); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: center; color: var(--hl-ink); }
.hlead__ico { width: 48px; height: 48px; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px #e4e4e4; }
.hlead__ico svg { display: block; width: 26px; height: 26px; flex: none; }
.hlead__card b { display: block; font-weight: 500; font-size: 17px; line-height: 1.3; }
.hlead__card .hlead__cd { display: block; font-size: 14px; line-height: 1.4; color: var(--hl-sub); margin-top: 3px; }
.hlead__adv { display: none; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
.hlead__adv div { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--hl-card); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; line-height: 1.3; font-weight: 500; }
.hlead__adv i { width: 32px; height: 32px; border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px #e4e4e4; font-style: normal; }
.hlead__adv svg { width: 18px; height: 18px; display: block; }
.hlead__grab { display: none; }

/* окна без картинки: страницы вне физической охраны, «Связаться» в шапке, резюме, руководитель */
.hlead--plain .hlead__panel { width: min(640px, 100%); grid-template-columns: minmax(0, 1fr); padding: var(--hl-py2) var(--hl-px2); }
.hlead--plain .hlead__aside, .hlead--plain .hlead__adv, .hlead--compact .hlead__adv { display: none !important; }
/* ловец лидов */
.hlead--compact .hlead__panel { width: min(600px, 100%); grid-template-columns: minmax(0, 1fr); padding: var(--hl-py2) var(--hl-px2); }
.hlead--compact .hlead__aside { display: none; }

/* ===== адаптив ===== */
@media (max-width: 1919px) {
    .hlead { --hl-py: 56px; --hl-px: 52px; --hl-py2: 48px; --hl-px2: 48px; }
    .hlead__panel { width: min(1360px, 100%); grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 64px; }
    .hlead__title { font-size: 34px; } .hlead__sub { font-size: 17px; }
}
@media (max-width: 1439px) {
    .hlead { --hl-py: 44px; --hl-px: 40px; --hl-py2: 44px; --hl-px2: 44px; }
    .hlead__panel { width: min(1180px, 100%); grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 44px; }
    .hlead__title { font-size: 30px; } .hlead__sub { font-size: 16px; margin-top: 12px; }
    .hlead__fields { margin-top: 20px; } .hlead__f input { padding: 15px 0 12px; } .hlead__submit { padding: 19px 20px; }
    .hlead__card { padding: 12px 14px; gap: 12px; grid-template-columns: 44px minmax(0, 1fr); } .hlead__ico { width: 44px; height: 44px; }
    .hlead__card b { font-size: 15px; } .hlead__card .hlead__cd { font-size: 13px; }
}
@media (max-width: 1279px) {
    .hlead { --hl-py: 40px; --hl-px: 32px; --hl-py2: 40px; --hl-px2: 40px; }
    .hlead__stage { padding: 20px; }
    .hlead__panel { grid-template-columns: minmax(0, 1fr) minmax(0, .92fr); gap: 32px; }
    .hlead__title { font-size: 28px; }
    .hlead__card { grid-template-columns: 40px minmax(0, 1fr); padding: 10px 12px; } .hlead__ico { width: 40px; height: 40px; border-radius: 10px; } .hlead__ico svg { width: 22px; height: 22px; }
    .hlead__card b { font-size: 14px; } .hlead__card .hlead__cd { display: none; }
}
@media (max-width: 991px) {
    .hlead { --hl-py: 44px; --hl-px: 40px; --hl-py2: 44px; --hl-px2: 40px; }
    .hlead__panel { width: min(640px, 100%); grid-template-columns: minmax(0, 1fr); }
    .hlead__aside { display: none; } .hlead__adv { display: grid; }
    .hlead__title { font-size: 30px; }
}
/* невысокие экраны */
@media (min-width: 992px) and (max-height: 860px) {
    .hlead { --hl-py: 40px; --hl-py2: 40px; }
    .hlead__vis { aspect-ratio: 960 / 420; }
    .hlead__fields { margin-top: 16px; } .hlead__f input { padding: 13px 0 10px; } .hlead__lbl { margin: 14px 0 8px; }
    .hlead__submit { padding: 17px 20px; } .hlead__policy { margin-top: 16px; }
}
@media (min-width: 992px) and (max-height: 720px) {
    .hlead__vis { display: none; } .hlead__aside { align-content: center; } .hlead__cards { grid-template-columns: 1fr; }
    .hlead__title { font-size: 28px; }
}

/* шторка: ширина окна меньше 768 */
@media (max-width: 767px) {
    .hlead__stage { align-items: flex-end; padding: 0; }
    .hlead__panel, .hlead--plain .hlead__panel, .hlead--compact .hlead__panel {
        width: 100%; max-width: 560px; max-height: calc(100% - 28px); max-height: calc(100dvh - 28px); border-radius: 20px 20px 0 0;
        grid-template-columns: minmax(0, 1fr); padding: 30px 20px calc(22px + env(safe-area-inset-bottom, 0px));
        opacity: 1; transform: translateY(100%); transition: transform .34s var(--hl-ease), opacity .12s linear;
    }
    .hlead.is-open .hlead__panel { transform: none; }
    .hlead.is-closing .hlead__panel { transform: translateY(100%); transition: transform .22s ease-in; }
    .hlead--compact .hlead__panel { max-height: 46%; max-height: 46dvh; }
    .hlead__title { font-size: 25px; padding-right: 28px; } .hlead__sub { font-size: 15px; margin-top: 10px; }
    .hlead__ctx { max-width: calc(100% - 40px); }
    .hlead__fields { margin-top: 16px; }
    .hlead__f input, .hlead__ta textarea { font-size: 16px; padding: 14px 0 11px; }
    .hlead__submit { padding: 18px; font-size: 17px; } .hlead__policy { margin-top: 16px; font-size: 13px; }
    .hlead__close { top: 10px; right: 8px; }
    .hlead__mail { font-size: 22px; }
    .hlead__grab { display: block; position: absolute; top: 0; left: 0; right: 0; height: 26px; cursor: grab; touch-action: none; }
    .hlead__grab::after { content: ""; position: absolute; left: 50%; top: 9px; width: 40px; height: 4px; border-radius: 2px; background: #cfcfcf; transform: translateX(-50%); }
}
@media (max-width: 479px) {
    .hlead__panel, .hlead--plain .hlead__panel, .hlead--compact .hlead__panel { padding: 28px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
    .hlead__title { font-size: 23px; }
    .hlead__submit { font-size: 16px; padding: 17px; }
    .hlead__adv div { font-size: 12.5px; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 7px 8px; }
    .hlead__adv i { width: 28px; height: 28px; } .hlead__adv svg { width: 16px; height: 16px; }
}
@media (max-width: 374px) {
    .hlead__title { font-size: 21px; }
    .hlead__seg { grid-template-columns: 1fr 1fr; }
    .hlead__adv { grid-template-columns: 1fr; }
}
@media (max-height: 500px) and (max-width: 991px) {
    .hlead__panel, .hlead--plain .hlead__panel, .hlead--compact .hlead__panel { max-height: 100%; border-radius: 0; max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .hlead__panel { transform: none !important; transition: opacity .12s linear !important; }
    .hlead.is-open [data-st] { animation: none; }
}
