/* =====================================================================
   Premier Achat — design system v3, aligned on equipelefrancois.ca
   Tokens mirror web/src/app/globals.css of the main site.
   ===================================================================== */

@font-face { font-family: "Urbanist"; src: url("/assets/fonts/urbanist-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("/assets/fonts/urbanist-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Urbanist"; src: url("/assets/fonts/urbanist-600.woff2") format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Aboreto"; src: url("/assets/fonts/aboreto-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --ink: #2d2f31;
  --black: #151616;
  --red: #e00000;
  --red-dark: #b50000;
  --white: #ffffff;
  --cream: #fbf7ee;
  --cream-deep: #f4ecdb;
  --sand: #c2a68c;
  --grey-100: #f6f6f6;
  --grey-200: #ececec;
  --grey-300: #ced3d7;
  --grey-600: #6b6b6b;
  --ok-bg: #e8f3ec;
  --ok-fg: #1d5e34;
  --err-bg: #fdecec;
  --err-fg: #9b1111;

  --font-display: "Aboreto", Georgia, serif;
  --font-sans: "Urbanist", Arial, sans-serif;

  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.84rem + 0.18vw, 0.9375rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.375rem);
  --text-xl: clamp(1.375rem, 1.25rem + 0.6vw, 1.75rem);
  --text-2xl: clamp(1.4rem, 1.2rem + 0.95vw, 2rem);
  --text-3xl: clamp(1.65rem, 1.36rem + 1.6vw, 2.6rem);
  --text-4xl: clamp(2rem, 1.52rem + 2.4vw, 3.4rem);

  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --shadow-soft: 0 1px 2px rgba(21, 22, 22, 0.04), 0 8px 24px -12px rgba(21, 22, 22, 0.18);
  --shadow-card: 0 1px 1px rgba(21, 22, 22, 0.03), 0 20px 40px -20px rgba(21, 22, 22, 0.28);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --maxw: 74rem;
  --readw: 46rem;
  --pad: clamp(1rem, 4vw, 2.5rem);
  --header-h: 4.75rem;
  --touch: 2.75rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--red); color: var(--white); }

.wrap { width: min(100% - 2 * var(--pad), var(--maxw)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: absolute; top: -100%; left: 1rem; z-index: 300;
  background: var(--black); color: var(--white); padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm); font-weight: 600; text-decoration: none;
}
.skip-link:focus-visible { top: 1rem; }

h1, h2, h3 { color: var(--black); line-height: 1.15; }
/* Even line lengths in headings (no lone last word), nicer rag in body text. Ignored by older browsers. */
h1, h2, h3, h4, .hero-title, .section-title, .related-title, .topic-title, summary { text-wrap: balance; overflow-wrap: break-word; }
p, li, .lead, .section-sub, dd { text-wrap: pretty; }
.display, .article-title, .hero-title, .section-title, .home-section-title {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ---------- Eyebrow / accents ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 600; font-size: var(--text-xs);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--red);
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 1.5rem; height: 2px; background: currentColor; }
.eyebrow--light { color: var(--white); }
.eyebrow--light::before { background: var(--red); }
.accent { color: var(--red); }

/* ---------- Buttons ---------- */
.btn, .btn-primary, .btn-ghost, .btn-dark {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--touch); padding: 0 1.5rem;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-family: var(--font-sans); font-weight: 600; font-size: var(--text-sm); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary, .btn-primary { background: var(--red); color: var(--white); border-color: var(--red); }
.btn--primary:hover, .btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: var(--white); box-shadow: 0 10px 24px -12px rgba(224, 0, 0, 0.6); }
.btn--ghost, .btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover, .btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn--light { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, 0.55); }
.btn--light:hover { background: var(--white); color: var(--black); }
.btn-dark { background: var(--black); color: var(--white); }
.btn-block { width: 100%; }
.btn .arrow { transition: transform 0.2s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- Header ---------- */
.read-progress {
  position: fixed; top: 0; left: 0; z-index: 120; height: 3px; width: 100%;
  background: var(--red); transform-origin: 0 50%; transform: scaleX(0);
  pointer-events: none;
}
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--grey-200);
  transition: box-shadow 0.25s ease, background-color 0.25s ease;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px -18px rgba(21, 22, 22, 0.35); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; height: var(--header-h); transition: height 0.25s var(--ease-out); }
