/* Legal documents (Terms, Privacy Policy).
   Shared by every template under templates/legal/.
   Uses the global theme variables from theme.css so it follows light/dark. */

/* `.container` is stripped of its gutters site-wide in bootcamp.css, so the page
   has to supply its own horizontal padding -- without this the text runs into
   the screen edge on mobile. */
.legal-page {
    max-width: 1120px;
    padding: 40px 24px 80px 24px;
}

/* ---------- Header ---------- */

.legal-head {
    padding-bottom: 24px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border-color);
}

.legal-head h1 {
    font-size: 34px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.legal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.legal-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ---------- Layout ---------- */

.legal-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

/* ---------- Table of contents (auto-generated from h2[id]) ---------- */

.legal-toc {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
    padding-right: 8px;
}

.legal-toc-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0 0 12px 0;
}

.legal-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: legal-toc;
}

.legal-toc li {
    counter-increment: legal-toc;
}

.legal-toc a {
    display: block;
    padding: 6px 0 6px 12px;
    border-left: 2px solid var(--border-color);
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease;
}

.legal-toc a::before {
    content: counter(legal-toc) ". ";
    color: var(--text-muted);
}

.legal-toc a:hover {
    color: var(--text-primary);
    border-left-color: var(--border-strong);
}

.legal-toc a.is-active {
    color: #2871de;
    border-left-color: #2871de;
    font-weight: 600;
}

.legal-toc a.is-active::before {
    color: #2871de;
}

/* ---------- Body ---------- */

.legal-body {
    max-width: 78ch;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.75;
}

.legal-body h2 {
    /* Clears the fixed navbar when jumping to an anchor. */
    scroll-margin-top: 90px;
    font-size: 22px;
    line-height: 1.35;
    font-weight: 700;
    color: var(--text-primary);
    margin: 44px 0 14px 0;
}

.legal-body>h2:first-child {
    margin-top: 0;
}

.legal-body h3 {
    scroll-margin-top: 90px;
    font-size: 17px;
    line-height: 1.45;
    font-weight: 600;
    color: var(--text-primary);
    margin: 26px 0 10px 0;
}

.legal-body h4 {
    scroll-margin-top: 90px;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 22px 0 8px 0;
}

.legal-body p {
    margin: 0 0 14px 0;
}

.legal-body ul,
.legal-body ol {
    margin: 0 0 14px 0;
    padding-left: 22px;
}

.legal-body li {
    margin-bottom: 8px;
}

.legal-body li>ul,
.legal-body li>ol {
    margin-top: 8px;
}

.legal-body a {
    color: #2871de;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-body a:hover {
    color: #1b5bb5;
}

.legal-body strong {
    font-weight: 600;
}

/* Callout for the things a user really should not miss. */
.legal-note {
    margin: 0 0 18px 0;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-left: 3px solid #2871de;
    border-radius: 8px;
    background: var(--bg-secondary);
    font-size: 15px;
    line-height: 1.7;
}

.legal-note p:last-child {
    margin-bottom: 0;
}

/* Key/value table used for limits, deadlines, contact rows. */
.legal-table-wrap {
    overflow-x: auto;
    margin: 0 0 18px 0;
}

.legal-table {
    width: 100%;
    min-width: 460px;
    border-collapse: collapse;
    font-size: 15px;
}

.legal-table th,
.legal-table td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
}

.legal-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

/* Emphasised list item, for statements a user must not miss (e.g. credits
   cannot be converted to cash). */
.legal-highlight {
    font-weight: 500;
}

/* ---------- Related pages / help, at the end of every legal page ---------- */

.legal-related {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
    margin-top: 64px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.legal-related h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.legal-related ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.legal-related li {
    margin-bottom: 8px;
}

.legal-related a {
    color: #2871de;
    text-decoration: none;
    font-size: 15px;
}

.legal-related a:hover {
    text-decoration: underline;
}

.legal-related-help p {
    margin: 0 0 16px 0;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.legal-cta {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    background: #2871de;
    color: #fff !important;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
}

.legal-cta:hover {
    background: #1b5bb5;
}

/* ---------- Pricing page: price note + FAQ ---------- */

/* Sits directly under the pricing table, above the FAQ block. */
.pricing-price-note {
    max-width: 760px;
    margin: 0px auto 0 auto;
    padding: 0 20px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    text-align: center;
}

.pricing-price-note a {
    color: #2871de;
    text-decoration: none;
    white-space: nowrap;
}

.pricing-price-note a:hover {
    text-decoration: underline;
}


/* Plain-language FAQ under the plans. Native <details>, no JS -- the answers
   stay in the DOM so they are indexable. */
.pricing-faq {
    max-width: 760px;
    margin: 56px auto 0 auto;
    /* Đệm dưới để khối FAQ không dính vào footer. */
    padding: 40px 20px 72px 20px;
    border-top: 1px solid var(--border-color);
    text-align: left;
}

.pricing-faq>h2 {
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    text-align: center;
}

.pricing-faq details {
    border-bottom: 1px solid var(--border-color);
}

.pricing-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    cursor: pointer;
    list-style: none;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-primary);
}

.pricing-faq summary::-webkit-details-marker {
    display: none;
}

.pricing-faq summary::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    color: var(--text-muted);
    transition: transform .2s ease;
}

.pricing-faq details[open] summary::after {
    content: "\2212";
}

.pricing-faq summary:hover {
    color: #2871de;
}

.pricing-faq .faq-answer {
    padding: 0 0 18px 0;
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-secondary);
}

.pricing-faq .faq-answer p {
    margin: 0 0 10px 0;
}

.pricing-faq .faq-answer p:last-child {
    margin-bottom: 0;
}

.pricing-faq .faq-answer a {
    color: #2871de;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.pricing-faq-more {
    margin: 36px 0 0 0;
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
    color: var(--text-secondary);
}

.pricing-faq-more a {
    color: #2871de;
    text-decoration: none;
}

.pricing-faq-more a:hover {
    text-decoration: underline;
}

/* ---------- Order confirmation note ---------- */

.order-legal-note {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.order-legal-note p {
    margin: 0 0 6px 0;
}

.order-legal-note p:last-child {
    margin-bottom: 0;
}

.order-legal-note strong {
    color: var(--text-primary);
    font-weight: 600;
}

.order-legal-note a {
    color: #2871de;
    text-decoration: none;
    white-space: nowrap;
}

.order-legal-note a:hover {
    text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
    .legal-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .legal-toc {
        position: static;
        max-height: none;
        overflow: visible;
        margin-bottom: 32px;
        padding: 16px 18px;
        border: 1px solid var(--border-color);
        border-radius: 10px;
        background: var(--bg-secondary);
    }

    .legal-toc a {
        border-left: none;
        padding-left: 0;
    }

    .legal-toc a.is-active {
        font-weight: 400;
        color: var(--text-secondary);
    }
}

@media (max-width: 575px) {
    .legal-page {
        padding: 24px 16px 48px 16px;
    }

    .legal-head h1 {
        font-size: 26px;
    }

    .legal-body {
        font-size: 15px;
    }

    .legal-body h2 {
        font-size: 19px;
    }

    .pricing-price-note {
        padding: 0 16px;
    }

    .pricing-faq {
        margin-top: 40px;
        padding: 32px 16px 48px 16px;
    }

    .pricing-faq>h2 {
        font-size: 21px;
    }

    .pricing-faq-more {
        margin-top: 28px;
    }
}