/* Inspired design system (from the Winning Ads Engine Claude Design System, v3).
   Rules: .claude/rules/brand-system.md. Load Figtree in <head>, then this file, then page CSS. */

/* ---------- Tokens ---------- */
:root {
    /* Neutrals: warm off-white page, white cards, fine cool borders */
    --page: #FAF9F7; --surface: #FFFFFF; --surface-subtle: #F5F4F1; --surface-sunken: #F0EFEC;
    --border: #E3E2E7; --border-strong: #D3D2DA;
    /* Text */
    --ink: #171B36; --slate: #686C83; --slate-light: #9A9DB0; --white: #FFFFFF;
    /* Indigo: the one action color */
    --indigo-50: #F6F7FF; --indigo-100: #EEF0FF; --indigo-200: #DCE1FF; --indigo-300: #9AA7FF;
    --indigo-500: #253DB4; --indigo-600: #1E3297; --indigo-700: #1A2B82; --indigo-900: #121A4A;
    /* Status: never decoration */
    --green-100: #E7F2EB; --green-500: #337A4D;
    --amber-100: #FBEFDF; --amber-500: #A55D08;
    --red-100: #FBEAEB; --red-500: #B93640;

    --accent: var(--indigo-500); --accent-hover: var(--indigo-600); --text-on-accent: var(--white);

    /* Type */
    --font-sans: "Figtree", "Public Sans", system-ui, sans-serif;
    --fs-hero: 60px; --fs-h1: 44px; --fs-h2: 34px; --fs-h3: 22px; --fs-lead: 19px; --fs-body-l: 17px;
    --fs-body: 15px; --fs-label: 12px; --fs-metric: 28px;
    --tracking-tight: -0.025em; --tracking-label: 0.04em;

    /* Space + layout */
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px;
    --space-8: 32px; --space-10: 40px; --space-12: 48px; --space-16: 64px; --space-24: 96px;
    --container: 1180px; --container-narrow: 720px;

    /* Radii: 8 chips, 10 buttons/inputs, 12 rows/tiles, 16 cards, 20 dialogs */
    --radius-sm: 8px; --radius-btn: 10px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 20px; --radius-full: 9999px;

    /* Depth: very soft ink-tinted shadows. Card border is drawn as a 1px ring inside the shadow. */
    --shadow-xs: 0 1px 2px rgba(23,27,54,.04);
    --shadow-sm: 0 1px 2px rgba(23,27,54,.04), 0 2px 6px rgba(23,27,54,.04);
    --shadow-md: 0 1px 2px rgba(23,27,54,.04), 0 8px 24px rgba(23,27,54,.06);
    --shadow-lg: 0 2px 4px rgba(23,27,54,.04), 0 24px 56px rgba(23,27,54,.12);
    --shadow-primary: 0 1px 2px rgba(37,61,180,.24), inset 0 1px 0 rgba(255,255,255,.12);
    --shadow-card: 0 0 0 1px var(--border), var(--shadow-sm);
    --shadow-card-hover: 0 0 0 1px var(--border-strong), var(--shadow-md);
    --shadow-well: inset 0 0 0 1px var(--border);
    --focus-ring: 0 0 0 3px rgba(37,61,180,.22);
    --overlay: rgba(23,27,54,.4);

    /* Motion: quick and quiet */
    --ease-out: cubic-bezier(.22,1,.36,1);
    --dur-fast: 150ms; --dur-press: 180ms; --dur-reveal: 500ms;
}

/* Dark: put data-theme="dark" on any container */
[data-theme="dark"] {
    --page: #25293C; --surface: #2F3349; --surface-subtle: #292D42; --surface-sunken: #22263A;
    --border: #3D4260; --border-strong: #4A4F6E;
    --ink: #E6E7F0; --slate: #A9ADC4; --slate-light: #7D8199;
    --indigo-100: #363C63; --indigo-200: #414878; --indigo-500: #9AA7FF; --indigo-600: #B3BDFF;
    --green-100: #2B3F3A; --green-500: #7BC79A; --amber-100: #43392C; --amber-500: #E8A85B; --red-100: #46303A; --red-500: #F08A92;
    --text-on-accent: #171B36;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 var(--fs-body)/1.55 var(--font-sans); font-variant-numeric: tabular-nums; }
h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 700; letter-spacing: var(--tracking-tight); line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
::selection { background: var(--indigo-100); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-6); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding: var(--space-24) 0; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--space-4); top: var(--space-4); z-index: 100; background: var(--surface); padding: var(--space-2) var(--space-4); }