.site-header.is-scrolled .header-inner { height: 4rem; }

.brand { display: inline-flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--black); flex-shrink: 0; }
.brand:hover { color: var(--black); }
.brand-mark { width: 22px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.04em; }
.brand-tag { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey-600); margin-top: 0.2rem; }

.nav { display: flex; align-items: center; }
.menu-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--touch); height: var(--touch); border: 1px solid var(--grey-300); border-radius: var(--radius-sm);
  background: var(--white); cursor: pointer;
}
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 18px; height: 2px; background: var(--black); border-radius: 2px; transition: transform 0.25s var(--ease-out), opacity 0.2s; position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-icon::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-icon::after { transform: translateY(-6px) rotate(-45deg); }

.nav-links { display: none; }
.nav-item { position: relative; }
.nav-top {
  display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.6rem 0.2rem;
  font-weight: 600; font-size: var(--text-sm); text-decoration: none; color: var(--ink);
  position: relative;
}
.nav-top::after {
  content: ""; position: absolute; left: 0.2rem; right: 0.2rem; bottom: 0.35rem; height: 2px;
  background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform 0.25s var(--ease-out);
}
.nav-top:hover::after, .nav-top.active::after { transform: scaleX(1); }
.nav-top.active { color: var(--black); }
.nav-drop {
  position: absolute; top: calc(100% + 0.25rem); left: -1rem; min-width: 19rem; z-index: 110;
  background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-md);
  box-shadow: var(--shadow-card); padding: 0.6rem;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.22s var(--ease-out), visibility 0.18s;
}
.nav-drop-label { display: block; padding: 0.5rem 0.75rem 0.4rem; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--grey-600); }
.nav-drop a {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.55rem 0.75rem; border-radius: var(--radius-sm);
  font-size: var(--text-sm); font-weight: 500; text-decoration: none; color: var(--ink);
}
.nav-drop a:hover, .nav-drop a[aria-current="page"] { background: var(--cream); color: var(--black); }
.lang-switch { display: inline-flex; align-items: center; gap: 0.35rem; font-size: var(--text-sm); font-weight: 600; color: var(--grey-600); }
.lang-switch [aria-current] { color: var(--black); }
.lang-switch a { text-decoration: none; }
.nav-cta { display: none; }

@media (min-width: 1040px) {
  .menu-toggle { display: none; }
  .nav-links { display: flex; align-items: center; gap: 1.6rem; }
  .nav-item:hover .nav-drop, .nav-item:focus-within .nav-drop { opacity: 1; visibility: visible; transform: none; }
  .nav-cta { display: inline-flex; }
}
@media (max-width: 1039px) {
  .nav-links.open {
    display: flex; flex-direction: column; gap: 0.25rem;
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    background: var(--white); border-bottom: 1px solid var(--grey-200);
    padding: 1rem var(--pad) 1.5rem; box-shadow: var(--shadow-card);
    animation: drop-in 0.25s var(--ease-out);
  }
  .nav-links.open .nav-top { font-size: var(--text-base); color: var(--black); padding-top: 0.8rem; }
  .nav-links.open .nav-top::after { display: none; }
  .nav-links.open .nav-drop { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0.25rem; min-width: 0; }
  .nav-links.open .nav-drop-label { display: none; }
  .nav-links.open .nav-drop a { padding: 0.45rem 0; color: var(--grey-600); background: none; }
  .nav-links.open .lang-switch { margin-top: 1rem; }
}
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Sections ---------- */
section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.bg-cream { background: var(--cream); }
.bg-black { background: var(--black); color: var(--white); }
.section-title { font-size: var(--text-3xl); margin: 0 0 1rem; }
.section-sub { font-size: var(--text-lg); color: var(--grey-600); max-width: 40rem; margin: 0 0 2.5rem; }

