.form-popup {
    position: relative;
    box-sizing: border-box;
    width: 98%;
    max-height: calc(100vh - 40px);
    margin: 20px;
    padding: 40px;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
}

.form-title-block {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.form-popup__close,
.form-popup .popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #5a616c;
    background: transparent;
    border: none;
    cursor: pointer;
}

.form-popup .h3 {
    margin: 0 0 12px;
    font-family: "Noto Serif Display", serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 34px;
    color: rgba(60, 36, 21, 1);
}

#closeForm {
    height: 24px;
    width: 24px;
    cursor: pointer;
}

.form-popup .form-description,
.form-popup .text-discount-form {
    margin: 0 0 28px;
    font-family: "Inter Tight", sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 22px;
    color: rgba(90, 97, 108, 1);
}

.form-popup .form-group {
    margin-bottom: 16px;
}

.form-popup .form-control {
    box-sizing: border-box;
    width: 100%;
    padding: 14px 16px;
    font-family: "Inter Tight", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    color: rgba(60, 36, 21, 1);
    background: #fff;
    border: 1px solid rgba(90, 97, 108, 0.3);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-popup .form-control::placeholder {
    color: rgba(90, 97, 108, 0.7);
}

.form-popup .form-control:focus {
    border-color: rgba(60, 36, 21, 1);
}

.form-popup textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.form-popup .form-group.has-error .form-control {
    border-color: #d64545;
}

.form-popup .errortext,
.form-popup .error {
    display: block;
    margin-top: 6px;
    font-family: "Inter Tight", sans-serif;
    font-size: 13px;
    line-height: 18px;
    color: #d64545;
}

.form-popup .form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: "Inter Tight", sans-serif;
    font-size: 12px;
    line-height: 18px;
    color: rgba(90, 97, 108, 1);
}

.form-popup .form-checkbox input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: rgba(60, 36, 21, 1);
    cursor: pointer;
}

.form-popup .form-checkbox a {
    color: rgba(60, 36, 21, 1);
    text-decoration: underline;
}

.form-popup .text-required {
    margin: 12px 0 20px;
    font-family: "Inter Tight", sans-serif;
    font-size: 12px;
    line-height: 18px;
    color: rgba(90, 97, 108, 0.7);
}

.form-popup .btn.form-btn {
    width: 100%;
    padding: 16px;
    font-family: "Inter Tight", sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 24px;
    color: #fff;
    background: rgba(60, 36, 21, 1);
    border: none;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.form-popup .btn.form-btn:hover {
    background: rgba(80, 50, 30, 1);
}

.form-popup .btn.form-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-popup .inputtext {
    box-sizing: border-box;
    width: 100%;
    margin-top: 10px;
    padding: 12px 16px;
    border: 1px solid rgba(90, 97, 108, 0.3);
    border-radius: 8px;
}

/* ===== Экран успешной отправки ===== */
.form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 40px;
}

.form-success__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 32px;
    color: rgba(60, 36, 21, 1);
    background: rgba(245, 237, 224, 1);
    border-radius: 16px;
}

.form-success__icon svg {
    width: 32px;
    height: 32px;
}

.form-success__title {
    margin: 0 0 16px;
    font-family: "Noto Serif Display", serif;
    font-weight: 500;
    font-size: 28px;
    line-height: 34px;
    color: rgba(60, 36, 21, 1);
}

.form-success__text {
    margin: 0 0 32px;
    font-family: "Inter Tight", sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: rgba(90, 97, 108, 1);
}

.form-success .btn.form-btn {
    width: 100%;
}

.form-descr {
    font-family: "Inter Tight", serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 24px;
    color: rgba(90, 97, 108, 1);
}

.form-popup .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-popup .form-group label {
    font-family: "Inter Tight", serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 20px;
    color: rgba(90, 97, 108, 1);
}

@media (max-width: 480px) {
    .form-popup {
        padding: 32px 20px;
    }

    .form-popup .h3 {
        font-size: 24px;
        line-height: 30px;
    }

    .form-success {
        padding: 40px 20px;
    }
}

@media (max-width: 991px) {
    #formOverlay.active {
        align-items: stretch;
        justify-content: stretch;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #formContainer {
        width: 100%;
    }

    .form-popup {
        width: 100%;
        min-height: 100vh;
        max-height: none;
        margin: 0;
        padding: 24px 20px 32px;
        overflow-y: visible;
        border-radius: 0;
    }

    .form-success {
        min-height: 100vh;
        justify-content: center;
        padding: 24px 20px;
    }

    .form-popup {
        padding: 40px;
    }

    .form-popup .h3 {
        margin: 0 0 30px;
    }

    .form-popup .form-group {
        margin-bottom: 30px;
    }
}

@media (max-width: 576px) {
    .form-popup {
        padding: 20px;
    }

    .form-popup .h3 {
        font-size: 24px;
        font-weight: 500;
        line-height: 32px;
        letter-spacing: 0%;
        margin: 0 0 16px;
    }

    .form-popup .form-group {
        margin-bottom: 30px;
    }

    .form-descr {
        margin: 0 0 20px;
        font-size: 14px;
        line-height: 20px;
    }

    .form-group-block {
        padding: 20px 0 8px;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .form-popup .form-group {
        margin-bottom: 0;
    }

    .form-popup .form-group label {
        font-size: 12px;
        line-height: 16px;
    }

    .form-popup .btn.form-btn {
        padding: 12px;
    }

    .form-popup .form-checkbox {
        margin: 40px 16px;
    }
}