/* =========================================================================
   le-smic.fr — Design system 2026 (mobile-first, zéro framework)
   ========================================================================= */

/* ---------- Tokens ---------- */
:root {
  --navy: #0b2a4a;
  --navy-700: #123a63;
  --blue: #2563eb;
  --blue-600: #1d4ed8;
  --gold: #d4a843;
  --gold-soft: #f6edd6;
  --green: #15803d;
  --red: #dc2626;

  --ink: #0f172a;
  --ink-soft: #475569;
  --line: #e2e8f0;
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --card: #ffffff;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -20px rgba(11, 42, 74, .35);

  --maxw: 1120px;
  --gut: clamp(16px, 5vw, 28px);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Sora", var(--font);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eef6;
    --ink-soft: #9fb0c4;
    --line: #22304a;
    --bg: #0a1626;
    --bg-soft: #0e1d33;
    --card: #0f2138;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .55);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .7);
    --gold-soft: #2a2412;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 3.5vw, 1.4rem); font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: clamp(40px, 8vw, 80px); }
.section--soft { background: var(--bg-soft); }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.18rem; color: var(--ink); letter-spacing: -.03em; white-space: nowrap; margin-right: auto; }
.brand:hover { text-decoration: none; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.nav-links { display: none; margin-left: auto; gap: 4px; align-items: center; }
.nav-links a { color: var(--ink-soft); font-weight: 600; font-size: .96rem; padding: 8px 12px; border-radius: 10px; }
.nav-links a:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.site-header .nav-cta { display: none; }
.burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--ink); cursor: pointer;
}
.burger svg { width: 22px; height: 22px; }
.mobile-menu { display: none; border-top: 1px solid var(--line); background: var(--bg); }
.mobile-menu.open { display: block; }
.mobile-menu a { display: block; padding: 14px 4px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line); }
.mobile-menu a:hover { text-decoration: none; color: var(--blue); }

@media (min-width: 880px) {
  .nav-links { display: flex; }
  .brand { margin-right: 0; }
  .burger, .mobile-menu { display: none !important; }
  .site-header .nav-cta { display: inline-flex; margin-left: 8px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 14px 22px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
  min-height: 48px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .6); }
.btn-primary:hover { background: var(--blue-600); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-gold { background: var(--gold); color: #3a2c05; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(36px, 8vw, 72px); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto -20%; height: 520px; z-index: -1;
  background: radial-gradient(60% 60% at 50% 0%, rgba(37, 99, 235, .16), transparent 70%),
              radial-gradient(40% 50% at 85% 10%, rgba(212, 168, 67, .18), transparent 70%);
}
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .8rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--blue);
  background: color-mix(in srgb, var(--blue) 10%, transparent); padding: 6px 12px; border-radius: 999px;
}
.hero h1 { margin-top: 16px; }
.hero .lead { font-size: clamp(1.05rem, 2.6vw, 1.25rem); color: var(--ink-soft); max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Big figure card */
.figure-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: clamp(22px, 5vw, 34px); margin-top: 28px;
}
.figure-card .badge {
  display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .82rem;
  color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent);
  padding: 6px 12px; border-radius: 999px;
}
.figure-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-top: 18px; }
.figure {
  background: var(--bg-soft); border-radius: var(--radius-sm); padding: 18px;
  border: 1px solid var(--line);
}
.figure .lbl { font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.figure .val { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 7vw, 2.4rem); letter-spacing: -.03em; }
.figure .val .eu { font-size: .6em; color: var(--ink-soft); font-weight: 700; }
.figure.is-primary { background: var(--navy); border-color: var(--navy-700); color: #fff; }
.figure.is-primary .lbl { color: #b9c8db; }
.figure.is-primary .val .eu { color: #9fb0c4; }
.figure .sub { font-size: .82rem; color: var(--ink-soft); margin-top: 6px; }

@media (min-width: 720px) {
  .figure-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 980px) {
  .hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
  .figure-card { margin-top: 0; }
}

/* ---------- Cards grid ---------- */
.cards { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 940px) { .cards--3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .2s ease;
  display: flex; flex-direction: column;
}
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.card .ico {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--gold-soft); color: var(--navy); margin-bottom: 14px;
}
.card .ico svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--ink-soft); font-size: .96rem; margin: 0; }
.card .more { margin-top: auto; padding-top: 14px; font-weight: 700; color: var(--blue); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Table (responsive) ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; min-width: 460px; background: var(--card); }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); }
th { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.is-fr { background: color-mix(in srgb, var(--gold) 12%, transparent); font-weight: 700; }

/* World bars */
.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.bar-head .amt { font-variant-numeric: tabular-nums; font-family: var(--font-display); font-weight: 800; }
.bar-track { height: 12px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; border: 1px solid var(--line); }
.bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), #60a5fa); }
.bar-row.is-fr .bar-fill { background: linear-gradient(90deg, var(--gold), #eccb78); }
.bar-row .flag { margin-right: 6px; }

/* ---------- Callouts ---------- */
.callout { background: var(--gold-soft); border-radius: var(--radius); padding: 22px 24px; }
.callout.info { background: color-mix(in srgb, var(--blue) 8%, var(--bg)); }
.callout h3 { margin-bottom: 6px; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Calculator ---------- */
.calc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 5vw, 30px); }
.calc label { display: block; font-weight: 600; margin-bottom: 8px; }
.field { display: flex; align-items: center; gap: 10px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.field input, .field select {
  flex: 1; border: 0; background: transparent; font-size: 1.05rem; color: var(--ink);
  padding: 14px 0; min-height: 48px; font-family: var(--font); font-variant-numeric: tabular-nums;
}
.field input:focus, .field select:focus { outline: none; }
.field .unit { color: var(--ink-soft); font-weight: 700; white-space: nowrap; }
.calc-result { margin-top: 20px; display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.calc-result .r { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.calc-result .r .l { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.calc-result .r .v { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.3rem, 5vw, 1.7rem); font-variant-numeric: tabular-nums; }
.calc-result .r.big { grid-column: 1 / -1; background: var(--navy); color: #fff; border-color: var(--navy-700); }
.calc-result .r.big .l { color: #b9c8db; }

/* ---------- Section heading ---------- */
.sec-head { max-width: 60ch; margin-bottom: 28px; }
.sec-head .kicker { font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: .82rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c7d4e4; padding-block: 48px 28px; margin-top: 40px; }
@media (prefers-color-scheme: dark) { .site-footer { background: #06101d; } }
.site-footer a { color: #e8eef6; }
.foot-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: .95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; font-size: .85rem; color: #91a4bd; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }

/* ---------- Ad slots (non intrusifs) ---------- */
.ad-slot { margin-block: 28px; min-height: 90px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--ink-soft); font-size: .8rem; background: var(--bg-soft); }
.ad-slot[data-filled] { border: 0; background: transparent; }
/* En production (AdSense actif), les annonces sont placées automatiquement (auto-ads) :
   on masque les blocs réservés du mode dev pour éviter les cadres vides. */
body.has-ads .ad-slot { display: none; }

/* ---------- Utilities ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--ink-soft); }
.updated { font-size: .82rem; color: var(--ink-soft); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0; z-index: 100; }
.skip-link:focus { left: 0; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