/* ---------- Home hero ---------- */
.hero { padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(3rem, 6vw, 5rem); background: var(--cream); overflow: hidden; }
.hero-grid { display: grid; gap: clamp(2rem, 4vw, 4rem); align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.05fr 0.95fr; } }
.hero-title { font-size: var(--text-4xl); line-height: 1.08; margin: 0 0 1.5rem; max-width: 18ch; }
.hero-title em { font-style: normal; color: var(--red); }
.hero-lead { font-size: var(--text-lg); color: var(--ink); max-width: 36rem; margin: 0 0 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--grey-300); max-width: 36rem; }
.hero-stats b { display: block; font-family: var(--font-display); font-weight: 400; font-size: var(--text-2xl); color: var(--black); line-height: 1.1; }
.hero-stats span { font-size: var(--text-xs); color: var(--grey-600); line-height: 1.35; display: block; margin-top: 0.35rem; }
.hero-media { position: relative; }
.hero-photo {
  border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 5; box-shadow: var(--shadow-card);
  max-height: 38rem; margin-left: auto;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; animation: slow-zoom 14s ease-out both; }
@keyframes slow-zoom { from { transform: scale(1.06); } to { transform: scale(1); } }
.float-card {
  position: absolute; background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.8); border-radius: var(--radius-md); box-shadow: var(--shadow-card);
  padding: 1rem 1.2rem; min-width: 14rem;
}
.float-card.fc-1 { left: -1.5rem; bottom: 2.5rem; animation: float 7s ease-in-out infinite; }
.float-card.fc-2 { right: -1rem; top: 2rem; animation: float 8s ease-in-out -2s infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 959px) { .float-card.fc-1 { left: 0.75rem; } .float-card.fc-2 { right: 0.75rem; } .hero-photo { aspect-ratio: 4 / 3; } }
.fc-label { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey-600); }
.fc-value { font-family: var(--font-display); font-size: var(--text-xl); color: var(--black); margin: 0.2rem 0 0.4rem; }
.fc-bar { height: 6px; background: var(--grey-200); border-radius: 999px; overflow: hidden; }
.fc-bar span { display: block; height: 100%; width: 70%; background: var(--red); border-radius: 999px; transform-origin: left; animation: grow 1.6s var(--ease-out) 0.4s both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.fc-list { list-style: none; margin: 0; padding: 0; }
.fc-list li { display: flex; align-items: center; gap: 0.5rem; font-size: var(--text-sm); padding: 0.25rem 0; }
.fc-list li::before { content: "✓"; color: var(--red); font-weight: 700; }

/* ---------- Tools strip / topic cards ---------- */
.topic-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 680px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .topic-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
.topic-card, .spotlight {
  position: relative; overflow: hidden;
  --mx: 50%; --my: 50%;
}
.topic-card {
  display: grid; grid-template-columns: 1fr auto; gap: 0.3rem 1rem; align-items: start;
  padding: 1.25rem 1.35rem; background: var(--white);
  border: 1px solid var(--grey-200); border-radius: var(--radius-md);
  text-decoration: none; color: inherit;
  transition: border-color 0.2s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}
.topic-card::before, .spotlight::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s ease;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(224, 0, 0, 0.07), transparent 45%);
}
.topic-card:hover::before, .spotlight:hover::before { opacity: 1; }
.topic-card:hover { border-color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow-soft); color: inherit; }
.topic-title { grid-column: 1; font-weight: 700; color: var(--black); font-size: var(--text-base); }
.topic-teaser { grid-column: 1; font-size: var(--text-sm); color: var(--grey-600); }
.topic-arrow { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--red); font-weight: 700; transition: transform 0.25s var(--ease-out); }
.topic-card:hover .topic-arrow { transform: translateX(4px); }
.tool-badge {
  display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--red); background: rgba(224, 0, 0, 0.07); border-radius: 4px; padding: 0.1rem 0.4rem; margin-left: 0.3rem; vertical-align: 0.1em;
}

