/* Patromnia — page de lancement « cosmos ».
   Jetons repris de l'application (app/static/patrimoine.css, préfixe --p-).
   Aucune ressource externe : la CSP du conteneur n'autorise que 'self'. */
:root {
  color-scheme: dark;
  --bg: #050810;
  --bg-deep: #0a0e1a;
  --surface: rgba(17, 24, 39, 0.72);
  --surface-solid: #111827;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --accent-text: #60a5fa;
  --border: rgba(59, 130, 246, 0.15);
  --border-strong: rgba(59, 130, 246, 0.3);
  --c-budget: #3b82f6;
  --c-invest: #10b981;
  --c-prev: #8b5cf6;
  --c-biens: #f59e0b;
  --c-crypto: #ef4444;
  --c-immo: #06b6d4;
  --c-hist: #60a5fa;
  --grad-blue: linear-gradient(135deg, #3b82f6, #1d4ed8);
  --font: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Serif de patrimoine : elle donne le ton « banque privée » sans police distante. */
  --font-brand: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Hoefler Text", Garamond, Georgia, "Times New Roman", serif;
  --vh: 1vh;
  --logo-size: 150px;
  --word-size: 96px;
  --brand-gap: 40px;
  --tag-gap: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
h1, h2, p { margin: 0; }
sup { font-size: 0.62em; line-height: 0; }
a { color: inherit; }
.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;
}

/* ── Fond animé ─────────────────────────────────────────── */
#cosmos {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block;
  background: radial-gradient(ellipse at 50% 40%, #0d1428 0%, var(--bg) 70%);
}
#labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.chip {
  position: absolute; left: 0; top: 0;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.28rem 0.7rem 0.28rem 0.55rem;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(8, 12, 24, 0.82);
  color: var(--text);
  font-size: 0.74rem; font-weight: 500; letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--chip, #3b82f6); box-shadow: 0 0 10px var(--chip, #3b82f6); }
.chip.g-budget { --chip: var(--c-budget); }
.chip.g-invest { --chip: var(--c-invest); }
.chip.g-crypto { --chip: var(--c-crypto); }
.chip.g-prev { --chip: var(--c-prev); }
.chip.g-immo { --chip: var(--c-immo); }
.chip.g-biens { --chip: var(--c-biens); }

#scroll-progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 30; }
#scroll-progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--c-budget), var(--c-invest), var(--c-prev), var(--c-immo));
}

/* ── En-tête ─────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  background: linear-gradient(180deg, rgba(5, 8, 16, 0.85), rgba(5, 8, 16, 0));
}
.topbar-brand {
  text-decoration: none; font-family: var(--font-brand); font-weight: 500;
  font-size: 1.02rem; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--text);
}
.mini-logo {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--grad-blue); color: #fff; font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
}
.topbar-cta {
  text-decoration: none; font-size: 0.82rem; font-weight: 600;
  padding: 0.5rem 0.95rem; border-radius: 9999px;
  border: 1px solid var(--border-strong); background: rgba(17, 24, 39, 0.6);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.topbar-cta:hover, .topbar-cta:focus-visible { border-color: var(--c-budget); background: rgba(59, 130, 246, 0.15); }
.topbar-actions { display: flex; align-items: center; gap: 0.65rem; }
.topbar-login { display: inline-flex; align-items: center; gap: 0.75rem; white-space: nowrap; border-color: rgba(147, 197, 253, 0.45); color: #e2eeff; }
.topbar-login span { color: var(--accent-text); }
@media (max-width: 540px) { .topbar-news { display: none; } }

/* ── Scènes ──────────────────────────────────────────────── */
main { position: relative; z-index: 2; }
.scene {
  min-height: calc(var(--vh) * 100);
  display: flex; align-items: center;
  padding: 5.5rem clamp(1.25rem, 6vw, 5rem) 3rem;
}
.side-left { justify-content: flex-start; }
.side-right { justify-content: flex-end; }
.scene-hero, .scene-center, .scene-finale { justify-content: center; text-align: center; }

