/* =====================================================================
   CREONIO — TERMS OF SERVICE PAGE
   =====================================================================
   Layout + typography for terms.php only. Requires css/base.css to be
   loaded first (design tokens, reset, and the fonts import all live
   there) - same convention as every other page-specific module.
   ===================================================================== */

.terms-wrap {
    display: grid;
    grid-template-columns: 280px minmax(0, 760px);
    gap: 3rem;
    max-width: 1180px;
    margin: 0 auto;
    padding: 3rem 1.5rem 6rem;
    align-items: start;
}

/* ---------- masthead ---------- */

.terms-masthead {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1.5rem 2.5rem;
    margin-bottom: 1rem;
}

.terms-masthead .brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.02em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.terms-masthead h1.doc-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem);
    font-weight: 700;
    margin: 0 0 0.75rem;
    border: none;
    padding: 0;
    color: var(--text);
}

.terms-masthead .meta {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.terms-masthead .version-pill {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    color: var(--accent-2);
    font-size: 0.8rem;
    font-weight: 600;
}

.terms-masthead .legal-note {
    max-width: 560px;
    margin: 1.5rem auto 0;
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius-md);
    background: var(--alarmred-bg);
    border: 1px solid rgba(235, 0, 73, 0.3);
    color: #ff8fae;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ---------- table of contents (sticky sidebar) ---------- */

.terms-toc {
    position: sticky;
    top: 2rem;
    background: var(--cardblue);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.terms-toc h3 {
    font-family: var(--font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    margin: 0 0 1rem;
}

.terms-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.terms-toc a {
    color: var(--text-dim);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color var(--fast) var(--ease);
}

.terms-toc a:hover {
    color: var(--btnblue);
    text-decoration: none;
}

/* ---------- document body ---------- */

.terms-body {
    background: var(--cardblue);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 2vw + 1rem, 3rem);
    box-shadow: var(--shadow-card);
}

.terms-body h1 {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem);
    font-weight: 700;
    color: var(--text);
    margin: 3rem 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-strong);
    scroll-margin-top: 2rem;
}

.terms-body h1:first-child { margin-top: 0; }

.terms-body h2 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-2);
    margin: 1.75rem 0 0.75rem;
    scroll-margin-top: 2rem;
}

.terms-body p {
    margin: 0 0 0.9rem;
    color: var(--text-dim);
    text-align: justify;
}

.terms-body ul {
    margin: 0 0 1.1rem;
    padding-left: 1.4rem;
    color: var(--text-dim);
}

.terms-body li {
    margin-bottom: 0.4rem;
}

.terms-body li::marker {
    color: var(--btnblue);
}

/* ---------- back to top ---------- */

.terms-back-to-top {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 3rem;
    padding: 0.75rem 1.2rem;
    background: var(--surface-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 600;
    transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.terms-back-to-top:hover {
    border-color: var(--btnblue);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text);
}

/* ---------- footer ---------- */

.terms-footer {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-faint);
    font-size: 0.8rem;
    padding-top: 2rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-soft);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .terms-wrap {
        grid-template-columns: 1fr;
    }
    .terms-toc {
        position: static;
        margin-bottom: 1rem;
    }
}

@media print {
    body { background: white; color: black; }
    .terms-toc, .terms-back-to-top { display: none; }
    .terms-body { box-shadow: none; border: none; background: white; }
    .terms-body p, .terms-body ul { color: black; }
}