/* Home section blocks */
.section-blocks { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .section-blocks { grid-template-columns: repeat(2, 1fr); } }
.section-block {
  display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow 0.3s ease, transform 0.3s var(--ease-out);
}
.section-block:hover { box-shadow: var(--shadow-card); transform: translateY(-3px); }
.section-block-media { aspect-ratio: 16 / 7; overflow: hidden; }
.section-block-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-out); }
.section-block:hover .section-block-media img { transform: scale(1.04); }
.section-block-body { padding: 1.6rem 1.6rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.section-block .num { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.14em; color: var(--red); }
.section-block h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); margin: 0.4rem 0 0.5rem; }
.section-block-body > p { color: var(--grey-600); margin: 0 0 1rem; font-size: var(--text-sm); }
.section-block ul { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.section-block li { border-top: 1px solid var(--grey-200); }
.section-block li a { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; text-decoration: none; font-weight: 600; font-size: var(--text-sm); }
.section-block li a span:last-child { color: var(--grey-300); transition: transform 0.2s var(--ease-out), color 0.2s; }
.section-block li a:hover span:last-child { color: var(--red); transform: translateX(3px); }
.section-block .btn { margin-top: auto; align-self: flex-start; }

/* ---------- Article ---------- */
.article-head { background: var(--cream); padding: clamp(2rem, 4vw, 3.5rem) 0 1.75rem; }
.article-head-grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .article-head-grid { grid-template-columns: 1.35fr 0.65fr; } }
.article-head-media { margin: 0; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; box-shadow: var(--shadow-soft); }
.article-head-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 899px) { .article-head-media { display: none; } }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: var(--text-xs); color: var(--grey-600); margin-bottom: 1.1rem; }
.breadcrumb a { text-decoration: none; }
.article-title { font-size: var(--text-3xl); line-height: 1.12; margin: 0 0 1rem; max-width: 24ch; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: var(--text-sm); color: var(--grey-600); margin: 0; }
.updated-badge { display: inline-flex; align-items: center; gap: 0.4rem; font-size: var(--text-xs); font-weight: 600; color: var(--ok-fg); background: var(--ok-bg); border-radius: 999px; padding: 0.25rem 0.7rem; }
.updated-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(29, 94, 52, 0.45); } 80%, 100% { box-shadow: 0 0 0 7px rgba(29, 94, 52, 0); } }
.section-nav { display: flex; gap: 0.5rem; margin-top: 1.75rem; overflow-x: auto; padding-bottom: 0.25rem; scrollbar-width: thin; }
.section-nav a {
  flex-shrink: 0; font-size: var(--text-xs); font-weight: 600; text-decoration: none;
  padding: 0.5rem 0.9rem; border-radius: 999px; border: 1px solid var(--grey-300); background: var(--white); color: var(--ink);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.section-nav a:hover { border-color: var(--ink); color: var(--black); }
.section-nav a.active { background: var(--black); border-color: var(--black); color: var(--white); }

.article-section { padding-top: clamp(2rem, 4vw, 3rem); }
.article-body { max-width: var(--readw); }
.article-body > p, .article-body li { font-size: var(--text-base); }
.article-body p { margin: 0 0 1.15rem; }
.article-body h2 { font-family: var(--font-sans); font-weight: 700; font-size: var(--text-xl); margin: 2.75rem 0 0.9rem; letter-spacing: -0.01em; }
.article-body h3 { font-size: var(--text-lg); font-weight: 700; margin: 1.75rem 0 0.6rem; }
.article-body ul, .article-body ol:not(.timeline) { padding-left: 1.3rem; margin: 0 0 1.25rem; }
.article-body li { margin-bottom: 0.45rem; }
.article-body li::marker { color: var(--red); }
.article-body a:not(.btn):not(.topic-card) { color: var(--black); text-decoration: underline; text-decoration-color: var(--red); }
.article-body a:not(.btn):not(.topic-card):hover { color: var(--red); }
.callout {
  position: relative; background: var(--cream); border-left: 3px solid var(--red);
  border-radius: 0 var(--radius-md) var(--radius-md) 0; padding: 1.15rem 1.35rem; margin: 1.75rem 0;
  font-size: var(--text-base);
}
.callout strong:first-child { color: var(--black); }
.disclaimer { font-size: var(--text-xs); color: var(--grey-600); background: var(--grey-100); border-radius: var(--radius-md); padding: 1rem 1.2rem; margin-top: 2.5rem; }
.result-note { font-size: var(--text-xs); color: var(--grey-600); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1.5rem 0 1.75rem; border: 1px solid var(--grey-200); border-radius: var(--radius-md); background: var(--white); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); min-width: 34rem; }
.data-table th, .data-table td { padding: 0.75rem 0.9rem; text-align: left; border-bottom: 1px solid var(--grey-200); vertical-align: top; }
.data-table th { background: var(--cream); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--black); }
.data-table tbody tr { transition: background-color 0.15s; }
.data-table tbody tr:hover { background: var(--grey-100); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table caption { caption-side: bottom; text-align: left; font-size: var(--text-xs); color: var(--grey-600); padding: 0.65rem 0.9rem; }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 1.75rem 0 2rem; counter-reset: step; }
.timeline > li { position: relative; padding: 0 0 1.75rem 3.4rem; margin: 0; counter-increment: step; }
.timeline > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--black); color: var(--white);
  display: grid; place-items: center; font-weight: 700; font-size: var(--text-sm);
}
.timeline > li::after { content: ""; position: absolute; left: calc(1.15rem - 1px); top: 2.6rem; bottom: 0.3rem; width: 2px; background: linear-gradient(var(--grey-300), var(--grey-200)); }
.timeline > li:last-child::after { display: none; }
.timeline .when { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); }
.timeline h3 { margin: 0.25rem 0 0.4rem !important; }
.timeline p { margin-bottom: 0.5rem !important; }

