.lead-form {
    background: rgba(224, 229, 237, 1);
    position: relative;
}

.lead-form__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    border-radius: 30px;
}

.lead-form__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lead-form--has-bg .container {
    position: relative;
    z-index: 1;
}

.lead-form__inner {
    display: flex;
    gap: 40px;
    align-items: stretch;
}

.lead-form--has-bg .lead-form__inner,
.lead-form--cooperation .lead-form__inner {
    padding: 110px;
}

.lead-form.lead-form--has-bg.lead-form--has-comment.lead-form--cooperation {
    margin-bottom: var(--section-gap, 0) !important;
}

.lead-form__panel {
    width: 580px;
    flex-shrink: 0;
    border-radius: 30px;
    padding: 40px;
    background: linear-gradient(180deg, #4085D9 0%, #0C3E9A 100%);
    color: rgba(255, 240, 240, 1);
    display: flex;
    flex-direction: column;
}

.lead-form--has-bg .lead-form__panel {
    background: rgba(255, 255, 255, 0.95);
    color: rgba(27, 27, 27, 1);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
}

.lead-form__title {
    font-family: 'Mulish', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 47px;
    margin: 0 0 12px;
    color: rgba(255, 240, 240, 1);
}

.lead-form--has-bg .lead-form__title {
    color: rgba(31, 79, 206, 1);
}

.lead-form__description {
    font-family: 'Mulish', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 28px;
    color: rgba(255, 240, 240, 1);
}

.lead-form--has-comment .lead-form__description,
.lead-form--has-bg .lead-form__description {
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(27, 27, 27, 1);
}

.lead-form__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 5px;
}

.lead-form__row {
    display: flex;
    gap: 16px;
}

.lead-form__field {
    flex: 1 1 auto;
    display: block;
}

.lead-form__field--full {
    flex: 1 1 100%;
    width: 100%;
}

.lead-form__row--name-phone .lead-form__field--name,
.lead-form__row--name-phone .lead-form__field--phone {
    flex: 0 0 245px;
    width: 245px;
}

.lead-form__input {
    width: 100%;
    height: 41px;
    border-radius: 40px;
    border: 1.5px solid rgba(224, 229, 237, 1);
    background: transparent;
    padding: 0 16px;
    font-family: 'Mulish', sans-serif;
    font-size: 16px;
    color: rgba(255, 240, 240, 1);
    outline: none;
    box-sizing: border-box;
}

.lead-form__input::placeholder {
    color: rgba(255, 240, 240, 0.7);
}

.lead-form--has-bg .lead-form__input {
    border-color: rgba(31, 79, 206, 1);
    color: rgba(31, 79, 206, 1);
}

.lead-form--has-bg .lead-form__input::placeholder {
    color: rgba(31, 79, 206, 0.5);
}

.lead-form__input:focus,
.lead-form__input:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
}

.lead-form__input:-webkit-autofill,
.lead-form__input:-webkit-autofill:hover,
.lead-form__input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: rgba(255, 240, 240, 1) !important;
    transition: background-color 9999s ease-out;
}

.lead-form__textarea {
    width: 100%;
    height: 93px;
    border-radius: 25px;
    border: 1.5px solid rgba(31, 79, 206, 1);
    background: transparent;
    padding: 12px 16px;
    font-family: 'Mulish', sans-serif;
    font-size: 16px;
    color: rgba(255, 240, 240, 1);
    resize: none;
    outline: none;
    box-sizing: border-box;
    display: block;
}

.lead-form__textarea::placeholder {
    color: rgba(255, 240, 240, 0.7);
}

.lead-form--has-bg .lead-form__textarea {
    color: rgba(31, 79, 206, 1);
    border-color: rgba(31, 79, 206, 1);
}

.lead-form--has-bg .lead-form__textarea::placeholder {
    color: rgba(31, 79, 206, 0.5);
}

.lead-form__textarea:focus {
    outline: none;
    box-shadow: none;
}

.lead-form__agree {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
}

