/* ==========================================================
   Uryth Legal & Account Pages
   Shared by: privacy-policy.html, terms-of-service.html, delete-account.html
   Palette source: PROJECT_SPECIFICATION.md Section 3 (UI Design Theme)
   "CRITICAL: Use the Indigo theme throughout. Do not use Teal, Blue, or
   any other primary color." Seed color #7F77DD, Material 3 ColorScheme.
   ========================================================== */

:root {
    --primary: #7F77DD;        /* Indigo — brand primary (spec Section 3) */
    --primary-dark: #5E56C4;
    --amber: #EF9F27;          /* spec "Expiring soon" amber, reused here for advisory notes */
    --amber-bg: #FFF8EC;
    --amber-border: #F3DDB0;

    --text: #2B2A38;                  /* Indigo-tinted near-black, consistent with a Material 3
                                          onSurface color derived from the Indigo seed */
    --secondary-text: #6B6980;
    --text-muted: var(--secondary-text); /* legacy alias, kept for older inline references */

    --border: #D4D2F5;         /* Indigo-tinted border, matches spec surfaces */
    --background: #FFFFFF;     /* spec "Surface" white — cards, tables, panels */
    --background-alt: #F8F8FE; /* spec "Page background" — Indigo-tinted off-white */
    --table-header: #F1EFFC;   /* light Indigo tint, distinct from both surface and page bg */

    --max-width: 960px;         /* long-form legal documents */
    --max-width-narrow: 640px;  /* short single-purpose pages (delete-account) */
    --radius: 10px;              /* buttons, pills, small controls */
    --radius-lg: 14px;           /* cards, TOC panel */
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 40px 20px;
    background: var(--background-alt);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.6;
}

main,
.wrap {
    max-width: var(--max-width);
    margin: auto;
}

.wrap {
    max-width: var(--max-width-narrow);
    padding: 16px 4px 40px;
}

/* ==========================================================
   Brand mark (shared across all three pages)
   ========================================================== */

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--primary);
    flex-shrink: 0;
}

.brand-name {
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -0.01em;
}

/* ==========================================================
   Header
   ========================================================== */

.legal-header {
    text-align: center;
    margin-bottom: 32px;
}

.legal-header .brand {
    justify-content: center;
}

h1 {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.legal-header .subtitle,
.legal-header p {
    margin: 6px 0;
    color: var(--secondary-text);
}

.subtitle {
    color: var(--secondary-text);
    font-size: 16px;
    margin: 0 0 8px;
}

/* ==========================================================
   Cross-page navigation
   ========================================================== */

.legal-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 36px;
}

.legal-nav a {
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--background);
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.legal-nav a:hover {
    background: var(--primary);
    color: #ffffff;
}

.legal-nav a[aria-current="page"] {
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

/* ==========================================================
   Table of Contents
   ========================================================== */

.toc {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 40px 0;
}

.toc h2 {
    margin-top: 0;
}

.toc ol {
    margin: 0;
    padding-left: 24px;
}

.toc li {
    margin: 8px 0;
}

.toc a {
    color: var(--primary-dark);
    text-decoration: none;
}

.toc a:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* ==========================================================
   Sections (privacy-policy.html, terms-of-service.html)
   ========================================================== */

section {
    margin-bottom: 48px;
}

section h2 {
    color: var(--primary-dark);
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

section h3 {
    margin-top: 28px;
    color: var(--text);
}

section h4 {
    margin-top: 20px;
    color: var(--text);
}

p {
    margin: 14px 0;
}

ul,
ol {
    padding-left: 26px;
}

li {
    margin: 8px 0;
}

/* ==========================================================
   Links
   ========================================================== */

a {
    color: var(--primary-dark);
}

a:hover {
    color: var(--primary);
}

/* ==========================================================
   Tables
   ========================================================== */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: var(--background);
}

th {
    background: var(--table-header);
    text-align: left;
}

th,
td {
    border: 1px solid var(--border);
    padding: 12px;
    vertical-align: top;
}

/* ==========================================================
   Code
   ========================================================== */

code {
    background: var(--background-alt);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 6px;
    font-size: 0.92em;
}

/* ==========================================================
   Cards (delete-account.html)
   ========================================================== */

.card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 28px 30px;
    margin-bottom: 20px;
}

.card h2 {
    font-size: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary-dark);
    margin: 0 0 16px;
    border-bottom: none;
    padding-bottom: 0;
}

.card ol {
    margin: 0;
    padding-left: 20px;
}

.card ol li {
    margin-bottom: 12px;
}

.card ol li:last-child {
    margin-bottom: 0;
}

.card p:first-child {
    margin-top: 0;
}

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

/* ==========================================================
   Buttons
   ========================================================== */

.btn {
    display: inline-block;
    background: var(--primary);
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    padding: 12px 22px;
    border-radius: var(--radius);
    margin-top: 18px;
}

.btn:hover {
    background: var(--primary-dark);
    color: #ffffff;
}

/* ==========================================================
   Advisory note (delete-account.html)
   ========================================================== */

.note {
    display: flex;
    gap: 12px;
    background: var(--amber-bg);
    border: 1px solid var(--amber-border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    font-size: 14.5px;
    margin-bottom: 20px;
}

.note-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
    margin-top: 7px;
}

/* ==========================================================
   Fine print
   ========================================================== */

.fine {
    color: var(--secondary-text);
    font-size: 13.5px;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* ==========================================================
   Footer
   ========================================================== */

footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--secondary-text);
    font-size: 0.95rem;
}

/* ==========================================================
   Responsive
   ========================================================== */

@media (max-width: 768px) {

    body {
        padding: 24px 16px;
    }

    h1 {
        font-size: 1.5rem;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .toc,
    .card {
        padding: 18px;
    }

}

/* ==========================================================
   Print
   ========================================================== */

@media print {

    body {
        padding: 0;
        background: #ffffff;
    }

    .toc {
        page-break-after: always;
    }

    .legal-nav {
        display: none;
    }

    a {
        color: black;
        text-decoration: none;
    }

    section {
        page-break-inside: avoid;
    }

}