/* FAQ accordion */
.faq-list { border-top: 1px solid var(--grey-200); margin-bottom: 1rem; }
.faq-item { border-bottom: 1px solid var(--grey-200); }
.faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.1rem 0; cursor: pointer; list-style: none; font-weight: 700; color: var(--black); font-size: var(--text-base);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex-shrink: 0; width: 1.8rem; height: 1.8rem; display: grid; place-items: center;
  border: 1px solid var(--grey-300); border-radius: 50%; font-weight: 500; color: var(--red);
  transition: transform 0.3s var(--ease-out), background-color 0.2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); background: var(--cream); }
.faq-answer p { margin: 0 0 1.1rem; color: var(--ink); }
.faq-item::details-content { block-size: 0; overflow: hidden; transition: block-size 0.35s var(--ease-out), content-visibility 0.35s allow-discrete; }
.faq-item[open]::details-content { block-size: auto; }
@supports (interpolate-size: allow-keywords) { :root { interpolate-size: allow-keywords; } }

/* Related */
.related-section { background: var(--cream); padding: clamp(2.5rem, 5vw, 4rem) 0; }
.related-title { font-family: var(--font-display); font-weight: 400; font-size: var(--text-2xl); margin: 0 0 1.5rem; }

/* ---------- Calculators ---------- */
.calc {
  position: relative; isolation: isolate;
  background: var(--white); border: 1px solid var(--grey-300); border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem); margin: 2rem 0 2.25rem; box-shadow: var(--shadow-soft);
}
/* "Border beam": a light sweeps around the frame while the user interacts with the tool. */
.calc::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from var(--beam, 0deg), transparent 0 70%, var(--red) 80%, var(--sand) 88%, transparent 96%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity 0.4s ease;
}
.calc:focus-within::before, .calc:hover::before { opacity: 1; animation: beam 4s linear infinite; }
@property --beam { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes beam { to { --beam: 360deg; } }
.calc-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.25rem; }
.calc-head h3 { margin: 0 !important; font-size: var(--text-xl); font-family: var(--font-display); font-weight: 400; }
.calc-sub { color: var(--grey-600); font-size: var(--text-sm); margin: 0 0 1.4rem !important; }
.calc-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.calc .field { margin-bottom: 0; }
@media (min-width: 620px) { .calc-grid { grid-template-columns: 1fr 1fr; } }
.calc-results { margin-top: 1.5rem; background: var(--cream); border-radius: var(--radius-md); padding: 1.1rem 1.25rem; }
.result-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--grey-300); font-size: var(--text-sm); }
.result-row:last-child { border-bottom: 0; }
.result-row > span:last-child { font-weight: 700; color: var(--black); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.result-row.total { border-top: 2px solid var(--black); border-bottom: 0; margin-top: 0.4rem; padding-top: 0.8rem; font-size: var(--text-base); }
.result-row.total span { font-weight: 800; color: var(--black); }
.result-row.highlight > span:last-child { color: var(--red); }
.result-row [data-out] { transition: color 0.3s; }
.result-row .flash { color: var(--red); }
.result-alert { margin-top: 0.75rem; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: var(--err-bg); color: var(--err-fg); font-size: var(--text-sm); font-weight: 600; }
.result-alert.ok { background: var(--ok-bg); color: var(--ok-fg); }
.result-alert:empty { display: none; }
.calc-bars { display: grid; gap: 0.75rem; margin: 0.25rem 0 1rem; }
.calc-bar-label { display: flex; justify-content: space-between; font-size: var(--text-xs); font-weight: 600; margin-bottom: 0.3rem; }
.calc-bar-track { height: 10px; background: var(--white); border-radius: 999px; overflow: hidden; border: 1px solid var(--grey-200); }
.calc-bar-fill { height: 100%; border-radius: 999px; background: var(--ink); transition: width 0.5s var(--ease-out); }
.calc-bar-fill.accent { background: var(--red); }

/* Quiz */
.quiz-q { border: 1px solid var(--grey-200); border-radius: var(--radius-md); padding: 1rem 1.1rem; margin: 0 0 0.75rem; background: var(--white); transition: border-color 0.2s, background-color 0.2s; }
.quiz-q:has(input:checked) { border-color: var(--grey-300); }
.quiz-q.weak { border-color: var(--red); background: #fffafa; }
.quiz-q legend { font-weight: 700; color: var(--black); font-size: var(--text-base); padding: 0; margin-bottom: 0.7rem; float: left; width: 100%; }
.quiz-q .opts { clear: both; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.quiz-q label { display: inline-flex; align-items: center; gap: 0.5rem; border: 1px solid var(--grey-300); border-radius: 999px; padding: 0.45rem 0.9rem; font-size: var(--text-sm); font-weight: 500; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.quiz-q label:hover { border-color: var(--ink); }
.quiz-q label:has(input:checked) { border-color: var(--black); background: var(--black); color: var(--white); }
.quiz-q input { accent-color: var(--red); }
.quiz-q .hint { font-size: var(--text-sm); color: var(--err-fg); margin: 0.7rem 0 0 !important; display: none; }
.quiz-q.weak .hint { display: block; animation: drop-in 0.3s var(--ease-out); }
.quiz-score { font-family: var(--font-display); font-size: var(--text-4xl); color: var(--black); line-height: 1; }
.quiz-verdict { font-size: var(--text-lg); font-weight: 700; margin: 0.6rem 0 0.3rem !important; }

/* ---------- Contact / lead form ---------- */
.contact-section { background: var(--white); }
.contact-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 0.9fr 1.1fr; } }
.trust-card { background: var(--black); color: var(--white); border-radius: var(--radius-lg); padding: clamp(1.75rem, 4vw, 2.75rem); position: relative; overflow: hidden; }
.trust-card::after { content: ""; position: absolute; right: -4rem; bottom: -4rem; width: 14rem; height: 14rem; border-radius: 50%; background: radial-gradient(circle, rgba(224, 0, 0, 0.35), transparent 70%); }
.trust-logo { width: min(240px, 80%); height: auto; margin-bottom: 1.75rem; }
.trust-card h2 { color: var(--white); font-family: var(--font-display); font-weight: 400; font-size: var(--text-2xl); margin: 0 0 1rem; }
.trust-card p { color: #d4d4d4; }
.trust-list { list-style: none; margin: 1.5rem 0 0; padding: 0; position: relative; z-index: 1; }
.trust-list li { display: flex; gap: 0.75rem; padding: 0.55rem 0; border-top: 1px solid rgba(255, 255, 255, 0.12); color: #ececec; font-size: var(--text-sm); }
.trust-list li::before { content: "✓"; color: var(--red); font-weight: 700; }
.lead-form { background: var(--white); border: 1px solid var(--grey-200); border-radius: var(--radius-lg); padding: clamp(1.5rem, 3.5vw, 2.25rem); box-shadow: var(--shadow-card); }
.broker-card { display: flex; gap: 1rem; align-items: center; margin: 1.25rem 0 1.5rem; padding: 0.9rem 1rem; background: var(--cream); border: 1px solid var(--cream-deep); border-left: 3px solid var(--red); border-radius: var(--radius-md); }
.broker-card picture { flex: none; display: block; line-height: 0; }
.broker-photo { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; display: block; box-shadow: 0 0 0 3px var(--white), 0 0 0 4px var(--cream-deep); }
.broker-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.broker-kicker { font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--red); }
.broker-name { font-family: var(--font-display); font-size: var(--text-lg); color: var(--black); text-decoration: none; line-height: 1.2; }
.broker-name:hover { color: var(--red); }
.broker-role, .broker-badges { font-size: var(--text-sm); color: var(--ink); }
.broker-badges { color: var(--grey-600); font-size: var(--text-xs); }
.broker-contact { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin-top: 0.3rem; font-size: var(--text-sm); font-weight: 600; }
.broker-contact a { color: var(--black); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; overflow-wrap: anywhere; }
@media (max-width: 420px) { .broker-card { align-items: flex-start; } .broker-photo { width: 64px; height: 64px; } }
.lead-form h3 { margin: 0 0 0.4rem; font-family: var(--font-display); font-weight: 400; font-size: var(--text-xl); }
.lead-form .sub { color: var(--grey-600); font-size: var(--text-sm); margin: 0 0 1.4rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--black); margin-bottom: 0.35rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--touch); padding: 0.65rem 0.85rem;
  border: 1px solid var(--grey-300); border-radius: var(--radius-sm); background: var(--white);
  font: inherit; font-size: var(--text-base); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--black); box-shadow: 0 0 0 3px rgba(224, 0, 0, 0.12); }
