/* ==========================================================
   LEAD MODAL — обратная связь (дизайн DEV/form, dark glass)
   Переменные локальные у .lead-modal, чтобы не затереть :root сайта.
   ========================================================== */

.lead-modal {
    /* Фон как у .header: #23446F → #183454 */
    --lm-bg: linear-gradient(135deg, #23446F 0%, #1D3B63 45%, #183454 100%);
    --lm-card: rgba(255, 255, 255, 0.06);
    --lm-border: rgba(255, 255, 255, 0.14);
    --lm-text: #f6fbff;
    --lm-text-light: rgba(255, 255, 255, 0.72);
    --lm-blue: #27b0ff;
    --lm-green: #28d7a1;
    --lm-radius: 26px;

    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--lm-text);
}

.lead-modal[hidden] {
    display: none !important;
}

.lead-modal__backdrop {
    position: absolute;
    inset: 0;
    /* Затемнение поверх страницы; сам диалог — в цветах шапки */
    background: rgba(29, 59, 99, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lead-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 980px;
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 36px 36px 32px;
    border-radius: var(--lm-radius);
    background: var(--lm-bg);
    border: 1px solid var(--lm-border);
    box-shadow: 0 8px 24px rgba(15, 35, 65, 0.28), 0 30px 80px rgba(15, 35, 65, 0.35);
    scrollbar-width: thin;
    scrollbar-color: rgba(39, 176, 255, 0.35) transparent;
}

.lead-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 1px solid var(--lm-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--lm-text);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.lead-modal__close:hover {
    background: rgba(39, 176, 255, 0.18);
    border-color: rgba(39, 176, 255, 0.45);
    color: #fff;
}

.lead-modal__intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 28px;
    padding-right: 24px;
}

.lead-modal__tag {
    display: inline-block;
    margin-bottom: 14px;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(39, 176, 255, 0.28);
    background: rgba(39, 176, 255, 0.08);
    color: var(--lm-blue);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.lead-modal__title {
    margin: 0 0 12px;
    font-size: clamp(1.55rem, 3vw, 2rem);
    line-height: 1.2;
    font-weight: 700;
    color: var(--lm-text);
}

.lead-modal__subtitle {
    margin: 0;
    color: var(--lm-text-light);
    font-size: 0.98rem;
    line-height: 1.55;
}

.lead-modal__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.85fr);
    gap: 20px;
    align-items: start;
}

/* ---------- Карточка формы (светлая) и блок ссылок ---------- */

.lead-modal__form-card,
.lead-modal__links {
    position: relative;
    border-radius: var(--lm-radius);
    overflow: hidden;
    animation: leadModalGlassBreath 8s ease-in-out infinite;
}

.lead-modal__form-card {
    /* Светлая панель полей поверх тёмного фона шапки */
    padding: 36px;
    background: #f5f8fd;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 12px 40px rgba(15, 35, 65, 0.18);
    color: #1d2433;
}

.lead-modal__links {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--lm-border);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.lead-modal__form-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(39, 176, 255, 0.45),
        rgba(40, 215, 161, 0.35),
        transparent 70%
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.lead-modal__links::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(39, 176, 255, 0.35),
        rgba(40, 215, 161, 0.28),
        transparent 70%
    );
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.lead-modal__form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.lead-modal__field {
    display: flex;
    flex-direction: column;
}

.lead-modal__field label {
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1d2433;
}

.lead-modal__field small {
    margin-top: 10px;
    color: #697488;
    font-size: 13px;
    line-height: 1.5;
}

.lead-modal__field input,
.lead-modal__field textarea {
    width: 100%;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid #e4e9f2;
    background: #fff;
    color: #1d2433;
    font: inherit;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    resize: vertical;
}

.lead-modal__field textarea {
    min-height: 120px;
}

.lead-modal__field input::placeholder,
.lead-modal__field textarea::placeholder {
    color: #9aa6b8;
}

.lead-modal__field input:focus,
.lead-modal__field textarea:focus {
    border-color: rgba(13, 79, 215, 0.45);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(13, 79, 215, 0.12);
}

.lead-modal__error {
    display: block;
    margin-top: 8px;
    color: #c62828;
    font-size: 0.88rem;
}

.lead-modal__topics-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.lead-modal__topics-title {
    font-size: 14px;
    color: #697488;
    white-space: nowrap;
}

.lead-modal__topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.lead-modal__topics-list span {
    position: relative;
    color: #3d4a5c;
    font-size: 14px;
}

.lead-modal__topics-list span:not(:last-child)::after {
    content: "•";
    position: absolute;
    right: -12px;
    color: #c5cedb;
}

.lead-modal__consent {
    margin: 0;
}

