/* ==========================================================================
   Thomas Menetrier – Conseiller en gestion de patrimoine
   Design system partagé — v7 : palette Quintésens, premium moderne, fluide
   ========================================================================== */

:root {
  /* Palette — blanc pur + encre ardoise + bleu indigo Quintésens (accent unique) */
  --cream: #ffffff;
  --cream-soft: #f5f7fb;
  --cream-softer: #eaeef8;
  --ink: #10131e;
  --ink-soft: #4b5568;
  --ink-faint: #8890a1;
  --gold: #1930a3;
  --gold-deep: #12237a;
  --gold-light: #c3cef7;
  --espresso: #1930a3;
  --espresso-light: #2540bb;
  --espresso-lighter: #3752d6;
  --white: #ffffff;
  --line: rgba(16, 19, 30, 0.08);
  --line-dark: rgba(255, 255, 255, 0.16);
  --danger: #c0293b;
  --danger-bg: #fdecee;

  /* Typographie */
  --font-display: 'Clash Display', 'Satoshi', sans-serif;
  --font-body: 'Satoshi', sans-serif;

  /* Échelle */
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-pill: 999px;
  --shadow-soft: 0 10px 28px -14px rgba(25, 48, 163, 0.22);
  --shadow-card: 0 16px 38px -18px rgba(16, 19, 30, 0.14);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.6rem, 5.2vw, 4.4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1.03; }
h2 { font-size: clamp(1.9rem, 3.2vw, 2.7rem); font-weight: 600; }
h3 { font-size: clamp(1.15rem, 1.5vw, 1.4rem); font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-soft); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { padding: 0; margin: 0; list-style: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 48px 0; }
@media (max-width: 720px) { section { padding: 28px 0; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: '';
  width: 22px; height: 1px;
  background: var(--gold-deep);
}
.on-dark .eyebrow { color: var(--gold-light); }
.on-dark .eyebrow::before { background: var(--gold-light); }

.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  max-width: 640px;
  line-height: 1.6;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px -14px rgba(20,19,15,0.35); }

.on-dark .btn-primary {
  background: var(--white);
  color: var(--ink);
}
.on-dark .btn-primary:hover { box-shadow: 0 16px 32px -14px rgba(0,0,0,0.45); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); }

.on-dark .btn-ghost {
  color: var(--cream);
  border-color: var(--line-dark);
}
.on-dark .btn-ghost:hover { border-color: var(--gold-light); color: var(--gold-light); }

.btn-light {
  background: var(--white);
  color: var(--ink);
}
.btn-light:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.btn-block { width: 100%; }
.btn small { font-weight: 500; opacity: .8; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -18px rgba(16, 19, 30, 0.25);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  transition: min-height 0.3s ease;
}
.site-header.is-scrolled .container { min-height: 68px; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; }
.brand-role { font-size: 0.72rem; color: var(--ink-soft); }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav > ul { display: flex; align-items: center; gap: 2px; }
.main-nav a.nav-link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.main-nav a.nav-link:hover { background: var(--cream-soft); color: var(--gold-deep); }

.nav-item { position: relative; }
.nav-item .chevron { width: 9px; height: 9px; margin-top: -2px; opacity: .55; transition: transform .2s ease; }
.nav-item:hover .chevron { transform: rotate(180deg); }

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-inner {
  min-width: 240px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 10px;
}
.dropdown-inner a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-s);
  font-size: 0.9rem;
  color: var(--ink);
}
.dropdown-inner a:hover { background: var(--cream-soft); color: var(--gold-deep); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.header-actions .btn { padding: 12px 22px; font-size: 0.88rem; }

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 44px; height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
}
.menu-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 980px) {
  .main-nav, .header-actions .btn-ghost { display: none; }
  .menu-toggle { display: flex; }
}
@media (max-width: 560px) {
  .brand-role { display: none; }
  .brand-text { min-width: 0; }
  .brand-name { font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
  .header-actions { gap: 6px; }
  .header-actions .btn-primary { padding: 9px 13px; font-size: 0.76rem; }
}

/* ---------- Validation de formulaire ---------- */
.field-error {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 6px;
}
.field-error.show { display: flex; }
input.is-invalid, textarea.is-invalid {
  border-color: var(--danger) !important;
  background: var(--danger-bg);
}
.quiz-card input.is-invalid { border-color: var(--danger) !important; background: rgba(192,41,59,0.12); }
.quiz-card .field-error.show { color: #ff9daa; }

/* ---------- Parcours (mini timeline verticale) ---------- */
.parcours-track { display: flex; flex-direction: column; margin-top: 36px; }
.parcours-step { display: flex; gap: 16px; padding-bottom: 30px; position: relative; }
.parcours-step:last-child { padding-bottom: 0; }
.parcours-step::before {
  content: '';
  position: absolute;
  left: 5px; top: 22px; bottom: 0;
  width: 1px;
  background: var(--line);
}
.parcours-step:last-child::before { display: none; }
.parcours-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid var(--ink-faint);
  flex-shrink: 0;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.parcours-dot.is-active { background: var(--gold); border-color: var(--gold); }
.parcours-step strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.parcours-step span { font-size: 0.86rem; color: var(--ink-soft); }

/* ---------- Grille deux colonnes responsive ---------- */
.split-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 860px) {
  .split-grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Hero ---------- */
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: end;
}
@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 48px;
  }
  .hero-grid > *:last-child {
    justify-self: center !important;
    max-width: min(300px, 100%);
  }
}

