/* ============================================================
   IZEO CAB — Calculateur Rentabilité VTC
   global.css — design system partagé
   Palette navy/or · OKLCH · hairline-first · échelle discrète
   (Emil Kowalski / Taste / Impeccable)
   ============================================================ */

/* ---------- TOKENS (OKLCH) ---------- */
:root {
    /* navy (fond sombre) */
    --navy: oklch(0.17 0.03 260);
    --navy-light: oklch(0.21 0.035 260);
    --navy-mid: oklch(0.30 0.05 260);
    /* rôles sémantiques (fond vs texte) pour le dark mode */
    --brand: oklch(0.17 0.03 260);
    --ink: oklch(0.17 0.03 260);
    --surface: oklch(0.99 0.005 260);
    --on-dark: oklch(0.99 0.005 260);
    /* or (accent) */
    --gold: oklch(0.68 0.12 80);
    --gold-light: oklch(0.80 0.11 85);
    /* neutres (pas de blanc/noir pur) */
    --white: oklch(0.99 0.005 260);
    --gray-50: oklch(0.975 0.003 260);
    --gray-100: oklch(0.95 0.004 260);
    --gray-200: oklch(0.90 0.006 260);
    --gray-300: oklch(0.82 0.007 260);
    --gray-400: oklch(0.67 0.01 260);
    --gray-500: oklch(0.47 0.01 260);
    --gray-700: oklch(0.32 0.015 260);
    --gray-900: oklch(0.19 0.015 260);
    /* accents sémantiques */
    --green: #059669;
    --red: #dc2626;
    --amber: #d97706;
    --blue-accent: #2563eb;
    /* profondeur : hairline d'abord, ombres seulement si utile */
    --border: oklch(0.90 0.006 260);
    --shadow-sm: 0 1px 2px oklch(0.3 0.02 260 / 0.06);
    --shadow-md: 0 6px 20px oklch(0.3 0.02 260 / 0.12);
    /* échelle discrète */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    --locked-overlay: rgba(255, 255, 255, 0.88);
}

/* ---------- RESET ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
img, svg { flex-shrink: 0; max-width: 100%; }

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.75;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---------- HEADER ---------- */
.header {
    background: var(--brand);
    color: var(--on-dark);
    padding: 16px 24px;
    border-bottom: 1px solid oklch(1 0 0 / 0.06);
}
.header-inner {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.header .logo {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
}
.header .logo span { color: var(--gold); }
.header a {
    color: var(--on-dark);
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    padding: 8px 16px;
    border: 1px solid oklch(1 0 0 / 0.3);
    border-radius: 6px;
    transition: background .2s;
}
.header a:hover { background: oklch(1 0 0 / 0.1); }
.header-nav { display: flex; gap: 8px; align-items: center; }
.header a.logo {
    border: none; padding: 0; background: transparent;
    display: flex; align-items: center;
    font-size: 1.2rem; font-weight: 700; color: var(--on-dark);
}
.header a.logo:hover { background: transparent; }

/* ---------- CONTENEUR ---------- */
.container { max-width: 860px; margin: 0 auto; padding: 48px 20px 96px; }

/* ---------- TYPOGRAPHIE ---------- */
h1 {
    font-size: 2rem;
    color: var(--ink);
    margin-bottom: 6px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
h2 {
    font-size: 1.3rem;
    color: var(--ink);
    margin: 48px 0 16px;
    letter-spacing: -0.01em;
}
h2 .h2-icon {
    display: inline-block;
    vertical-align: -3px;
    margin-right: 10px;
    flex-shrink: 0;
    color: var(--gold);
}
h3 {
    font-size: 1.05rem;
    color: var(--ink);
    margin: 28px 0 12px;
}
.date { color: var(--gray-500); font-size: .85rem; margin-bottom: 24px; }

/* texte courant : respiration (dark type needs air) */
.container > p,
.container > ul,
.container > ol {
    max-width: 65ch;
}

/* ---------- CONTENU ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
}
ul { padding-left: 20px; margin: 8px 0; }
li { margin: 4px 0; }

.related a {
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
    display: inline-block;
    min-height: 48px;
    padding-block: 12px;
}
.related a:hover { color: var(--gold); }

/* callout : filet or à gauche, pas de fond (anti nested-card) */
.callout {
    border-left: 3px solid var(--gold);
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.92rem;
    color: var(--gray-700);
    background: transparent;
    max-width: 65ch;
}

/* ---------- CTA ---------- */
.cta {
    background: var(--brand);
    color: var(--on-dark);
    text-align: center;
    padding: 24px;
    border-radius: var(--radius);
    margin: 28px 0;
}
.cta a {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    margin-top: 10px;
    transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.cta a:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cta a:active { transform: scale(.97); }

/* ---------- TABLEAUX ---------- */
table { width: 100%; border-collapse: collapse; margin: 12px 0; }
th, td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
    font-size: .85rem;
    vertical-align: top;
    font-variant-numeric: tabular-nums;
}
th { background: var(--brand); color: var(--on-dark); font-weight: 600; }
tr:nth-child(even) { background: var(--gray-50); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 640px; }

/* montants / résultats dynamiques en mono (calculateur) */
.metric .value,
.amount,
.ik-result-highlight .big,
#liveRevenue, #liveHourly, #liveSeuil {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ---------- FOOTER ---------- */
.footer {
    text-align: center;
    padding: 16px;
    font-size: .75rem;
    color: var(--gray-500);
    border-top: 1px solid var(--border);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
    .header-inner { flex-direction: column; text-align: center; }
    h1 { font-size: 1.5rem; }
    .container { padding-inline: 16px; }

    /* Tableaux → cartes empilées */
    .table-wrap table { min-width: 0; }
    table, thead, tbody, th, td, tr { display: block; width: 100%; }
    thead tr { display: none; }
    table tr {
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px;
        background: var(--surface);
    }
    table td {
        border: none;
        padding: 5px 0;
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }
    table td[data-label]::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--ink);
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* ---------- ACCESSIBILITÉ ---------- */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

/* ---------- DARK MODE (conduite de nuit / OLED) ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --navy: oklch(0.12 0.015 260);
        --navy-light: oklch(0.17 0.02 260);
        --navy-mid: oklch(0.30 0.04 260);
        --brand: oklch(0.11 0.01 260);
        --ink: oklch(0.93 0.008 260);
        --surface: oklch(0.21 0.02 260);
        --white: oklch(0.21 0.02 260);
        --gray-50: oklch(0.18 0.015 260);
        --gray-100: oklch(0.21 0.018 260);
        --gray-200: oklch(0.30 0.02 260);
        --gray-300: oklch(0.42 0.02 260);
        --gray-400: oklch(0.55 0.015 260);
        --gray-500: oklch(0.62 0.015 260);
        --gray-700: oklch(0.82 0.01 260);
        --gray-900: oklch(0.93 0.008 260);
        --border: oklch(0.30 0.02 260);
        --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
        --shadow-md: 0 6px 20px oklch(0 0 0 / 0.5);
        --locked-overlay: rgba(15, 18, 28, 0.88);
    }
    body { background: var(--gray-50); color: var(--gray-900); }
    .header, .hero, .cta { background: var(--brand); }
    .card { background: var(--surface); border-color: var(--border); }
    table th { background: oklch(0.26 0.03 260); }
    tr:nth-child(even) { background: oklch(0.20 0.015 260); }
}
