/* =========================================================
   MODAL TRIGGER
========================================================= */

.home-hero__button--secondary[data-home-lead-modal-open] {
    appearance: none;
    font-family: inherit;
    cursor: pointer;
}


/* =========================================================
   PAGE LOCK
========================================================= */

html.is-home-lead-modal-open,
body.is-home-lead-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.is-home-lead-modal-open {
    touch-action: none;
}


/* =========================================================
   MODAL ROOT
========================================================= */

.home-lead-modal[hidden] {
    display: none !important;
}

.home-lead-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: grid;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    place-items: center;
    padding: 32px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.22s ease,
        visibility 0.22s ease;
}

.home-lead-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.home-lead-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--color-accent, #92462d);
}


/* =========================================================
   MODAL DIALOG
========================================================= */

.home-lead-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(1200px, calc(100vw - 64px));
    min-width: 0;
    max-height: calc(100dvh - 64px);
    overflow: hidden;
    border-radius: 4px;
    outline: none;
    color: var(--color-text, #2c2c2c);
    background: #f8f7f4;
    box-shadow: 0 30px 90px rgba(44, 44, 44, 0.14);
    transform: translateY(14px);
    transition: transform 0.22s ease;
}

.home-lead-modal.is-open .home-lead-modal__dialog {
    transform: translateY(0);
}


/* =========================================================
   MODAL HEADER
========================================================= */

.home-lead-modal__header {
    display: grid;
    min-width: 0;
    min-height: 106px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 30px;
    padding: 24px 40px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.09);
}

