/* =========================================================
   Residence Permit — custom lead forms
   ========================================================= */

.res-lead-form,
.res-lead-form * {
    box-sizing: border-box;
}

.res-lead-form {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 24px;

    color: #253858;

    background: rgba(255, 255, 255, 0.96);

    border: 1px solid rgba(54, 127, 213, 0.16);
    border-radius: 22px;

    box-shadow:
        0 20px 60px rgba(17, 61, 153, 0.12),
        0 6px 20px rgba(17, 61, 153, 0.06);
}

.res-lead-form__title {
    display: block;

    margin: 0 0 18px;

    color: #253858;

    font-size: 25px;
    font-weight: 700;
    line-height: 1.2;
}

.res-lead-form__field {
    margin: 0 0 12px;
}

.res-lead-form__field input,
.res-lead-form__field textarea {
    width: 100%;

    min-height: 52px;

    padding: 13px 15px;

    border: 1px solid #d7e2f0;
    border-radius: 12px;

    background: #ffffff;
    color: #253858;

    font: inherit;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.res-lead-form__field input::placeholder,
.res-lead-form__field textarea::placeholder {
    color: #7c8798;
    opacity: 1;
}

.res-lead-form__field textarea {
    min-height: 125px;
    resize: vertical;
}

.res-lead-form__field input:focus,
.res-lead-form__field textarea:focus {
    border-color: #367fd5;

    box-shadow:
        0 0 0 4px rgba(54, 127, 213, 0.12);

    background: #ffffff;
}

.res-lead-form__field.has-error input,
.res-lead-form__field.has-error textarea {
    border-color: #d9534f;

    box-shadow:
        0 0 0 3px rgba(217, 83, 79, 0.10);
}

/* =========================================================
   Consent
   ========================================================= */

.res-lead-form__consent {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    margin: 5px 0 16px;
    padding: 10px 12px;

    border: 1px solid transparent;
    border-radius: 10px;

    color: #66758a;

    font-size: 12px;
    line-height: 1.4;

    cursor: pointer;
}

.res-lead-form__consent input {
    flex: 0 0 auto;

    width: 17px;
    height: 17px;

    margin: 1px 0 0;

    accent-color: #113d99;
}

.res-lead-form__consent.has-error {
    border-color: #d9534f;

    background: rgba(217, 83, 79, 0.05);
}

/* =========================================================
   Submit button
   ========================================================= */

.res-lead-form__submit {
    width: 100%;

    min-height: 52px;

    padding: 14px 20px;

    border: 0 !important;
    border-radius: 12px !important;

    background: linear-gradient(
        135deg,
        #113d99 0%,
        #0b327f 100%
    ) !important;

    color: #ffffff !important;

    font-weight: 700 !important;
    font-size: 16px;

    cursor: pointer;

    box-shadow:
        0 12px 26px rgba(17, 61, 153, 0.24);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        opacity 0.2s ease;
}

.res-lead-form__submit:hover {
    transform: translateY(-1px);

    box-shadow:
        0 16px 32px rgba(17, 61, 153, 0.30);
}

.res-lead-form__submit:disabled {
    opacity: 0.65;

    cursor: wait;

    transform: none;

    box-shadow: none;
}

.res-lead-form__result {
    min-height: 18px;

    margin-top: 10px;

    color: #c0392b;

    font-size: 13px;
}

/* =========================================================
   Honeypot
   ========================================================= */

.res-lead-form__trap {
    position: absolute !important;

    left: -10000px !important;

    width: 1px !important;
    height: 1px !important;

    overflow: hidden !important;
}

/* =========================================================
   Popup overlay — full screen
   ========================================================= */

.popup-wrapper {
    position: fixed !important;

    inset: 0 !important;

    width: 100vw !important;
    height: 100vh !important;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px !important;

    overflow-y: auto !important;

    background: rgba(0, 0, 0, 0.68) !important;

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    z-index: 999999 !important;
}

/* =========================================================
   Popup form container
   ========================================================= */

.popup-wrapper .external-form,
.popup-wrapper .popup-body {
    position: relative;

    width: 100% !important;
    max-width: 570px !important;

    margin: auto !important;
}

.popup-wrapper .external-form {
    padding: 16px !important;

    background: rgba(255, 255, 255, 0.98) !important;

    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 24px !important;

    box-shadow:
        0 30px 90px rgba(0, 0, 0, 0.34),
        0 10px 35px rgba(0, 0, 0, 0.18);
}

.popup-wrapper .res-lead-form {
    max-width: 100% !important;

    margin: 0 !important;
    padding: 22px !important;

    background: transparent !important;

    border: 0 !important;
    border-radius: 18px;

    box-shadow: none !important;
}

/* =========================================================
   Popup close
   ========================================================= */

.popup-wrapper .popup-close {
    position: fixed !important;

    top: 22px !important;
    right: 28px !important;

    z-index: 1000001 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 44px !important;
    height: 44px !important;

    border: 0 !important;
    border-radius: 50% !important;

    background: rgba(255, 255, 255, 0.16) !important;

    color: #ffffff !important;

    font-size: 30px !important;
    line-height: 1 !important;

    cursor: pointer !important;

    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.popup-wrapper .popup-close:hover {
    background: rgba(255, 255, 255, 0.28) !important;

    transform: rotate(90deg);
}

/* =========================================================
   Old external form wrappers
   ========================================================= */

.external-form .jv-wrapper,
.external-form .jv {
    width: 100% !important;

    min-height: 0 !important;

    margin: 0 !important;

    overflow: visible !important;
}

/* =========================================================
   Success modal
   ========================================================= */

.res-lead-modal-open {
    overflow: hidden !important;
}

.res-lead-success-modal {
    display: none;

    position: fixed;

    inset: 0;

    z-index: 1000002;

    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.68);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.res-lead-success-modal.is-visible {
    display: flex;
}

.res-lead-success-modal__box {
    position: relative;

    width: min(460px, 100%);

    padding: 36px 28px 28px;

    text-align: center;

    border-radius: 24px;

    background: #ffffff;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.28);
}

.res-lead-success-modal__close {
    position: absolute;

    top: 12px;
    right: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 50%;

    background: #edf3ff;
    color: #253858;

    font-size: 27px;
    line-height: 1;

    cursor: pointer;
}

.res-lead-success-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 68px;
    height: 68px;

    margin: 0 auto 15px;

    border-radius: 50%;

    background: #113d99;

    color: #ffffff;

    font-size: 32px;
    font-weight: 700;
}

.res-lead-success-modal__title {
    margin: 0 0 10px;

    color: #253858;

    font-size: 26px;
}

.res-lead-success-modal__text {
    margin: 0 0 20px;

    color: #66758a;

    line-height: 1.55;
}

.res-lead-success-modal__button {
    min-width: 170px;
    min-height: 48px;

    padding: 12px 22px;

    border: 0 !important;
    border-radius: 12px !important;

    background: #113d99 !important;
    color: #ffffff !important;

    font-weight: 700 !important;

    cursor: pointer;
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 575px) {

    .popup-wrapper {
        align-items: flex-start !important;

        padding:
            70px
            14px
            20px !important;
    }

    .popup-wrapper .external-form {
        max-width: 100% !important;

        padding: 10px !important;

        border-radius: 20px !important;
    }

    .popup-wrapper .res-lead-form {
        padding: 16px !important;
    }

    .popup-wrapper .popup-close {
        top: 14px !important;
        right: 14px !important;
    }

    .res-lead-form {
        padding: 18px;
    }

    .res-lead-form__title {
        font-size: 22px;
    }

    .res-lead-success-modal__box {
        padding: 30px 18px 22px;

        border-radius: 20px;
    }

    .res-lead-success-modal__title {
        font-size: 22px;
    }
}