/*======================================
    TERMS OF SERVICE
======================================*/

.terms-section {
    position: relative;
    padding: 100px 0;
    background: #f5f8fc;
}

.terms-card {
    background: #fff;
    border-radius: 24px;
    padding: 60px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    border: 1px solid #edf2f7;
}

/*======================================
    LAYOUT (TOC + CARD)
======================================*/

.terms-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/*======================================
    TABLE OF CONTENTS
======================================*/

.terms-toc {
    position: sticky;
    top: 100px;
    background: #fff;
    border: 1px solid #edf2f7;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.terms-toc-toggle {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: none;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}

.toc-toggle-icon {
    transition: transform .25s ease;
}

.terms-toc-toggle[aria-expanded="true"] .toc-toggle-icon {
    transform: rotate(180deg);
}

.terms-toc-list ul {
    list-style: none;
    margin: 0;
    padding: 6px;
}

.terms-toc-list li {
    margin: 0;
}

.terms-toc-list a {
    display: block;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14.5px;
    color: #475569;
    text-decoration: none;
    line-height: 1.4;
    border-left: 3px solid transparent;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.terms-toc-list a:hover {
    background: #f5f8fc;
    color: #2563eb;
}

.terms-toc-list a.is-active {
    background: #eef6ff;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 600;
}

/*======================================
    READING PROGRESS BAR
======================================*/

.terms-progress {
    position: sticky;
    top: 0;
    z-index: 40;
    height: 4px;
    background: rgba(37, 99, 235, 0.08);
}

.terms-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #ec4899);
    transition: width .1s linear;
}

/*======================================
    BACK TO TOP
======================================*/

.terms-back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #0f172a;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
    z-index: 50;
}

.terms-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.terms-back-to-top:hover {
    background: #2563eb;
}

/*======================================
    PRINT BUTTON ROW
======================================*/

.terms-print-row {
    margin-top: 40px;
    text-align: right;
}

.btn-outline-sm {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 10px;
    border: 1.5px solid #2563eb;
    background: transparent;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: .2s;
}

.btn-outline-sm:hover {
    background: #2563eb;
    color: #fff;
}

/*======================================
    HEADER
======================================*/

.terms-header {
    border-bottom: 1px solid #edf2f7;
    margin-bottom: 50px;
    padding-bottom: 35px;
}

.terms-header h2 {
    font-size: 42px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 15px;
}

.terms-header>p:first-of-type {
    display: inline-block;
    background: #eef6ff;
    color: #2563eb;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    margin-bottom: 25px;
}

.terms-header p {
    font-size: 17px;
    line-height: 1.9;
    color: #64748b;
}

/*======================================
    SECTIONS
======================================*/

.terms-block {
    margin-bottom: 55px;
    scroll-margin-top: 100px; /* keeps anchored section clear of sticky elements */
}

.terms-block:last-child {
    margin-bottom: 0;
}

.terms-block h3 {
    position: relative;
    font-size: 30px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 22px;
    padding-left: 20px;
}

.terms-block h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 5px;
    height: calc(100% - 12px);
    background: linear-gradient(180deg, #2563eb, #ec4899);
    border-radius: 50px;
}

.terms-block p {
    font-size: 17px;
    line-height: 1.9;
    color: #64748b;
    margin-bottom: 16px;
}

/*======================================
    LISTS
======================================*/

.terms-block ul {
    list-style: none;
    margin: 25px 0;
    padding: 0;
}

.terms-block li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 16px;
    color: #475569;
    line-height: 1.8;
}

.terms-block li:last-child {
    margin-bottom: 0;
}

.terms-block li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/*======================================
    CONTACT BOX
======================================*/

.contact-box {
    margin-top: 25px;
    padding: 30px;
    background: linear-gradient(135deg, #f8fbff, #eef5ff);
    border-radius: 16px;
    border: 1px solid #dbeafe;
}

.contact-box h4 {
    font-size: 26px;
    margin-bottom: 15px;
    color: #0f172a;
}

.contact-box p {
    margin-bottom: 10px;
    color: #475569;
}

.contact-box strong {
    color: #0f172a;
}

/*======================================
    DISCLAIMER
======================================*/

.terms-note {
    margin-top: 60px;
    padding: 30px;
    border-left: 5px solid #f59e0b;
    background: #fff8e6;
    border-radius: 12px;
    color: #6b7280;
    line-height: 1.8;
    font-size: 15px;
}

.terms-note strong {
    color: #92400e;
}

/*======================================
    LINKS
======================================*/

.terms-card a {
    color: #2563eb;
    text-decoration: none;
    transition: .3s;
}

.terms-card a:hover {
    color: #ec4899;
}

/*======================================
    TABLE (Future Support)
======================================*/

.terms-card table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}

.terms-card table th,
.terms-card table td {
    border: 1px solid #e2e8f0;
    padding: 15px;
    text-align: left;
}

.terms-card table th {
    background: #f8fafc;
    color: #0f172a;
}

.terms-card table td {
    color: #64748b;
}

/*======================================
    PRINT STYLES
======================================*/

@media print {

    .no-print,
    .terms-toc,
    .terms-progress,
    .terms-back-to-top,
    .about-hero {
        display: none !important;
    }

    .terms-section {
        padding: 0;
        background: #fff;
    }

    .terms-wrapper {
        display: block;
    }

    .terms-card {
        box-shadow: none;
        border: none;
        padding: 0;
    }

    .terms-block {
        margin-bottom: 28px;
        page-break-inside: avoid;
    }
}

/*======================================
    RESPONSIVE
======================================*/

@media (max-width:991px) {

    .terms-section {
        padding: 70px 0;
    }

    .terms-card {
        padding: 40px;
    }

    .terms-header h2 {
        font-size: 34px;
    }

    .terms-block h3 {
        font-size: 26px;
    }

    .terms-wrapper {
        grid-template-columns: 1fr;
    }

    .terms-toc {
        position: static;
        max-height: none;
    }

    .terms-toc-toggle {
        display: flex;
    }

    .terms-toc-list {
        display: none;
    }

    .terms-toc-list.is-open {
        display: block;
    }

}

@media (max-width:767px) {

    .terms-card {
        padding: 25px;
        border-radius: 16px;
    }

    .terms-header {
        padding-bottom: 25px;
        margin-bottom: 35px;
    }

    .terms-header h2 {
        font-size: 30px;
    }

    .terms-block {
        margin-bottom: 40px;
    }

    .terms-block h3 {
        font-size: 22px;
        padding-left: 15px;
    }

    .terms-block p,
    .terms-block li {
        font-size: 15px;
    }

    .contact-box {
        padding: 20px;
    }

    .contact-box h4 {
        font-size: 22px;
    }

    .terms-note {
        padding: 20px;
        font-size: 14px;
    }

    .terms-back-to-top {
        right: 16px;
        bottom: 16px;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

}

@media (max-width:575px) {

    .terms-section {
        padding: 50px 0;
    }

    .terms-card {
        padding: 20px;
    }

    .terms-header h2 {
        font-size: 26px;
    }

    .terms-block h3 {
        font-size: 20px;
    }

    .terms-print-row {
        text-align: center;
    }

}