/* Base Styles */
.half-content-half-sticky-form {
    position: relative;
    width: 100%;
}

/* Top Row Wrapper - Full width background */
.half-content-half-sticky-form__top-row-wrapper {
    position: relative;
    width: 100%;
}

/* Bottom Row Wrapper - Full width background */
.half-content-half-sticky-form__bottom-row-wrapper {
    position: relative;
    width: 100%;
}

/* Content areas */
.half-content-half-sticky-form__top-row-content,
.half-content-half-sticky-form__bottom-row-content {
    color: var(--body-color);
}

/* Background color variants for content text */
.bg-medium .half-content-half-sticky-form__top-row-content,
.bg-dark .half-content-half-sticky-form__top-row-content,
.bg-medium .half-content-half-sticky-form__bottom-row-content,
.bg-dark .half-content-half-sticky-form__bottom-row-content {
    color: var(--white);
}

/* Sticky Form Wrapper - Mobile first (stacked below content) */
.half-content-half-sticky-form__sticky-form-wrapper {
    padding: 0 15px;
    margin: 32px auto;
    max-width: 100%;
}

.half-content-half-sticky-form__sticky-form-content {
    padding: var(--padding-medium);
    background-color: var(--white);
    box-shadow: var(--drop-shadow);
    border-radius: var(--border-radius);
    min-height: var(--form-initial-height, auto);
    transition: height 0.3s ease, min-height 0.3s ease;
}

.half-content-half-sticky-form__form-heading {
    margin: 0 0 24px;
    color: var(--headline);
    font-size: 24px;
    font-weight: 700;
}

.half-content-half-sticky-form__sticky-form-content .form-col-btn {
    text-align: left;
}

/* Form area background color adjustment for different section backgrounds */
.half-content-half-sticky-form__sticky-form-content label {
    color: var(--headline);
}

.half-content-half-sticky-form__sticky-form-content label sup {
    color: var(--primary-color);
}

.half-content-half-sticky-form__sticky-form-content .form-col-btn p {
    color: var(--body-color);
}

.half-content-half-sticky-form__sticky-form-content .form-col-btn p a {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

/* Desktop - Side by side layout with sticky form */
@media (min-width: 1025px) {
    .half-content-half-sticky-form {
        position: relative;
    }

    /* Sticky Form Wrapper - Positioned on the right side */
    /* Uses section-margins padding to align with content rows */
    .half-content-half-sticky-form__sticky-form-wrapper {
        position: absolute;
        top: 0;
        right: 0;
        width: calc(50% - 30px);
        max-width: 500px;
        padding: var(--section-margins) 0;
        margin: 0;
        height: 100%;
        z-index: 100;
        box-sizing: border-box;
    }

    .half-content-half-sticky-form__sticky-form-content {
        position: sticky;
        /* Account for sticky nav height (--header-height set by global.js) + section margins + buffer */
        top: calc(var(--header-height, 0px) + 35px);
        padding: var(--padding-medium);
        /* Ensure form doesn't exceed viewport minus nav and margins */
        /* max-height: calc(100vh - var(--header-height, 0px) - var(--section-margins) - 40px); */
        overflow-y: auto;
    }

    .half-content-half-sticky-form__sticky-form-content .form-col-btn p a:hover {
        color: var(--primary-hover);
        border-color: var(--primary-hover);
    }

    /* Adjust content columns to account for right-side form */
    .half-content-half-sticky-form__top-row-content,
    .half-content-half-sticky-form__bottom-row-content {
        padding-right: 30px;
    }
}

/* Large desktop adjustments */
@media (min-width: 1200px) {
    .half-content-half-sticky-form__sticky-form-wrapper {
        width: calc(50% - 50px);
        max-width: 550px;
        right: calc((100vw - var(--container-width, 1200px)) / 2 + 15px);
        padding: var(--section-margins) 0;
    }

    .half-content-half-sticky-form__top-row-content,
    .half-content-half-sticky-form__bottom-row-content {
        padding-right: 50px;
    }
}
