/* ============================================================
   Legal pages (privacy, terms — EN/ES) — Editorial Financial Warm
   Matches the standalone app's editorial token system so that
   /privacy and /terms feel like the same product.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600;1,700&display=swap');

/* ---------- Editorial tokens (scoped to legal pages) ---------- */
:root {
    /* Palette — warm cream, overrides legacy indigo tokens from tokens.css */
    --bg: oklch(98% 0.015 85);
    --bg-2: oklch(96% 0.022 80);
    --surface: oklch(100% 0 0);
    --surface-sunken: oklch(96% 0.018 85);

    --ink: oklch(18% 0.02 60);
    --ink-muted: oklch(42% 0.02 60);
    --ink-subtle: oklch(50% 0.015 60);

    --accent: oklch(68% 0.17 55);
    --accent-soft: oklch(94% 0.05 55);
    --accent-ink: oklch(48% 0.17 55);

    --separator: oklch(88% 0.015 85);
    --hairline: oklch(90% 0.012 85);

    /* Typography */
    --legal-serif: 'Playfair Display', 'New York', Georgia, serif;
    --legal-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Radii — editorial asymmetric (card-level, not hero-level) */
    --legal-radius: 14px 18px 14px 18px;
    --legal-radius-sm: 10px 14px 10px 14px;

    /* Warm shadow system (mirrors standalone.css --shadow-2) */
    --legal-shadow:
        0 1px 3px oklch(18% 0.03 260 / 0.05),
        0 20px 48px -24px oklch(18% 0.03 260 / 0.12);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: oklch(17% 0.015 60);
        --bg-2: oklch(20% 0.018 60);
        --surface: oklch(22% 0.018 60);
        --surface-sunken: oklch(19% 0.015 60);

        --ink: oklch(96% 0.01 80);
        --ink-muted: oklch(78% 0.015 80);
        --ink-subtle: oklch(70% 0.015 80);

        --accent: oklch(74% 0.16 60);
        --accent-soft: oklch(30% 0.08 55);
        --accent-ink: oklch(82% 0.14 60);

        --separator: oklch(32% 0.02 60);
        --hairline: oklch(28% 0.015 60);

        --legal-shadow:
            0 1px 3px oklch(0% 0 0 / 0.4),
            0 20px 48px -24px oklch(0% 0 0 / 0.55);
    }
}

/* ---------- Base ---------- */
html, body {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--legal-sans);
    background:
        radial-gradient(ellipse at 18% 8%, oklch(95% 0.04 70 / 0.85) 0%, transparent 45%),
        radial-gradient(ellipse at 85% 92%, oklch(95% 0.035 150 / 0.7) 0%, transparent 50%),
        var(--bg);
    color: var(--ink);
    line-height: 1.7;
    padding: 2.5rem 1rem 3rem;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    font-feature-settings: "ss01", "cv11";
}

@media (prefers-color-scheme: dark) {
    body {
        background:
            radial-gradient(ellipse at 18% 8%, oklch(28% 0.05 60 / 0.6) 0%, transparent 50%),
            radial-gradient(ellipse at 85% 92%, oklch(26% 0.045 150 / 0.5) 0%, transparent 55%),
            var(--bg);
    }
}

/* Paper noise atmosphere — mirrors standalone.css */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.08  0 0 0 0 0.05  0 0 0 0.06 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

@media (prefers-color-scheme: dark) {
    body::before {
        opacity: 0.2;
        mix-blend-mode: screen;
    }
}

/* ---------- Container ---------- */
.container {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--legal-radius);
    padding: clamp(1.75rem, 5vw, 2.75rem);
    box-shadow: var(--legal-shadow);
    overflow: hidden;
}

/* Subtle top highlight — same treatment as standalone cards */
.container::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, oklch(100% 0 0 / 0.8), transparent);
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .container::before {
        background: linear-gradient(90deg, transparent, oklch(100% 0 0 / 0.08), transparent);
    }
}

/* ---------- Typography ---------- */
h1 {
    font-family: var(--legal-serif);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

h2 {
    font-family: var(--legal-serif);
    font-weight: 700;
    font-size: clamp(1.25rem, 2.6vw, 1.5rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-top: 2.25rem;
    margin-bottom: 0.6rem;
}

p,
li {
    color: var(--ink-muted);
    font-size: 0.95rem;
}

p {
    margin-bottom: 0.75rem;
}

strong {
    color: var(--ink);
    font-weight: 600;
}

ul {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}

li {
    margin-bottom: 0.4rem;
}

code {
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 0.85em;
    padding: 0.1rem 0.35rem;
    background: var(--surface-sunken);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    color: var(--accent-ink);
}

.updated {
    font-family: var(--legal-serif);
    font-style: italic;
    color: var(--ink-subtle);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* ---------- Links ---------- */
a {
    color: var(--accent-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

a:hover {
    color: var(--accent-ink);
}

.back {
    display: inline-flex;
    align-items: center;
    margin-bottom: 1.5rem;
    color: var(--ink-muted);
    text-decoration: none;
    font-family: var(--legal-serif);
    font-style: italic;
    font-size: 0.95rem;
    transition: color 200ms cubic-bezier(0.16, 1, 0.3, 1), transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.back:hover {
    color: var(--accent);
    transform: translateX(-2px);
    text-decoration: none;
}

[dir="rtl"] .back:hover {
    transform: translateX(2px);
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
    .back:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
    body::before { display: none; }
    body { background: #fff; color: #000; padding: 0; }
    .container { box-shadow: none; border: none; }
}