.lead-modal__checkbox {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    color: #697488;
    font-size: 0.95rem;
    line-height: 1.45;
}

.lead-modal__checkbox input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: #0d4fd7;
}

.lead-modal__checkbox a {
    color: #0d4fd7;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.lead-modal__status {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.lead-modal__status.is-success {
    background: rgba(0, 179, 126, 0.12);
    color: #0a7a56;
}

.lead-modal__status.is-error {
    background: rgba(198, 40, 40, 0.1);
    color: #c62828;
}

/* ---------- Кнопка отправки ---------- */

.lead-modal__submit {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 18px 28px;
    border: none;
    border-radius: 18px;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    background: linear-gradient(120deg, var(--lm-blue), var(--lm-green), var(--lm-blue));
    background-size: 200% 200%;
    animation: leadModalButtonGradient 6s ease infinite;
    transition: transform 0.35s, box-shadow 0.35s;
}

.lead-modal__submit::before {
    content: "";
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(120deg, var(--lm-blue), var(--lm-green));
    filter: blur(18px);
    opacity: 0.45;
    z-index: -1;
}

.lead-modal__submit:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 18px 45px rgba(39, 176, 255, 0.35);
}

.lead-modal__submit:hover:not(:disabled) .lead-modal__btn-arrow {
    transform: translateX(8px);
}

.lead-modal__submit:disabled {
    cursor: wait;
}

.lead-modal__btn-text {
    display: inline-flex;
    align-items: center;
}

.lead-modal__btn-arrow {
    width: 22px;
    height: 22px;
    transition: transform 0.35s ease;
}

.lead-modal__btn-loader {
    display: none !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.lead-modal__btn-loader span {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    animation: leadModalButtonDots 1.2s infinite ease-in-out;
}

.lead-modal__btn-loader span:nth-child(2) {
    animation-delay: 0.15s;
}

.lead-modal__btn-loader span:nth-child(3) {
    animation-delay: 0.3s;
}

.lead-modal__btn-success {
    display: none !important;
    align-items: center;
}

.lead-modal__submit.is-loading .lead-modal__btn-loader {
    display: flex !important;
}

.lead-modal__submit.is-loading .lead-modal__btn-text,
.lead-modal__submit.is-loading .lead-modal__btn-arrow {
    display: none !important;
}

.lead-modal__submit.is-success .lead-modal__btn-loader,
.lead-modal__submit.is-success .lead-modal__btn-text,
.lead-modal__submit.is-success .lead-modal__btn-arrow {
    display: none !important;
}

.lead-modal__submit.is-success .lead-modal__btn-success {
    display: inline-flex !important;
}

.lead-modal__note {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    color: #697488;
    font-size: 14px;
    line-height: 1.7;
}

.lead-modal__note svg {
    flex-shrink: 0;
    color: #00b37e;
}

/* ---------- Боковые контакты ---------- */

.lead-modal__links {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
}

.lead-modal__link-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    width: 100%;
    padding: 16px 14px;
    border-radius: 18px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.03);
    color: inherit;
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, transform 0.3s;
}

.lead-modal__link-card:hover {
    background: rgba(39, 176, 255, 0.08);
    border-color: rgba(39, 176, 255, 0.22);
    transform: translateY(-2px);
}

.lead-modal__link-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: rgba(39, 176, 255, 0.1);
    color: var(--lm-blue);
}

.lead-modal__link-icon svg {
    width: 22px;
    height: 22px;
}

.lead-modal__link-card h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    font-weight: 650;
    color: var(--lm-text);
}

.lead-modal__link-card p {
    margin: 0;
    color: var(--lm-text-light);
    font-size: 0.9rem;
    line-height: 1.4;
}

body.lead-modal-open {
    overflow: hidden;
}

@keyframes leadModalGlassBreath {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(39, 176, 255, 0);
    }
    50% {
        box-shadow: 0 0 35px rgba(39, 176, 255, 0.08);
    }
}

@keyframes leadModalButtonGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes leadModalButtonDots {
    0%,
    80%,
    100% {
        transform: scale(0.5);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 860px) {
    .lead-modal__layout {
        grid-template-columns: 1fr;
    }

    .lead-modal__form-card {
        padding: 28px 22px;
    }

    .lead-modal__dialog {
        padding: 28px 18px 20px;
    }
}

@media (max-width: 760px) {
    .lead-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .lead-modal__dialog {
        border-radius: 22px 22px 12px 12px;
        max-height: calc(100vh - 24px);
    }

    .lead-modal__intro {
        padding-right: 28px;
        text-align: left;
        margin-bottom: 20px;
    }

    .lead-modal__submit {
        white-space: normal;
        text-align: center;
    }
}