/* ---------- Menu mobile ---------- */
.mobile-panel {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(88vw, 380px);
  height: 100vh;
  background: var(--cream);
  border-left: 1px solid var(--line);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  padding: 24px;
}
.mobile-panel.open { transform: translateX(0); }
.mobile-panel-top { display: flex; justify-content: flex-end; margin-bottom: 20px; }
.mobile-panel .close-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
}
.mobile-panel details { border-bottom: 1px solid var(--line); }
.mobile-panel summary {
  padding: 16px 4px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mobile-panel a.mobile-link {
  display: block;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
}
.mobile-panel .sub-link { padding: 10px 4px 10px 14px; font-weight: 500; font-size: 0.95rem; color: var(--ink-soft); }
.mobile-panel .mobile-actions { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.scrim {
  position: fixed; inset: 0;
  background: rgba(20, 19, 15, 0.4);
  z-index: 190;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.scrim.open { opacity: 1; visibility: visible; }

/* ---------- Sections accentuées (bleu vif — jamais de noir) ---------- */
.on-dark {
  background: linear-gradient(155deg, var(--espresso) 0%, var(--espresso-light) 100%);
  color: var(--cream);
  position: relative;
  overflow: hidden;
}
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--cream); }
.on-dark p { color: rgba(255,255,255,0.72); }
.on-dark .lede { color: rgba(255,255,255,0.78); }

/* Halo dégradé discret — profondeur sans noircir la section */
.on-dark::before {
  content: '';
  position: absolute;
  inset: -20% -10% auto auto;
  width: 60%;
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0) 70%);
}
.on-dark > * { position: relative; z-index: 1; }

/* ---------- Formes abstraites décoratives (dégradés doux) ---------- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 30px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.card-soft {
  background: var(--cream-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 30px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
a.card:hover, a.card-soft:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
}
a.card:hover { box-shadow: 0 22px 44px -20px rgba(25, 48, 163, 0.28); }

.on-dark .card, .on-dark .card-soft {
  background: var(--espresso-light);
  border-color: var(--line-dark);
  box-shadow: none;
}
.on-dark a.card:hover, .on-dark a.card-soft:hover {
  border-color: var(--gold-light);
  background: var(--espresso-lighter);
}
.on-dark .card p, .on-dark .card-soft p { color: rgba(255,255,255,0.68); }

/* ---------- Grilles ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Bande de chiffres (façon "stat blocks" animés) ---------- */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
}
.stat-item { min-width: 130px; }
.stat-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  letter-spacing: -0.02em;
  color: var(--cream);
  line-height: 1.1;
}
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.68); margin-top: 4px; }

/* ---------- Puces d'objectifs (chips) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.chip:hover { border-color: var(--gold); color: var(--gold-deep); background: var(--cream-soft); }

/* ---------- Cartes "pilier" (Financier / Immobilier / Défiscalisation) ---------- */
.pillar-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 34px 30px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.pillar-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--line); }
.pillar-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-s);
  background: var(--cream-soft);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.pillar-icon svg { width: 22px; height: 22px; }