/* Type helpers */
.h-hero { font-size: clamp(38px, 5.4vw, var(--fs-hero)); font-weight: 800; line-height: 1.04; }
.h1 { font-size: clamp(32px, 4.4vw, var(--fs-h1)); font-weight: 800; line-height: 1.08; }
.h2 { font-size: clamp(26px, 3.4vw, var(--fs-h2)); font-weight: 800; line-height: 1.12; }
.h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.25; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--slate); }
.body-l { font-size: var(--fs-body-l); line-height: 1.6; color: var(--slate); }
.muted { color: var(--slate); }
.hl { color: var(--accent); }            /* Highlight: indigo text, no background */
.hl--warn { color: var(--amber-500); }  /* Highlight, amber tone: pain/cost only */

.eyebrow { display: inline-flex; align-items: center; gap: var(--space-2); font: 600 var(--fs-label)/1.3 var(--font-sans); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--slate); }
.eyebrow--accent { color: var(--accent); }
.eyebrow svg { width: 15px; height: 15px; }

/* Icons: Lucide outline 2px via SVG sprite, sizes 16/18/20 */
.icon { width: 18px; height: 18px; flex: none; }
.icon-tile { flex: none; width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--indigo-100); color: var(--accent); }
.icon-tile svg { width: 18px; height: 18px; }

/* ---------- Buttons: primary / secondary / outline / ghost; 32 / 40 / 52 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-btn); font: 600 14px/1 var(--font-sans); white-space: nowrap; cursor: pointer; text-decoration: none; background: var(--accent); color: var(--text-on-accent); box-shadow: var(--shadow-primary); transition: background var(--dur-fast); }
.btn:hover { background: var(--accent-hover); color: var(--text-on-accent); }
.btn:active { animation: ds-press var(--dur-press) var(--ease-out); }
.btn svg { width: 16px; height: 16px; }
.btn--sm { height: 32px; padding: 0 var(--space-3); font-size: 13px; }
.btn--lg { height: 52px; padding: 0 var(--space-6); font-size: 16px; }
.btn--lg svg { width: 18px; height: 18px; }
.btn--secondary { background: var(--indigo-100); color: var(--accent); box-shadow: none; }
.btn--secondary:hover { background: var(--indigo-200); color: var(--accent); }
.btn--outline { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow-xs); }
.btn--outline:hover { background: var(--surface-subtle); color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn--ghost:hover { background: var(--surface-subtle); color: var(--ink); }
.btn--on-ink { background: var(--white); color: var(--accent); box-shadow: none; }
.btn--on-ink:hover { background: var(--indigo-100); color: var(--accent); }

/* ---------- Badges: pills, 24px ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-full); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--slate); font: 600 12px/1 var(--font-sans); white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.badge--accent { background: var(--indigo-100); color: var(--accent); box-shadow: none; }
.badge--success { background: var(--green-100); color: var(--green-500); box-shadow: none; }
.badge--warning { background: var(--amber-100); color: var(--amber-500); box-shadow: none; }
.badge--danger { background: var(--red-100); color: var(--red-500); box-shadow: none; }
.badge--success::before, .badge--warning::before, .badge--danger::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Cards: white + 1px ring + soft shadow ---------- */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-card); }
.card--lg { border-radius: var(--radius-xl); box-shadow: 0 0 0 1px var(--border), var(--shadow-md); }
.card--well { background: var(--surface-subtle); box-shadow: var(--shadow-well); }
.card--selected { background: var(--indigo-50); box-shadow: 0 0 0 2px var(--accent), var(--shadow-md); }
.card--interactive { transition: box-shadow var(--dur-fast); }
.card--interactive:hover { box-shadow: var(--shadow-card-hover); }