.lead-form__agree.is-error svg rect { stroke: #ff6b6b; }
.lead-form__agree.is-error { animation: shake 0.3s; }

.lead-form__checkbox-input {
    position: absolute !important;
    opacity: 0;
    pointer-events: none;
    bottom: auto !important;
    margin: 0 !important;
}

.lead-form__checkbox-ui {
    display: flex;
    align-items: center;
    min-width: 19px;
    height: 19px;
    flex-shrink: 0;
    cursor: pointer;
}

.lead-form__checkbox-ui svg { display: block; }

.lead-form--has-comment .lead-form__checkbox-ui svg rect,
.lead-form--has-bg .lead-form__checkbox-ui svg rect {
    stroke: rgba(31, 79, 206, 1);
}

.lead-form--has-comment .lead-form__checkbox-check,
.lead-form--has-bg .lead-form__checkbox-check {
    stroke: rgba(31, 79, 206, 1);
}

.lead-form__checkbox-check {
    stroke-dasharray: 20;
    stroke-dashoffset: 20;
    opacity: 1;
    transition: stroke-dashoffset 0.25s ease;
}

.lead-form__checkbox-input:checked + .lead-form__checkbox-ui .lead-form__checkbox-check {
    stroke-dashoffset: 0;
}

.lead-form__agree-text {
    font-family: 'Mulish', sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 240, 240, 1);
}

.lead-form__agree-text a,
.lead-form__agree-text a:hover,
.lead-form__agree-text a:focus,
.lead-form__agree-text a:active {
    color: inherit;
    text-decoration: underline;
}

.lead-form--has-bg .lead-form__agree-text {
    color: rgba(27, 27, 27, 1);
}

.lead-form__submit {
    width: 100%;
    height: 41px;
    border-radius: 40px;
    background: rgba(224, 229, 237, 1);
    border: none;
    cursor: pointer;
    font-family: 'Mulish', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: rgba(31, 79, 206, 1);
    margin-top: 12px;
    transition: background 0.2s, color 0.2s, opacity 0.2s, transform 0.2s ease;
}

.lead-form--has-bg .lead-form__submit {
    background: rgba(31, 79, 206, 1);
    color: #fff;
}

.lead-form__submit:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

.lead-form__image {
    flex: 1 1 auto;
    display: flex;
}

.lead-form__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 30px;
    display: block;
}

