.home-contact {
    padding: 0 30px 78px;
    background: #f7f3ef;
    color: #203027;
}

.home-contact__panel {
    box-sizing: border-box;
    width: min(1159px, 100%);
    min-height: 595px;
    margin: 0 auto;
    padding: 40px 30px;
    border-radius: 30px;
    background-image: url('../images/home/contact-form-background.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow: hidden;
}

.home-contact__content {
    width: min(420px, 100%);
}

.home-contact__title {
    margin: 0 0 22px;
    color: #203027;
    font-size: 44px;
    font-weight: 400;
    letter-spacing: -.025em;
    line-height: 1.12;
}

.home-contact__description {
    margin: 0 0 16px;
    color: #6a786b;
    font-size: 16px;
    line-height: 1.35;
}

.home-contact__form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.home-contact__field {
    display: block;
    margin: 0;
}

.home-contact__label {
    display: block;
    margin: 0 0 5px;
    color: #778478;
    font-size: 15px;
    line-height: 1.2;
}

.home-contact__input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 58px;
    padding: 0 18px;
    border: 1px solid #e4e0d9;
    border-radius: 11px;
    outline: none;
    background: rgba(255, 253, 250, .94);
    color: #203027;
    font: inherit;
    font-size: 20px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.home-contact__input::placeholder {
    color: #949b95;
    opacity: 1;
}

.home-contact__input:focus {
    border-color: #8ea17d;
    box-shadow: 0 0 0 3px rgba(142, 161, 125, .18);
}

.home-contact__errors {
    color: #a93d3d;
    font-size: 13px;
    line-height: 1.35;
}

.home-contact__errors ul {
    margin: 0;
    padding-left: 18px;
}

.home-contact__footer {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 16px;
    margin-top: 12px;
    align-items: center;
}

.home-contact__submit {
    display: flex;
    width: 100%;
    min-height: 60px;
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #798f61;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    transition: background-color .2s ease, transform .2s ease;
}

.home-contact__submit:hover {
    background: #687e53;
}

.home-contact__submit:active {
    transform: translateY(1px);
}

.home-contact__submit-mobile {
    display: none !important;
}

.home-contact__submit-desktop {
    display: inline !important;
}

.home-contact__agreement {
    margin: 0;
    color: #758177;
    font-size: 14px;
    line-height: 1.4;
}

.home-contact__agreement a {
    color: inherit;
    text-decoration: none;
}

.home-contact__agreement a:hover,
.home-contact__agreement a:focus-visible {
    text-decoration: underline;
}

body.home-contact-success-open {
    overflow: hidden;
}

.home-contact-success {
    position: fixed;
    z-index: 2147483647;
    inset: 0;
    display: flex;
    padding: 24px;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
}

.home-contact-success.is-open {
    visibility: visible;
    opacity: 1;
}

.home-contact-success__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(24, 35, 29, .42);
    cursor: pointer;
}

.home-contact-success__dialog {
    position: relative;
    box-sizing: border-box;
    width: min(640px, 100%);
    min-height: 380px;
    padding: 35px 80px 48px;
    border-radius: 38px;
    outline: none;
    background: #eef5e9;
    color: #29402f;
    text-align: center;
    box-shadow: 0 24px 80px rgba(31, 48, 38, .18);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
}

.home-contact-success__close {
    position: absolute;
    top: 30px;
    right: 32px;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .28);
    cursor: pointer;
}

.home-contact-success__close::before,
.home-contact-success__close::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #516156;
    content: '';
}

.home-contact-success__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.home-contact-success__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.home-contact-success__check {
    display: flex;
    width: 72px;
    height: 72px;
    margin: 0 auto 15px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: #85a47f;
    color: #fff;
}

.home-contact-success__check svg {
    width: 64px;
    height: 64px;
}

.home-contact-success__title {
    margin: 0;
    color: #29402f;
    font-size: 32px;
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.3;
}

.home-contact-success__description {
    margin: 13px 0 32px;
    color: #6a786b;
    font-size: 16px;
    line-height: 1.35;
}

.home-contact-success__button {
    display: flex;
    width: min(280px, 100%);
    min-height: 48px;
    margin: 0 auto;
    padding: 14px 28px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: #6f8b69;
    color: #fff;
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color .2s ease, transform .2s ease;
}

.home-contact-success__button:hover,
.home-contact-success__button:focus-visible {
    background: #5f7b5a;
}

.home-contact-success__button:active {
    transform: translateY(1px);
}

@media (max-width: 640px) {
    .home-contact {
        padding: 0;
        background: #fffdfa;
    }

    .home-contact__panel {
        width: 100%;
        min-height: 400px;
        padding: 36px 20px 45px;
        border-radius: 0;
        background-position: 51% center;
    }

    .home-contact__content {
        width: 100%;
    }

    .home-contact__title {
        margin-bottom: 14px;
        font-size: 26px;
        letter-spacing: -.035em;
        line-height: 1.05;
    }

    .home-contact__description {
        margin-bottom: 14px;
        font-size: 12px;
        line-height: 1.38;
    }

    .home-contact__form {
        gap: 15px;
    }

    .home-contact__label,
    .home-contact__field--question {
        display: none;
    }

    .home-contact__input {
        height: 46px;
        padding: 0 14px;
        border: 0;
        border-radius: 11px;
        background: #fff;
        font-size: 12px;
    }

    .home-contact__footer {
        display: flex;
        margin-top: 0;
        flex-direction: column;
        gap: 24px;
        align-items: stretch;
    }

    .home-contact__submit {
        min-height: 45px;
        font-size: 14px;
    }

    .home-contact__submit-desktop {
        display: none !important;
    }

    .home-contact__submit-mobile {
        display: inline !important;
    }

    .home-contact__agreement {
        font-size: 12px;
        line-height: 1.35;
        text-align: left;
    }

    .home-contact-success {
        padding: 16px;
    }

    .home-contact-success__dialog {
        width: 100%;
        min-height: 0;
        max-height: calc(100dvh - 32px);
        padding: 52px 22px 34px;
        border-radius: 26px;
    }

    .home-contact-success__close {
        top: 14px;
        right: 14px;
        width: 42px;
        height: 42px;
    }

    .home-contact-success__check {
        width: 84px;
        height: 84px;
        margin-bottom: 24px;
    }

    .home-contact-success__check svg {
        width: 48px;
        height: 48px;
    }

    .home-contact-success__title {
        font-size: clamp(30px, 9vw, 40px);
        line-height: 1.2;
    }

    .home-contact-success__description {
        margin: 20px auto 34px;
        font-size: 17px;
    }

    .home-contact-success__button {
        min-height: 56px;
        padding: 12px 20px;
        font-size: 17px;
    }
}

@media (max-width: 380px) {
    .home-contact__panel {
        padding-right: 20px;
        padding-left: 20px;
    }

    .home-contact__title {
        font-size: 34px;
    }

    .home-contact__description {
        font-size: 17px;
    }
}
