/* ==========================================================================
   Legal pages — Terms & Conditions, Privacy Policy
   Also styles the same content when rendered inside the checkout modal.
   Body text is deliberately 16px+ with generous line height: a policy nobody
   can comfortably read does not do the job it exists to do.
   ========================================================================== */

:root {
    --legal-ink: #1b2b3a;
    --legal-ink-soft: #4a5c6d;
    --legal-brand: #1f425d;
    --legal-rule: #dde5ec;
    --legal-surface: #f6f9fb;
    --legal-accent: #0d6efd;
}

/* ---------- page shell ---------- */
.legal-page {
    padding: 48px 0 64px;
    background: #fff;
    color: var(--legal-ink);
}

.legal-header {
    border-bottom: 2px solid var(--legal-rule);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.legal-header h1 {
    font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
    line-height: 1.2;
    color: var(--legal-brand);
    margin: 0 0 8px;
}

.legal-intro {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--legal-ink-soft);
    margin: 0;
    max-width: 70ch;
}

/* ---------- cross-links between the two documents ---------- */
.legal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.legal-tab {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--legal-rule);
    border-radius: 999px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--legal-brand);
    background: #fff;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.legal-tab:hover,
.legal-tab:focus-visible {
    background: var(--legal-surface);
    border-color: var(--legal-brand);
    color: var(--legal-brand);
}

.legal-tab.is-active {
    background: var(--legal-brand);
    border-color: var(--legal-brand);
    color: #fff;
}

/* ---------- document body ---------- */
.legal-doc {
    max-width: 78ch;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--legal-ink);
}

.legal-doc p,
.legal-doc ul {
    margin: 0 0 16px;
}

.legal-doc h3 {
    font-size: 1.25rem;
    line-height: 1.35;
    font-weight: 700;
    color: var(--legal-brand);
    margin: 36px 0 12px;
    padding-top: 4px;
    border-top: 1px solid var(--legal-rule);
}

.legal-doc h3:first-of-type {
    border-top: 0;
    margin-top: 28px;
}

.legal-doc h4 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--legal-ink);
    margin: 22px 0 8px;
}

/* the site's global stylesheet strips list markers; restore them here so the
   documents read as proper lists rather than run-together lines */
.legal-doc ul {
    padding-left: 24px;
    list-style: disc outside;
}

.legal-doc ul li {
    list-style: disc outside;
    display: list-item;
}

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

.legal-doc a {
    color: var(--legal-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-doc a:hover,
.legal-doc a:focus-visible {
    color: #0a58ca;
}

.legal-meta {
    font-size: 0.875rem;
    color: var(--legal-ink-soft);
    margin-bottom: 20px !important;
}

/* highlighted statements the customer must not miss */
.legal-callout {
    background: var(--legal-surface);
    border-left: 4px solid var(--legal-brand);
    padding: 14px 18px;
    border-radius: 0 6px 6px 0;
}

.legal-note {
    font-size: 0.9375rem;
    color: var(--legal-ink-soft);
}

.legal-contact {
    background: var(--legal-surface);
    border: 1px solid var(--legal-rule);
    border-radius: 8px;
    padding: 16px 18px;
    line-height: 1.8;
}

/* ---------- fee table ---------- */
.legal-table-wrap {
    overflow-x: auto;              /* narrow screens scroll the table, never the page */
    margin: 0 0 16px;
    -webkit-overflow-scrolling: touch;
}

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

.legal-table th,
.legal-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--legal-rule);
}

.legal-table thead th {
    background: var(--legal-brand);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.legal-table tbody tr:nth-child(even) {
    background: var(--legal-surface);
}

.legal-table td:nth-child(2),
.legal-table td:nth-child(3) {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---------- footer ---------- */
.legal-back {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--legal-rule);
}

.legal-back a {
    color: var(--legal-brand);
    font-weight: 600;
    text-decoration: none;
}

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

.legal-footer {
    background: var(--legal-brand);
    color: #c3d0da;
    padding: 28px 0;
}

.legal-footer-disclaimer {
    font-size: 13px;
    line-height: 19px;
    max-width: 80ch;
    margin: 0 0 12px;
}

.legal-footer a { color: #fff; text-decoration: underline; }

.legal-footer-links {
    font-size: 14px;
    margin: 0 0 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.legal-footer-copy {
    font-size: 13px;
    margin: 0;
    color: #9dacb8;
}

/* ---------- same content inside the checkout modal ---------- */
#termsModal .legal-doc {
    max-width: none;
    font-size: 0.9375rem;
}

#termsModal .legal-doc h3 {
    font-size: 1.0625rem;
    margin-top: 24px;
}

#termsModal .legal-doc h4 { font-size: 1rem; }

@media (max-width: 575.98px) {
    .legal-page { padding: 32px 0 40px; }
    .legal-doc { font-size: 0.9375rem; }
    .legal-doc h3 { font-size: 1.125rem; margin-top: 28px; }
}

/* ---------- review links under the checkout pay button ---------- */
.legal-checkout-links {
    font-size: 0.875rem;
    line-height: 1.6;
}

.legal-checkout-links a {
    color: var(--legal-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 600;
    white-space: nowrap;
}

.legal-checkout-links a:hover,
.legal-checkout-links a:focus-visible { color: #0a58ca; }

/* ---------- legal links in the site footer ---------- */
.footer-legal-links { list-style: none; padding: 0; margin: 0; }
.footer-legal-links li { margin-bottom: 10px; }

.footer-legal-links a {
    color: #c3d0da;
    font-size: 15px;
    text-decoration: none;
    transition: color .15s ease;
}

.footer-legal-links a:hover,
.footer-legal-links a:focus-visible {
    color: #fff;
    text-decoration: underline;
}
