:root {
    --color-case-primary: #9748FF;
    --color-case-bg-rgba: rgba(151, 72, 255, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.custom-case-single h2,
.custom-case-single p {
    margin: 0;
    padding: 0;
}

.custom-case-single h1,
.custom-case-single h2,
.custom-case-single h3,
.custom-case-single h4,
.custom-case-single h5,
.custom-case-single h6 {
    margin-top: 20px;
    margin-bottom: 20px;
}

.custom-case-single {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: 30px;
    align-items: flex-start;
    margin: 30px 0;
}

.case-single__image {
    flex: 0 0 400px;
    max-width: 100%;
}

.case-single__image figure {
    margin: 0;
    float: right;
    shape-outside: margin-box;
    shape-margin: 20px;
}

.case-single__image img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.case-single__content {
    flex: 1;
    min-width: 300px;
}

.case-single__content a {
    color: var(--color-case-primary);
}

.case-single__content h1 {
    color: var(--color-case-primary);
    margin-top: 0;
    position: relative;
    padding-bottom: 15px;
}

.case-single__content h1:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 80px;
    height: 4px;
    background: var(--color-case-primary);
}

.case-single__content-text {
    line-height: 1.6;
    text-align: justify;
}

.case-single__content-text p {
    margin-bottom: 1em;
}

.case-single_query {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.case-single_query-item.active .case-single_query-item-text {
    max-height: 400px;
    padding: 20px;
    opacity: 1;
    z-index: 0;
}

.case-single_query-item-title {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 20px;
    width: 100%;
    height: 60px;
    vertical-align: center;
    box-shadow: var(--shadow-md);
    margin-bottom: 15px;
}

.case-single_query .custom-arrow {
    cursor: pointer;
    display: flex;
    position: relative;
    align-items: center;
    width: 30px;
    height: 30px;
    padding-right: 20px;
}

.case-single_query .custom-arrow:before,
.case-single_query .custom-arrow:after {
    position: relative;
    content: '';
    width: 3px;
    display: block;
    height: 70%;
    background: var(--color-case-primary);
}

.case-single_query .custom-arrow:before {
    transform: rotate(-35deg);
    left: -4px;
}

.case-single_query .custom-arrow:after {
    transform: rotate(35deg);
    right: -4px;
}

.case-single_query-item-title h2 {
    font-size: 18px;
    font-weight: 600;
    padding-right: 20px;
}

.case-single_query-item-text {
    position: relative;
    max-height: 0;
    opacity: 0;
    padding: 0;
    z-index: -3;
    border-left: 3px solid var(--color-case-primary);
    background: var(--color-case-bg-rgba);
    transition: 0.5s all ease;
}

.case-single__wrap {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.case-single_query {
    flex: auto;
    width: 100%;
}

.custom-form-wrap {
    flex: auto;
    max-width: 300px;
    width: 100%;
}

@media (max-width: 768px) {
    .custom-case-single {
        gap: 18px;
        margin: 20px 0;
    }

    .case-single__content {
        min-width: 0;
    }

    .case-single__content h1 {
        font-size: 24px;
        line-height: 1.25;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    .case-single__content h1:after {
        width: 60px;
        height: 3px;
    }

    .case-single__content-text {
        text-align: left;
        line-height: 1.7;
        font-size: 16px;
    }

    .case-single__content-text p {
        margin-bottom: 14px;
    }

    .case-single__image {
        flex: 0 0 100%;
        max-width: 100%;
        order: 1;
    }

    .case-single__image figure {
        float: none;
        text-align: center;
        shape-outside: none;
        shape-margin: 0;
    }

    .case-single__content {
        order: 2;
    }

    .case-single__wrap {
        order: 3;
        flex-wrap: wrap;
        gap: 16px;
    }

    .case-single_query,
    .custom-form-wrap {
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
    }

    .case-single_query {
        gap: 8px;
    }

    .case-single_query-item-title {
        min-height: 56px;
        height: auto;
        padding: 14px 14px 14px 16px;
        align-items: center;
        gap: 12px;
    }

    .case-single_query-item-title h2 {
        font-size: 16px;
        line-height: 1.35;
        padding-right: 0;
    }

    .case-single_query .custom-arrow {
        flex: 0 0 24px;
        width: 24px;
        padding-right: 0;
    }

    .case-single_query .custom-arrow:before,
    .case-single_query .custom-arrow:after {
        width: 2px;
        height: 60%;
    }

    .case-single_query-item-text {
        font-size: 15px;
        line-height: 1.6;
        border-left-width: 2px;
    }

    .case-single_query-item.active .case-single_query-item-text {
        max-height: 999px;
        padding: 14px;
    }

    .custom-form-wrap {
        padding: 18px 16px;
    }

    .custom-form-title {
        font-size: 20px;
        line-height: 1.25;
        text-align: center;
        margin-bottom: 12px;
    }

    .custom-form-subtitle {
        font-size: 15px;
        line-height: 1.55;
        text-align: center;
        margin-bottom: 16px;
    }

    .custom-form {
        width: 100%;
    }

    .custom-form-group {
        margin-bottom: 14px;
    }

    .form-input {
        font-size: 16px;
    }

    .form-label {
        font-size: 14px;
    }

    .form-btn-submit {
        width: 100%;
        min-height: 48px;
    }
}