/* ---------- Reveal au scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(.16,.84,.44,1), transform 0.7s cubic-bezier(.16,.84,.44,1);
}
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }
[data-reveal-group] > *:nth-child(1) { transition-delay: 0ms; }
[data-reveal-group] > *:nth-child(2) { transition-delay: 80ms; }
[data-reveal-group] > *:nth-child(3) { transition-delay: 160ms; }
[data-reveal-group] > *:nth-child(4) { transition-delay: 240ms; }
[data-reveal-group].is-visible > * { opacity: 1; transform: translateY(0); }
[data-reveal-group] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(.16,.84,.44,1), transform 0.7s cubic-bezier(.16,.84,.44,1);
}

/* ---------- CTA — carte bleue intégrée dans le fil de la page, jamais un bloc plein cadre ---------- */
.cta-full {
  width: calc(100% - 40px);
  max-width: var(--container);
  margin: 72px auto;
  border-radius: 28px;
  overflow: hidden;
  color: var(--cream);
  padding: 80px 0;
  text-align: center;
}
.cta-full h2 { color: var(--cream); max-width: 22ch; margin-left: auto; margin-right: auto; }
.cta-full p { color: rgba(255,255,255,0.72); max-width: 46ch; margin-left: auto; margin-right: auto; }
.cta-full .btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
@media (max-width: 640px) { .cta-full { padding: 52px 0; margin: 48px auto; border-radius: 20px; } }

/* ancienne classe conservée pour compatibilité, alignée sur le même traitement */
.cta-band { text-align: center; }
.cta-band .btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }

/* ---------- Footer — clair, discret, nettement distinct du CTA ---------- */
.site-footer {
  background: var(--cream);
  color: var(--ink-soft);
  padding: 72px 0 32px;
  border-top: 1px solid var(--line);
}
.site-footer h4 { color: var(--ink); font-size: 0.92rem; margin-bottom: 16px; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--gold-deep); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid li { margin-bottom: 10px; font-size: 0.9rem; }
.footer-brand-name { font-family: var(--font-display); color: var(--ink); font-size: 1.05rem; font-weight: 600; margin-bottom: 10px; }
.footer-legal {
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.76rem;
  color: var(--ink-faint);
}

/* ---------- Accessibilité ---------- */
:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}
.on-dark :focus-visible {
  outline-color: var(--gold-light);
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 300;
  background: var(--ink);
  color: var(--cream);
  padding: 12px 20px;
  border-radius: var(--radius-s);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Utilitaires ---------- */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--cream-soft);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.on-dark .tag { background: var(--espresso-light); border-color: var(--line-dark); color: var(--cream); }

.section-tint { background: var(--cream-soft); }

.section-head { max-width: 680px; margin: 0 0 48px; }
.section-head.text-center { margin-left: auto; margin-right: auto; }

.breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 18px;
}

/* ---------- Bandeau de consentement cookies ---------- */
.cookie-banner {
  display: none;
  flex-direction: column;
  gap: 14px;
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  max-width: 440px;
  z-index: 500;
  background: var(--white);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
}
.cookie-banner.is-visible { display: flex; }
.cookie-banner p { margin: 0; font-size: 0.86rem; line-height: 1.5; color: var(--ink-soft); }
.cookie-banner p a { color: var(--gold-deep); }
.cookie-banner-actions { display: flex; gap: 10px; justify-content: flex-end; }
/* Boutons volontairement identiques (même forme, même couleur, même taille) — recommandation CNIL :
   le refus doit être aussi simple visuellement que l'acceptation, jamais un bouton secondaire discret. */
.cookie-banner-actions .btn {
  padding: 10px 20px;
  font-size: 0.82rem;
  background: var(--ink);
  color: var(--white);
  border: 1.5px solid var(--ink);
  box-shadow: none;
}
.cookie-banner-actions .btn:hover { transform: none; background: var(--gold-deep); border-color: var(--gold-deep); }

.cookie-manage-link {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 400;
  background: transparent;
  color: var(--ink-faint);
  font-size: 0.68rem;
  font-weight: 500;
  padding: 5px 10px;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: none;
  opacity: 0.6;
  cursor: pointer;
}
.cookie-manage-link:hover { color: var(--gold-deep); opacity: 1; }

@media (max-width: 560px) {
  .cookie-banner { left: 12px; right: 12px; bottom: 12px; max-width: none; padding: 18px 20px; }
  .cookie-banner-actions { flex-direction: column-reverse; }
  .cookie-banner-actions .btn { width: 100%; text-align: center; }
  .cookie-manage-link { right: 12px; bottom: 10px; }
}
.breadcrumb a:hover { color: var(--gold-deep); }