.kicker {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 1.4rem;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-text); box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16); }
.grad {
  background: linear-gradient(120deg, #93c5fd 0%, #60a5fa 35%, #a78bfa 70%, #22d3ee 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-copy { max-width: 46rem; }
h1 {
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 1.04; font-weight: 800; letter-spacing: -0.035em;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 40px rgba(5, 8, 16, 0.9);
}
.lead { color: var(--text-2); font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 38rem; margin: 0 auto; text-shadow: 0 0 24px rgba(5, 8, 16, 0.95); }
.scroll-hint {
  margin-top: 3rem; display: inline-flex; align-items: center; gap: 0.75rem;
  color: var(--text-3); font-size: 0.8rem; letter-spacing: 0.06em;
}
.mouse { width: 20px; height: 32px; border: 1.5px solid var(--text-3); border-radius: 12px; position: relative; }
.mouse::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px;
  border-radius: 2px; background: var(--accent-text); animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

.card {
  --accent: var(--c-budget);
  position: relative; max-width: 27rem;
  padding: 1.75rem 1.75rem 1.5rem;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(13, 19, 36, 0.93), rgba(9, 13, 26, 0.88));
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 85%);
}
.card::after {
  content: ""; position: absolute; width: 180px; height: 180px; right: -60px; top: -80px;
  background: radial-gradient(circle, var(--accent), transparent 70%); opacity: 0.18; pointer-events: none;
}
.accent-budget { --accent: var(--c-budget); }
.accent-invest { --accent: var(--c-invest); }
.accent-prev { --accent: var(--c-prev); }
.accent-immo { --accent: var(--c-immo); }
.accent-sante { --accent: var(--c-biens); }
.accent-hist { --accent: var(--c-hist); }
.card-kicker {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.8rem;
}
.card h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 0.8rem; }
.card p { color: var(--text-2); font-size: 0.97rem; }
.tags { list-style: none; margin: 1.2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags li {
  font-size: 0.74rem; color: var(--text); padding: 0.28rem 0.65rem; border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.16); background: rgba(5, 8, 16, 0.45);
}

.converge-copy { max-width: 40rem; }
.converge-copy h2 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; margin-bottom: 1.2rem; text-shadow: 0 0 40px rgba(5, 8, 16, 0.9); }
.converge-copy p { color: var(--text-2); font-size: 1.1rem; text-shadow: 0 0 24px rgba(5, 8, 16, 0.95); }