.home-lead-modal__title {
    max-width: 540px;
    margin: 0;
    color: var(--color-text, #2c2c2c);
    font-size: 25px;
    line-height: 0.98;
    font-weight: 450;
    letter-spacing: -0.035em;
}

.home-lead-modal__title-desktop {
    display: block;
}

.home-lead-modal__title-mobile {
    display: none;
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.home-lead-modal__close {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    appearance: none;
    border: 0;
    color: var(--color-text, #2c2c2c);
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
}

.home-lead-modal__close-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 50%;
    color: var(--color-accent, #92462d);
    font-size: 20px;
    line-height: 1;
    font-weight: 300;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.home-lead-modal__close:hover .home-lead-modal__close-icon {
    border-color: var(--color-accent, #92462d);
    color: #ffffff;
    background: var(--color-accent, #92462d);
}


/* =========================================================
   MODAL BODY
========================================================= */

.home-lead-modal__body {
    min-width: 0;
    padding: 46px 40px 40px;
    overflow: hidden;
}

.home-lead-modal__body .wpcf7,
.home-lead-modal__body .wpcf7-form {
    width: 100%;
    min-width: 0;
    margin: 0;
}

.home-lead-modal__body .wpcf7-form p {
    margin: 0;
}

.home-lead-modal__body .wpcf7-form br {
    display: none;
}


/* =========================================================
   FORM
========================================================= */

.home-lead-form {
    width: 100%;
    min-width: 0;
}


/* =========================================================
   NAME AND PHONE
========================================================= */

.home-lead-form__fields {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 48px;
}

.home-lead-form__field {
    display: grid;
    min-width: 0;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: center;
    gap: 22px;
}

.home-lead-form__label {
    color: var(--color-text, #2c2c2c);
    font-size: 20px;
    line-height: 1.15;
    font-weight: 450;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.home-lead-form__input-line {
    position: relative;
    display: block;
    min-width: 0;
}

.home-lead-form__input-line .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    min-width: 0;
}

.home-lead-form input[type="text"],
.home-lead-form input[type="tel"],
.home-lead-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 8px 24px 8px 0;
    appearance: none;
    border: 0;
    border-bottom: 1px solid rgba(44, 44, 44, 0.16);
    border-radius: 0;
    outline: none;
    color: var(--color-text, #2c2c2c);
    background: transparent;
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.2s ease;
}

.home-lead-form input[type="text"],
.home-lead-form input[type="tel"] {
    height: 38px;
}

.home-lead-form input[type="text"]:focus,
.home-lead-form input[type="tel"]:focus,
.home-lead-form textarea:focus {
    border-color: var(--color-accent, #92462d);
}

.home-lead-form input::placeholder,
.home-lead-form textarea::placeholder {
    color: rgba(44, 44, 44, 0.28);
    opacity: 1;
}

.home-lead-form__comma {
    position: absolute;
    right: 4px;
    bottom: 9px;
    color: var(--color-text, #2c2c2c);
    font-size: 18px;
    line-height: 1;
}


/* =========================================================
   INTEREST
========================================================= */

.home-lead-form__interest {
    display: flex;
    min-width: 0;
    align-items: center;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 34px;
}

.home-lead-form__radio {
    min-width: 0;
}

.home-lead-form__radio .wpcf7-form-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 22px;
}

.home-lead-form__radio .wpcf7-list-item {
    margin: 0;
}

.home-lead-form__radio .wpcf7-list-item label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    cursor: pointer;
}

.home-lead-form__radio input[type="radio"] {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin: 0;
    appearance: none;
    border: 1px solid rgba(44, 44, 44, 0.14);
    border-radius: 50%;
    outline: none;
    background: transparent;
    cursor: pointer;
}

.home-lead-form__radio input[type="radio"]::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-text, #2c2c2c);
    content: "";
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;
}

.home-lead-form__radio input[type="radio"]:checked::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.home-lead-form__radio .wpcf7-list-item-label {
    color: rgba(44, 44, 44, 0.85);
    font-size: 14px;
    line-height: 1.35;
    white-space: nowrap;
}


/* =========================================================
   COMMENT
========================================================= */

.home-lead-form__comment {
    margin-top: 32px;
}

.home-lead-form__comment .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.home-lead-form textarea {
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    padding-top: 5px;
    padding-bottom: 7px;
    overflow: hidden;
    resize: none;
}


/* =========================================================
   ACCEPTANCE
========================================================= */

.home-lead-form__acceptance {
    margin-top: 20px;
}

.home-lead-form__acceptance .wpcf7-list-item {
    margin: 0;
}

.home-lead-form__acceptance .wpcf7-list-item label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    cursor: pointer;
}

.home-lead-form__acceptance input[type="checkbox"] {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    margin: 0;
    appearance: none;
    border: 1px solid rgba(44, 44, 44, 0.14);
    border-radius: 4px;
    outline: none;
    background: transparent;
    cursor: pointer;
}

.home-lead-form__acceptance input[type="checkbox"]::after {
    position: absolute;
    top: 4px;
    left: 8px;
    width: 6px;
    height: 11px;
    border-right: 2px solid var(--color-accent, #92462d);
    border-bottom: 2px solid var(--color-accent, #92462d);
    content: "";
    opacity: 0;
    transform: rotate(45deg);
}

.home-lead-form__acceptance input[type="checkbox"]:checked::after {
    opacity: 1;
}

.home-lead-form__acceptance .wpcf7-list-item-label {
    color: rgba(44, 44, 44, 0.86);
    font-size: 14px;
    line-height: 1.4;
}

.home-lead-form__acceptance a {
    color: var(--color-accent, #92462d);
    text-decoration: underline;
    text-underline-offset: 2px;
}


/* =========================================================
   SUBMIT
========================================================= */

.home-lead-form__submit {
    position: relative;
    margin-top: 16px;
}

.home-lead-form__submit input[type="submit"] {
    display: flex;
    width: 100%;
    min-height: 49px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 12px 24px;
    appearance: none;
    border: 1px solid rgba(44, 44, 44, 0.09);
    border-radius: 13px;
    color: rgba(44, 44, 44, 0.75);
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.2;
    letter-spacing: -4%;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease;
}

.home-lead-form__submit input[type="submit"]:hover {
    color: rgba(146, 70, 45, 1);
    background: rgba(247, 208, 108, 1);
    border-color: rgba(247, 208, 108, 1);
}


/* =========================================================
   CF7 VALIDATION
========================================================= */

.home-lead-form .wpcf7-not-valid-tip {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 3;
    margin-top: 2px;
    color: var(--color-accent, #92462d);
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
}

.home-lead-form .wpcf7-spinner {
    position: absolute;
    top: 50%;
    right: 18px;
    margin: -12px 0 0;
}

.home-lead-modal .wpcf7-response-output {
    position: fixed;
    right: 24px;
    bottom: 24px;
    left: 24px;
    z-index: 100000;
    max-width: 700px;
    margin: 0 auto !important;
    padding: 10px 14px !important;
    border: 1px solid rgba(44, 44, 44, 0.14) !important;
    border-radius: 8px;
    color: var(--color-text, #2c2c2c);
    background: #f8f7f4;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.home-lead-modal .wpcf7-response-output:empty {
    display: none;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 991px) {
    .home-lead-modal {
        padding: 20px;
    }

    .home-lead-modal__dialog {
        width: calc(100vw - 40px);
        max-height: calc(100dvh - 40px);
    }

    .home-lead-modal__header,
    .home-lead-modal__body {
        padding-right: 28px;
        padding-left: 28px;
    }

    .home-lead-form__fields {
        gap: 30px;
    }

    .home-lead-form__field {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .home-lead-form__label {
        font-size: 17px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {
    .home-lead-modal {
        display: grid;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        place-items: center;
        padding: 16px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .home-lead-modal__backdrop {
        display: block;
        background: rgba(44, 44, 44, 0.38);
    }

    .home-lead-modal__dialog {
        width: 100%;
        max-width: 361px;
        height: auto;
        max-height: calc(100dvh - 32px);
        overflow: hidden;
        border-radius: 4px;
        background: rgba(246, 245, 241, 1);
        box-shadow: 0 18px 60px rgba(44, 44, 44, 0.16);
    }

    .home-lead-modal__header {
        display: flex;
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 24px 16px 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.09);
    }

    .home-lead-modal__close {
        align-self: flex-end;
        order: -1;
        gap: 13px;
        margin-bottom: 13px;
        color: var(--color-text, #2c2c2c);
        font-family: var(--font-main, Manrope, sans-serif);
        font-size: 12px;
        line-height: 1.3;
        font-weight: 500;
        letter-spacing: -0.01em;
    }

    .home-lead-modal__close-icon {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border-radius: 50%;
        font-size: 17px;
        line-height: 1;
    }

    .home-lead-modal__title {
        max-width: 310px;
        margin: 0;
        color: var(--color-text, #2c2c2c);
        font-family: var(--font-main, Manrope, sans-serif);
        font-size: 16px;
        line-height: 1.21;
        font-weight: 600;
        letter-spacing: -0.01em;
    }

    .home-lead-modal__title-desktop {
        display: none;
    }

    .home-lead-modal__title-mobile {
        display: block;
    }

    .home-lead-modal__body {
        max-height: calc(100dvh - 32px - 118px);
        padding: 24px 16px 24px;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .home-lead-modal__body::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .home-lead-form__fields {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .home-lead-form__field {
        display: block;
    }

    .home-lead-form__label {
        display: block;
        margin-bottom: 24px !important;
        color: var(--color-text, #2c2c2c);
        font-family: var(--font-main, Manrope, sans-serif);
        font-size: 20px;
        line-height: 1.21;
        font-weight: 500;
        letter-spacing: -0.01em;
        text-transform: uppercase;
    }

    .home-lead-form input[type="text"],
    .home-lead-form input[type="tel"],
    .home-lead-form textarea {
        color: var(--color-text, #2c2c2c);
        font-family: var(--font-main, Manrope, sans-serif);
        font-size: 16px;
        line-height: 1.4;
        font-weight: 400;
        letter-spacing: -0.008em;
    }

    .home-lead-form input[type="text"],
    .home-lead-form input[type="tel"] {
        padding-top: 3px;
        padding-bottom: 6px;
    }

    .home-lead-form input::placeholder,
    .home-lead-form textarea::placeholder {
        color: rgba(44, 44, 44, 0.28);
        opacity: 1;
    }

    .home-lead-form__comma {
        right: 2px;
        bottom: 7px;
        font-size: 16px;
    }

    .home-lead-form__interest {
        display: block;
        margin-top: 24px;
    }

    .home-lead-form__interest > .home-lead-form__label {
        margin-bottom: 13px;
    }

    .home-lead-form__radio .wpcf7-form-control {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 18px;
    }

    .home-lead-form__radio .wpcf7-list-item label {
        gap: 8px;
    }

    .home-lead-form__radio input[type="radio"] {
        width: 23px;
        height: 23px;
        flex: 0 0 23px;
    }

    .home-lead-form__radio input[type="radio"]::after {
        width: 11px;
        height: 11px;
    }

    .home-lead-form__radio .wpcf7-list-item-label {
        color: rgba(44, 44, 44, 0.85);
        font-family: var(--font-main, Manrope, sans-serif);
        font-size: 14px;
        line-height: 1.4;
        font-weight: 400;
        letter-spacing: -0.008em;
    }

    .home-lead-form__comment {
        margin-top: 29px;
    }

    .home-lead-form textarea {
        height: 35px;
        min-height: 35px;
        max-height: 35px;
        padding-top: 4px;
        padding-bottom: 7px;
        resize: none;
    }

    .home-lead-form__acceptance {
        margin-top: 24px;
    }

    .home-lead-form__acceptance .wpcf7-list-item label {
        align-items: center;
        gap: 12px;
    }

    .home-lead-form__acceptance input[type="checkbox"] {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
    }

    .home-lead-form__acceptance .wpcf7-list-item-label {
        color: rgba(44, 44, 44, 0.86);
        font-family: var(--font-main, Manrope, sans-serif);
        font-size: 13px;
        line-height: 1.35;
        font-weight: 400;
        letter-spacing: -0.008em;
    }

    .home-lead-form__submit {
        margin-top: 16px;
    }

    .home-lead-form__submit input[type="submit"] {
        min-height: 49px;
        border-radius: 10px;
        font-family: var(--font-main, Manrope, sans-serif);
        font-size: 14px;
        line-height: 1.4;
        font-weight: 500;
        letter-spacing: -0.008em;
    }

    .home-lead-modal .wpcf7-response-output {
        right: 16px;
        bottom: 16px;
        left: 16px;
        font-size: 12px;
    }
}


/* =========================================================
   SHORT MOBILE
========================================================= */

@media (max-width: 767px) and (max-height: 740px) {
	.home-lead-modal {
    	align-items: center;
    	justify-items: center;
    	padding-top: 16px;
    	padding-bottom: 16px;
	}

    .home-lead-modal__dialog {
        max-height: calc(100dvh - 32px);
    }

    .home-lead-modal__header {
        padding-top: 14px;
        padding-bottom: 10px;
    }

    .home-lead-modal__close {
        margin-bottom: 8px;
    }

    .home-lead-modal__body {
        max-height: calc(100dvh - 32px - 96px);
        padding-top: 13px;
        padding-bottom: 13px;
    }

    .home-lead-form__fields {
        gap: 12px;
    }

    .home-lead-form__label {
        margin-bottom: 4px;
    }

    .home-lead-form input[type="text"],
    .home-lead-form input[type="tel"] {
        height: 27px;
    }

    .home-lead-form__interest {
        margin-top: 16px;
    }

    .home-lead-form__interest > .home-lead-form__label {
        margin-bottom: 8px;
    }

    .home-lead-form__comment {
        margin-top: 18px;
    }

    .home-lead-form__acceptance {
        margin-top: 13px;
    }

    .home-lead-form__submit {
        margin-top: 10px;
    }

    .home-lead-form__submit input[type="submit"] {
        min-height: 43px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 380px) {
    .home-lead-modal {
        padding-right: 12px;
        padding-left: 12px;
    }

    .home-lead-modal__dialog {
        max-width: 100%;
    }

    .home-lead-form__radio .wpcf7-form-control {
        gap: 10px;
    }

    .home-lead-form__radio .wpcf7-list-item-label {
        font-size: 13px;
    }

    .home-lead-form__acceptance .wpcf7-list-item-label {
        font-size: 12px;
    }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {
    .home-lead-modal,
    .home-lead-modal__dialog,
    .home-lead-modal__close-icon,
    .home-lead-form input,
    .home-lead-form textarea {
        transition: none;
    }
}