/* Stat tile */
.stat { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); }
.stat__label { display: block; font: 500 13px/1.3 var(--font-sans); color: var(--slate); }
.stat__value { display: block; margin-top: var(--space-2); font: 700 var(--fs-metric)/1 var(--font-sans); letter-spacing: -0.02em; color: var(--ink); }
.stat__caption { display: block; margin-top: var(--space-2); font: 500 12px/1.4 var(--font-sans); color: var(--slate); }

/* Check list: check (indigo) / cross (neutral) */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.checklist li { display: flex; align-items: flex-start; gap: var(--space-3); font-size: var(--fs-body-l); line-height: 1.5; }
.checklist li::before { content: ""; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--indigo-100) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23253DB4' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/14px no-repeat; }
.checklist--cross li { color: var(--slate); }
.checklist--cross li::before { background: var(--surface-subtle) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23686C83' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center/14px no-repeat; }

/* Accordion: native <details> rows inside one card */
.accordion { border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.accordion details + details { border-top: 1px solid var(--border); }
.accordion summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 18px 22px; cursor: pointer; font: 600 16px/1.35 var(--font-sans); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: ""; flex: none; width: 18px; height: 18px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23686C83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat; transition: transform var(--dur-fast); }
.accordion details[open] summary::after { transform: rotate(180deg); }
.accordion details > div { padding: 0 22px 20px; font-size: 15px; line-height: 1.6; color: var(--slate); }

/* Ink band: the one dark section allowed per page (hero, system or offer) */
.band-ink { background: var(--ink); color: var(--white); }
.band-ink h2, .band-ink h3 { color: var(--white); }
.band-ink .eyebrow { color: var(--indigo-300); }
.band-ink .hl { color: var(--indigo-300); }
.band-ink .muted, .band-ink p { color: rgba(255,255,255,.78); }

/* ---------- Site chrome ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--page); box-shadow: 0 1px 0 var(--border); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); height: 72px; }
.site-header__actions { display: flex; align-items: center; gap: var(--space-2); }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 700 19px/1 var(--font-sans); letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.logo svg { width: 28px; height: 28px; color: var(--accent); }
@media (max-width: 600px) { .site-header__login { display: none; } }

footer { padding: var(--space-12) 0 var(--space-8); border-top: 1px solid var(--border); }
.footer-main { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-8); flex-wrap: wrap; padding-bottom: var(--space-8); margin-bottom: var(--space-6); border-bottom: 1px solid var(--border); }
.footer-logo { display: flex; align-items: center; gap: var(--space-2); font: 700 16px/1 var(--font-sans); }
.footer-logo-icon { width: 24px; height: 24px; color: var(--accent); }
.footer-brand p { margin-top: var(--space-3); max-width: 300px; font-size: 14px; color: var(--slate); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); }
.footer-links a { font-size: 14px; font-weight: 500; color: var(--slate); }
.footer-links a:hover { color: var(--ink); }
.footer-copy { text-align: center; font-size: 13px; color: var(--slate-light); }

/* Cookie banner (js/cookie-consent.js toggles .visible / .show-settings) */
.cookie-banner { position: fixed; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); z-index: 90; max-width: 960px; margin: 0 auto; padding: var(--space-5) var(--space-6); background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 0 0 1px var(--border), var(--shadow-lg); transform: translateY(calc(100% + 32px)); transition: transform var(--dur-reveal) var(--ease-out); }
.cookie-banner.visible { transform: none; }
.cookie-banner-inner { display: flex; align-items: center; gap: var(--space-6); }
.cookie-banner.show-settings .cookie-banner-inner { flex-direction: column; align-items: stretch; }
.cookie-banner-text { flex: 1; font-size: 14px; color: var(--slate); }
.cookie-banner-actions, .cookie-settings-actions { display: flex; gap: var(--space-2); flex-shrink: 0; }
.cookie-settings-actions { justify-content: flex-end; padding-top: var(--space-4); }
.cookie-btn { height: 40px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-btn); font: 600 14px/1 var(--font-sans); white-space: nowrap; cursor: pointer; background: transparent; color: var(--ink); transition: background var(--dur-fast); }
.cookie-btn:hover { background: var(--surface-subtle); }
.cookie-btn-reject { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.cookie-btn-accept, .cookie-btn-save { background: var(--accent); color: var(--white); box-shadow: var(--shadow-primary); }
.cookie-btn-accept:hover, .cookie-btn-save:hover { background: var(--accent-hover); }
.cookie-settings-panel { display: none; border-top: 1px solid var(--border); padding-top: var(--space-2); }
.cookie-banner.show-settings .cookie-settings-panel { display: block; }
.cookie-banner.show-settings .cookie-banner-actions { display: none; }
.cookie-category { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.cookie-category:last-of-type { border-bottom: 0; }
.cookie-category-info { display: flex; flex-direction: column; gap: 2px; }
.cookie-category-label { font-weight: 600; font-size: 14px; }
.cookie-category-desc { font-size: 13px; color: var(--slate); }
.cookie-category.disabled .cookie-toggle { opacity: .5; pointer-events: none; }
.cookie-toggle { position: relative; flex: none; width: 40px; height: 22px; }
.cookie-toggle input { opacity: 0; width: 0; height: 0; }
.cookie-toggle-slider { position: absolute; inset: 0; cursor: pointer; border-radius: var(--radius-full); background: var(--border-strong); transition: background var(--dur-fast); }
.cookie-toggle-slider::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: var(--shadow-xs); transition: transform var(--dur-fast) var(--ease-out); }
.cookie-toggle input:checked + .cookie-toggle-slider { background: var(--accent); }
.cookie-toggle input:checked + .cookie-toggle-slider::after { transform: translateX(18px); }
@media (max-width: 600px) {
    .cookie-banner-inner { flex-direction: column; align-items: stretch; }
    .cookie-btn { flex: 1; }
}

/* Legal modal (injected by js/site-footer.js, driven by js/legal.js) */
.legal-modal-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: var(--space-6); background: var(--overlay); opacity: 0; visibility: hidden; transition: opacity var(--dur-fast), visibility var(--dur-fast); }
.legal-modal-overlay.active { opacity: 1; visibility: visible; }
.legal-modal { display: flex; flex-direction: column; width: 100%; max-width: 720px; max-height: 85vh; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.legal-modal-header { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--border); }
.legal-tabs { display: flex; gap: var(--space-2); overflow-x: auto; }
.legal-tab { height: 32px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--slate); font: 600 13px/1 var(--font-sans); white-space: nowrap; cursor: pointer; }
.legal-tab:hover { background: var(--surface-subtle); color: var(--ink); }
.legal-tab.active { background: var(--indigo-100); color: var(--accent); }
.legal-modal-close { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--radius-btn); background: transparent; color: var(--slate); cursor: pointer; }
.legal-modal-close:hover { background: var(--surface-subtle); color: var(--ink); }
.legal-modal-body { flex: 1; overflow-y: auto; padding: var(--space-8); }
.legal-content { display: none; }
.legal-content.active { display: block; }
.legal-content h2 { font-size: 24px; margin-bottom: var(--space-2); }
.legal-content h3 { font-size: 17px; margin: var(--space-8) 0 var(--space-3); }
.legal-content .last-updated { font-size: 13px; color: var(--slate); margin-bottom: var(--space-6); }
.legal-content p, .legal-content ul { font-size: 15px; line-height: 1.7; color: var(--slate); margin: 0 0 var(--space-4); }
.legal-content ul { padding-left: var(--space-6); }

/* ---------- Motion ---------- */
@keyframes ds-press { 0% { transform: scale(1); } 40% { transform: scale(.97); } 100% { transform: scale(1); } }
@keyframes ds-reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.reveal { animation: ds-reveal var(--dur-reveal) var(--ease-out) both; }
.reveal--2 { animation-delay: 90ms; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
