/* static/css/term.css */

.page-title-with-terms {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.terms-inline {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.section-box-cta > .terms-inline {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
}

.terms-toggle-button {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.2;
    color: #7a7a7a;
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}

.terms-toggle-button:hover {
    color: #4b5563;
}

.terms-toggle-button:focus {
    outline: none;
    box-shadow: 0 0 0 0.1875rem rgba(47, 106, 230, 0.18);
    border-radius: 0.25rem;
}

.terms-toggle-icon {
    display: inline-block;
    font-size: 0.7rem;
    line-height: 1;
    color: #6b7280;
    transition: transform 0.15s ease;
}

.terms-toggle-button:not(.is-collapsed) .terms-toggle-icon {
    transform: rotate(180deg);
}

.terms-popup {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    z-index: 30;
    width: min(42rem, calc(100vw - 2rem));
}

.terms-popup.is-collapsed {
    display: none;
}

.terms-scroll-window {
    max-height: 10rem;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.875rem;
    border: 0.0625rem solid #d6deeb;
    border-radius: 0.875rem;
    background: #ffffff;
    box-shadow: 0 0.125rem 0.5rem rgba(15, 23, 42, 0.12);
}

.terms-body {
    font-size: 0.8rem;
    line-height: 1.7;
    color: #4b5563;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 48rem) {
    .page-title-with-terms {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .terms-inline {
        display: block;
        width: 100%;
    }

    .terms-popup {
        position: static;
        width: 100%;
        max-width: 100%;
        margin-top: 0.35rem;
    }

    .terms-scroll-window {
        width: 100%;
        max-height: 8.5rem;
    }
}