/* Animation d'apparition, uniquement si le script tourne */
.js .card, .js .converge-copy, .js .hero-copy { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .side-right .card { transform: translate(26px, 16px); }
.js .side-left .card { transform: translate(-26px, 16px); }
.js .is-visible .card, .js .is-visible .converge-copy, .js .is-visible .hero-copy { opacity: 1; transform: none; }

/* ── Finale : logo et mot en pleine page ─────────────────── */
.scene-finale { padding: 0; min-height: calc(var(--vh) * 200); }
.brand { display: flex; flex-direction: column; align-items: center; }
.brand-logo {
  width: var(--logo-size); height: var(--logo-size);
  border-radius: calc(var(--logo-size) * 0.3);
  background: var(--grad-blue);
  display: grid; place-items: center;
  box-shadow: 0 0 calc(var(--logo-size) * 0.5) rgba(59, 130, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.brand-logo span { color: #fff; font-weight: 800; font-size: calc(var(--logo-size) * 0.6); line-height: 1; }
.wordmark {
  font-family: var(--font-brand);
  font-size: var(--word-size); line-height: 1; height: var(--word-size);
  font-weight: 500; text-transform: uppercase; letter-spacing: 0.18em;
  text-indent: 0.18em;                   /* compense la lettre-espace finale */
  color: var(--text);
}
.tagline { margin-top: var(--tag-gap); height: 28px; line-height: 28px; color: var(--text-2); font-size: clamp(1rem, 2vw, 1.25rem); }
.js .wordmark { opacity: var(--brand-alpha, 0); }
.js .tagline { opacity: calc(var(--brand-alpha, 0) * (1 - var(--join, 0))); }
.js .brand {
  transform: translateY(calc(var(--join, 0) * -22px)) scale(calc(1 - var(--join, 0) * 0.08));
  transform-origin: 50% 40%;
}


/* ── Inscription ─────────────────────────────────────────── */
.join {
  position: relative; z-index: 2;
  min-height: calc(var(--vh) * 100);
  display: flex; align-items: center; justify-content: center;
  padding: 6rem clamp(1.25rem, 6vw, 5rem) 4rem;
  background: linear-gradient(180deg, rgba(5, 8, 16, 0) 0%, rgba(5, 8, 16, 0.78) 30%, rgba(5, 8, 16, 0.92) 100%);
}
.join-card {
  width: 100%; max-width: 36rem; text-align: center;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(15, 22, 41, 0.95), rgba(8, 12, 24, 0.93));
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(59, 130, 246, 0.12);
}
.join-card h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 0.75rem; }
.join-lead { color: var(--text-2); margin-bottom: 1.75rem; }
.join-form { text-align: left; }
.field-row { display: flex; gap: 0.6rem; }
.join-form input[type="email"] {
  flex: 1; min-width: 0;
  font: inherit; font-size: 1rem; color: var(--text);
  padding: 0.85rem 1rem; border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(5, 8, 16, 0.7);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.join-form input[type="email"]::placeholder { color: var(--text-3); }
.join-form input[type="email"]:focus { outline: none; border-color: var(--c-budget); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); }
.join-form button {
  font: inherit; font-weight: 700; font-size: 0.95rem; color: #fff; cursor: pointer;
  padding: 0.85rem 1.2rem; border: 0; border-radius: 12px;
  background: var(--grad-blue);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}
.join-form button:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(59, 130, 246, 0.45); }
.join-form button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.join-form button[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.join-form button.ghost { background: transparent; border: 1px solid rgba(148, 163, 184, 0.3); box-shadow: none; color: var(--text-2); }
.consent { display: flex; gap: 0.65rem; align-items: flex-start; margin-top: 1rem; color: var(--text-2); font-size: 0.84rem; line-height: 1.5; cursor: pointer; }
.consent input { margin-top: 0.2rem; width: 1.05rem; height: 1.05rem; accent-color: var(--c-budget); flex: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.4rem; margin-top: 0.9rem; font-size: 0.9rem; font-weight: 500; }
.form-status.ok { color: #34d399; }
.form-status.err { color: #f87171; }
.notice { margin-top: 1.25rem; color: var(--text-3); font-size: 0.78rem; line-height: 1.55; }
.unsubscribe { margin-top: 1rem; text-align: left; }
.unsubscribe summary { cursor: pointer; color: var(--text-3); font-size: 0.78rem; text-align: center; list-style: none; }
.unsubscribe summary::-webkit-details-marker { display: none; }
.unsubscribe summary:hover { color: var(--text-2); }
.unsubscribe[open] summary { margin-bottom: 0.8rem; }
.join-form.compact input[type="email"] { padding: 0.6rem 0.8rem; font-size: 0.9rem; }
.join-form.compact button { padding: 0.6rem 0.9rem; font-size: 0.85rem; }

.site-footer {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.25rem clamp(1.25rem, 6vw, 5rem) 1.75rem;
  color: var(--text-3); font-size: 0.78rem;
  background: rgba(5, 8, 16, 0.94);
  border-top: 1px solid rgba(59, 130, 246, 0.08);
}

/* ── Adaptatif ───────────────────────────────────────────── */
@media (max-width: 760px) {
  .scene { align-items: flex-end; padding-bottom: 2.25rem; }
  .scene-hero, .scene-center, .scene-finale { align-items: center; }
  .side-left, .side-right { justify-content: center; }
  .card { max-width: none; padding: 1.35rem 1.3rem 1.2rem; }
  .field-row { flex-direction: column; }
  .join-form button { width: 100%; }
  .topbar-cta { font-size: 0.74rem; padding: 0.42rem 0.75rem; }
  .chip { font-size: 0.66rem; padding: 0.2rem 0.55rem 0.2rem 0.45rem; }
  .chip.minor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .card, .js .converge-copy, .js .hero-copy { transition: none; opacity: 1; transform: none; }
  .mouse::after { animation: none; }
}

/* Pages de confirmation (sans JavaScript) */
.join.solo { min-height: 100vh; background: radial-gradient(ellipse at 50% 40%, #0d1428 0%, var(--bg) 70%); }
.solo-title { font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.025em; margin-bottom: 0.75rem; }

/* Voile sombre derrière les textes centrés, pour rester lisible sur le cosmos */
.scene { position: relative; }
.scene-hero::before, .scene-center::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 58% 42% at 50% 50%, rgba(5, 8, 16, 0.9) 0%, rgba(5, 8, 16, 0.55) 55%, rgba(5, 8, 16, 0) 78%);
}
.hero-copy, .converge-copy { position: relative; }

/* ── Scène de convergence : volontairement très longue, pour que la marque
      arrive presque sans qu'on s'en rende compte ─────────────────────────── */
.scene-quiet { min-height: calc(var(--vh) * 300); align-items: flex-start; padding-top: 28vh; }
.quiet-copy { max-width: 34rem; text-align: center; position: relative; }
.quiet-copy h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.quiet-copy p { color: var(--text-2); font-size: 1rem; }
.js .quiet-copy { opacity: 0; transform: translateY(18px); transition: opacity 1.4s ease, transform 1.4s ease; }
.js .is-visible .quiet-copy { opacity: 1; transform: none; }
.scene-quiet::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 22% at 50% 30%, rgba(5, 8, 16, 0.82) 0%, rgba(5, 8, 16, 0) 75%);
}

@media (max-width: 760px) {
  .scene-quiet { min-height: calc(var(--vh) * 260); padding-top: 22vh; }
  .scene-finale { min-height: calc(var(--vh) * 170); }
}
@media (prefers-reduced-motion: reduce) {
  .js .quiet-copy { opacity: 1; transform: none; transition: none; }
  .js .brand { transform: none; }
}


/* ── Repères de confiance, sous le titre ─────────────────────────────────── */
.trust-row {
  list-style: none; margin: 2rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 0.75rem;
}
.trust-row li {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.8rem; border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(8, 12, 24, 0.75);
  color: var(--text-2); font-size: 0.82rem;
}
.dot.ch { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.14); }
.dot.home { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14); }
.dot.up { background: #60a5fa; box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14); }

/* ── Scène « Vos données » : deux options côte à côte ─────────────────────── */
.scene-duo { align-items: center; }
.duo-copy { max-width: 62rem; text-align: center; position: relative; }
.duo-copy h2 {
  font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; line-height: 1.1;
  letter-spacing: -0.03em; margin-bottom: 1rem;
  text-shadow: 0 0 40px rgba(5, 8, 16, 0.9);
}
.duo-lead { color: var(--text-2); max-width: 44rem; margin: 0 auto 2rem; font-size: 1.02rem; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; text-align: left; }
.duo-card {
  position: relative; overflow: hidden;
  padding: 1.5rem 1.4rem 1.3rem;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(13, 19, 36, 0.95), rgba(9, 13, 26, 0.9));
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.duo-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--duo-accent), transparent 85%);
}
.duo-cloud { --duo-accent: #f87171; }
.duo-home { --duo-accent: #34d399; }
.duo-kicker {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--duo-accent); margin-bottom: 0.7rem;
}
.duo-card h3 { font-size: 1.12rem; line-height: 1.3; margin-bottom: 0.7rem; letter-spacing: -0.015em; }
.duo-card p { color: var(--text-2); font-size: 0.94rem; }
.duo-card strong { color: var(--text); font-weight: 600; }
.duo-tags { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.duo-tags li {
  font-size: 0.72rem; color: var(--text); padding: 0.25rem 0.6rem; border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.16); background: rgba(5, 8, 16, 0.5);
}
.duo-foot {
  margin: 1.4rem auto 0; max-width: 48rem;
  color: var(--text-2); font-size: 0.9rem; line-height: 1.6; text-align: left;
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.85rem 1.1rem; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(8, 12, 24, 0.7);
}
.duo-foot .dot { margin-top: 0.42rem; flex: none; }
.duo-foot span:last-child { flex: 1; }
.js .duo-copy { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .is-visible .duo-copy { opacity: 1; transform: none; }

.chip.g-anchor { border-color: rgba(148, 163, 184, 0.3); }

@media (max-width: 860px) {
  .duo { grid-template-columns: 1fr; }
  .duo-copy { max-width: 34rem; }
  .trust-row li { font-size: 0.74rem; padding: 0.28rem 0.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .js .duo-copy { opacity: 1; transform: none; transition: none; }
}