.lead-form__quform-hidden {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.lead-form__success {
    display: none;
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.lead-form__success.is-visible { display: block; }

.lead-form--has-bg .lead-form__success {
    background: rgba(31, 79, 206, 0.1);
    color: rgba(31, 79, 206, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
    0%   { transform: translateX(0); }
    25%  { transform: translateX(-4px); }
    50%  { transform: translateX(4px); }
    75%  { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

@media (max-width: 1024px) {

    .lead-form--has-img .lead-form__inner {
        flex-direction: row;
        align-items: stretch;
        gap: 20px;
    }

    .lead-form--has-img .lead-form__panel {
        width: 452px;
        flex-shrink: 0;
        padding: 28px 24px;
        min-height: 328px;
        box-sizing: border-box;
    }

    .lead-form--has-img .lead-form__title {
        font-size: 28px;
        line-height: 35px;
        margin-bottom: 10px;
    }

    .lead-form--has-img .lead-form__description {
        font-size: 12px;
        font-weight: 600;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    .lead-form--has-img .lead-form__form { gap: 12px; }

    .lead-form--has-img .lead-form__row--name-phone .lead-form__field--name,
    .lead-form--has-img .lead-form__row--name-phone .lead-form__field--phone {
        flex: 0 0 196px;
        width: 196px;
    }

    .lead-form--has-img .lead-form__row--name-phone .lead-form__input {
        height: 38px;
    }

    .lead-form--has-img .lead-form__checkbox-ui { min-width: 15px; height: 20px; }
    .lead-form--has-img .lead-form__checkbox-ui svg { width: 15px; height: 20px; }

    .lead-form--has-img .lead-form__agree-text { font-size: 12px; font-weight: 400; line-height: 1.5; }

    .lead-form--has-img .lead-form__submit {
        font-size: 12px;
        font-weight: 600;
        height: 38px;
        margin-top: 8px;
    }

    .lead-form--has-img .lead-form__image { flex: 1 1 auto; min-height: 328px; }
    .lead-form--has-img .lead-form__img { height: 100%; object-fit: cover; }

    .lead-form--has-bg .lead-form__inner {
        flex-direction: row;
        align-items: flex-start;
        padding: 60px 40px;
    }

    .lead-form--has-bg .lead-form__panel {
        width: 452px;
        padding: 28px 24px;
    }

    .lead-form--has-bg .lead-form__title { font-size: 28px; line-height: 35px; }
    .lead-form--has-bg .lead-form__description { font-size: 12px; line-height: 19px; }

    .lead-form--has-bg .lead-form__row--name-phone .lead-form__field--name,
    .lead-form--has-bg .lead-form__row--name-phone .lead-form__field--phone {
        flex: 0 0 196px;
        width: 196px;
    }

    .lead-form--has-bg .lead-form__row--name-phone .lead-form__input {
        height: 38px;
    }

    .lead-form--cooperation .lead-form__inner {
        padding: 60px 40px;
    }

    .lead-form--cooperation .lead-form__panel {
        width: 452px;
        padding: 28px 24px;
    }
}

/* ============================================================
   МОБИЛЬНЫЙ (≤640px)
   ============================================================ */
@media (max-width: 640px) {

    .lead-form--has-img,
    .lead-form--has-img * { text-align: left !important; }

    .lead-form--has-img .lead-form__inner { flex-direction: column; gap: 16px; }

    .lead-form--has-img .lead-form__panel {
        width: 100%;
        padding: 24px 16px;
        min-height: unset;
    }

    .lead-form--has-img .lead-form__title { font-size: 22px; line-height: 29px; margin-bottom: 10px; }
    .lead-form--has-img .lead-form__description { font-size: 12px; font-weight: 600; line-height: 1.5; margin-bottom: 16px; }
    .lead-form--has-img .lead-form__form { gap: 12px; }

    .lead-form--has-img .lead-form__row--name-phone {
        flex-direction: column;
        gap: 12px;
    }

    .lead-form--has-img .lead-form__row--name-phone .lead-form__field--name,
    .lead-form--has-img .lead-form__row--name-phone .lead-form__field--phone {
        flex: 1 1 auto;
        width: 100%;
    }

    .lead-form--has-img .lead-form__row--name-phone .lead-form__input { width: 100%; height: 41px; }

    .lead-form--has-img .lead-form__checkbox-ui { min-width: 15px; height: 15px; }
    .lead-form--has-img .lead-form__checkbox-ui svg { width: 15px; height: 15px; }
    .lead-form--has-img .lead-form__agree-text { font-size: 12px; font-weight: 400; line-height: 1.5; }
    .lead-form--has-img .lead-form__submit { font-size: 12px; font-weight: 600; height: 41px; margin-top: 8px; text-align: center !important; }

    .lead-form--has-img .lead-form__image { width: 100%; min-height: 220px; }
    .lead-form--has-img .lead-form__img { width: 100%; height: 100%; min-height: 220px; object-fit: cover; border-radius: 20px; }

    .lead-form--has-bg .lead-form__bg {
        position: relative;
        height: 220px;
        border-radius: 20px;
        margin: 0 auto 16px;
        width: calc(100% - 60px);

    }

    .lead-form.lead-form--has-bg.lead-form--has-comment.lead-form--cooperation {
        margin-bottom: var(--section-gap, 60px) !important;
    }

    .lead-form--has-bg .lead-form__bg-img { border-radius: 20px; }

    .lead-form--has-bg .container { display: flex; flex-direction: column; align-items: center; }

    .lead-form--has-bg .lead-form__inner { padding: 0; }

    .lead-form--has-bg .lead-form__panel { width: 100%; padding: 24px 16px; }

    .lead-form--has-bg .lead-form__title { font-size: 22px; line-height: 29px; text-align: left; }
    .lead-form--has-bg .lead-form__description { font-size: 12px; line-height: 19px; text-align: left; }

    .lead-form--has-bg .lead-form__row--name-phone {
        flex-direction: column;
        gap: 12px;
    }

    .lead-form--has-bg .lead-form__row--name-phone .lead-form__field--name,
    .lead-form--has-bg .lead-form__row--name-phone .lead-form__field--phone {
        flex: 1 1 auto;
        width: 100%;
    }

    .lead-form--has-bg .lead-form__agree-text { text-align: left; }
    .lead-form--has-bg .lead-form__submit { text-align: center; }

    .lead-form--cooperation .lead-form__inner { padding: 0 0 24px; }

    .lead-form--cooperation .lead-form__panel { width: 100%; padding: 24px 16px; }

    .lead-form--cooperation .lead-form__row { flex-direction: column; gap: 12px; }

    .lead-form__panel {
        padding: 28px 20px;
    }

    .lead-form__title {
        font-size: 28px;
        line-height: 36px;
    }
}