.field small { display: block; font-size: var(--text-xs); color: var(--grey-600); margin-top: 0.3rem; }
.field.invalid input, .field.invalid textarea { border-color: var(--red); }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.hp-field { position: absolute; left: -9999px; top: -9999px; }
.consent { display: flex; gap: 0.65rem; align-items: flex-start; font-size: var(--text-xs); color: var(--grey-600); margin: 0.25rem 0 1.25rem; line-height: 1.5; cursor: pointer; }
.consent input { margin-top: 0.15rem; width: 1.1rem; height: 1.1rem; flex-shrink: 0; accent-color: var(--red); }
.consent.invalid span { color: var(--err-fg); }
.form-status { display: none; margin-top: 1rem; padding: 0.8rem 1rem; border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 600; }
.form-status.show { display: block; animation: drop-in 0.25s var(--ease-out); }
.form-status.ok { background: var(--ok-bg); color: var(--ok-fg); }
.form-status.err { background: var(--err-bg); color: var(--err-fg); }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: #c9c9c9; padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem; font-size: var(--text-sm); }
.footer-grid { display: grid; gap: 2.5rem; }
@media (min-width: 1040px) { .footer-grid { grid-template-columns: 0.85fr 2.15fr; } }
.footer-name { font-family: var(--font-display); font-size: 1.5rem; color: var(--white); text-decoration: none; }
.footer-brand p { color: #a8a8a8; max-width: 34ch; margin: 1rem 0; }
.footer-logo img { width: 200px; height: auto; opacity: 0.9; transition: opacity 0.2s; }
.footer-logo:hover img { opacity: 1; }
.footer-cols { display: grid; gap: 1.75rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer-h { color: var(--white); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 0.9rem; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin-bottom: 0.5rem; }
.site-footer a { color: #d6d6d6; text-decoration: none; }
.site-footer a:hover { color: var(--white); }
.site-footer .btn--primary { color: var(--white); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; border-top: 1px solid #2a2b2b; margin-top: 2.5rem; padding-top: 1.25rem; font-size: var(--text-xs); color: #8f8f8f; }
.footer-bottom p { margin: 0; }
.footer-links { display: flex; gap: 1.25rem; }

/* Sticky mobile CTA */
/* Cookie consent (Loi 25) */
.cookie-consent { position: fixed; z-index: 120; left: 1rem; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); max-width: 30rem; background: var(--white); color: var(--ink); border: 1px solid var(--grey-200); border-top: 3px solid var(--red); border-radius: var(--radius-lg); box-shadow: 0 24px 60px -20px rgba(21, 22, 22, 0.45); padding: 1.25rem 1.25rem 1.1rem; opacity: 0; transform: translateY(1rem); transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out); }
.cookie-consent.is-open { opacity: 1; transform: none; }
.cookie-consent-title { margin: 0 0 0.35rem; font-family: var(--font-display); font-size: var(--text-lg); color: var(--black); }
.cookie-consent-text { margin: 0 0 1rem; font-size: var(--text-sm); line-height: 1.55; }
.cookie-consent-text a { color: var(--black); text-decoration-color: var(--red); text-underline-offset: 3px; white-space: nowrap; }
.cookie-consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.cookie-consent-actions .btn { width: 100%; justify-content: center; }
@media (max-width: 560px) { .cookie-consent { left: 0; right: 0; bottom: 0; max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .cookie-consent { transition: none; } }
@media print { .cookie-consent { display: none !important; } }
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; padding: 0.7rem 1rem calc(0.7rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--grey-200); box-shadow: 0 -10px 24px -18px rgba(0, 0, 0, 0.3); transform: translateY(110%); transition: transform 0.35s var(--ease-out); }
.sticky-cta.show { transform: none; }
@media (min-width: 1040px) { .sticky-cta { display: none; } }
@media (max-width: 1039px) { body { padding-bottom: 4.5rem; } }

/* ---------- Simple pages (privacy, 404) ---------- */
.plain-page { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.plain-page h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-3xl); margin: 0 0 1.25rem; }

/* =====================================================================
   Motion layer (progressive enhancement, see assets/js/motion.js)
   Content is visible by default; motion only applies once JS adds .motion-ready,
   and never under prefers-reduced-motion.
   ===================================================================== */
.motion-ready .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.motion-ready .reveal.is-visible { opacity: 1; transform: none; }
.motion-ready [data-split] .w { display: inline-block; opacity: 0; transform: translateY(0.45em); filter: blur(4px); transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out), filter 0.45s var(--ease-out); transition-delay: calc(var(--i, 0) * 28ms); }
.motion-ready [data-split].is-visible .w { opacity: 1; transform: none; filter: none; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.28s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .motion-ready .reveal, .motion-ready [data-split] .w { opacity: 1 !important; transform: none !important; filter: none !important; }
  .float-card { animation: none !important; }
  @view-transition { navigation: none; }
}

/* ---------- Print ---------- */
@media print {
  .site-header, .sticky-cta, .contact-section, .related-section, .site-footer, .read-progress { display: none !important; }
  .calc::before { display: none; }
}

/* Home trust band */
.trust-band { padding: clamp(3rem, 6vw, 4.5rem) 0; }
.trust-band-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 960px) { .trust-band-grid { grid-template-columns: 0.9fr 1.1fr; } }
.trust-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.trust-points li { border-top: 1px solid rgba(255, 255, 255, 0.15); padding-top: 1rem; display: grid; gap: 0.25rem; }
.trust-points b { color: var(--white); font-size: var(--text-base); }
.trust-points span { color: #bdbdbd; font-size: var(--text-sm); }

@media (max-width: 560px) {
  .hero-stats { gap: 0.75rem; }
  .hero-stats b { font-size: 1.15rem; letter-spacing: -0.02em; }
}
