/* ============================================================
   Finances H2O — Couche d'engagement
   ------------------------------------------------------------
   Barre d'aide, fenêtre de sortie, envoi de résultats, parcours.
   Préfixe .en- pour ne jamais entrer en collision.
   Dépend de tokens.css. Respecte prefers-reduced-motion.
   ============================================================ */

:root {
  --en-ease: cubic-bezier(.16,1,.3,1);
}

/* ---------- Boutons partagés ---------- */

.en-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  font-size: .95rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
  border: 1.5px solid var(--color-neutral-200);
  background: var(--color-neutral-50);
  color: var(--color-primary-900);
  transition: transform .3s var(--en-ease), box-shadow .3s var(--en-ease),
              background .3s var(--en-ease), border-color .3s var(--en-ease);
}
.en-btn svg { width: 17px; height: 17px; flex: none; }
.en-btn:hover { transform: translateY(-1px); border-color: var(--color-primary-500);
  box-shadow: 0 10px 26px -12px rgba(15,42,46,.45); }
.en-btn:focus-visible { outline: 2px solid var(--color-accent-600); outline-offset: 3px; }

.en-btn.en-primary {
  background: linear-gradient(120deg, #8a6a2c, #a8853f 60%, #a8853f);
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 30px -12px rgba(138,106,44,.8);
}
.en-btn.en-primary:hover { box-shadow: 0 18px 40px -14px rgba(138,106,44,.9); }

/* ============================================================
   1. BARRE D'AIDE FLOTTANTE
   ============================================================ */

.en-bar {
  position: fixed;
  left: 50%; bottom: 1.1rem;
  transform: translate(-50%, calc(100% + 2rem));
  z-index: 900;
  width: min(680px, calc(100vw - 2rem));
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  padding: .95rem 1.2rem .95rem 1.4rem;
  border-radius: 18px;
  background: rgba(15,42,46,.93);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 20px 50px -18px rgba(0,0,0,.65);
  opacity: 0;
  transition: transform .65s var(--en-ease), opacity .5s var(--en-ease);
}
.en-bar.en-on { transform: translate(-50%, 0); opacity: 1; }

.en-bar-txt { flex: 1; min-width: 190px; line-height: 1.35; }
.en-bar-txt b { display: block; color: #fff; font-size: .95rem; font-weight: 600; }
.en-bar-txt span { display: block; color: #b7bfb8; font-size: .8rem; margin-top: .15rem; }

.en-bar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.en-bar-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.05rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  transition: all .3s var(--en-ease);
}
.en-bar-btn svg { width: 15px; height: 15px; }
.en-bar-btn:hover { background: rgba(255,255,255,.17); transform: translateY(-1px); }
.en-bar-btn.en-primary {
  background: linear-gradient(120deg, #8a6a2c, #a8853f);
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(138,106,44,.75);
}
.en-bar-btn.en-primary:hover { box-shadow: 0 12px 26px -8px rgba(138,106,44,.85); }

.en-bar-x {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: rgba(255,255,255,.5); font-size: 1.5rem; line-height: 1;
  padding: .1rem .3rem; border-radius: 6px;
  transition: color .25s;
}
.en-bar-x:hover { color: #fff; }
.en-bar-x:focus-visible { outline: 2px solid var(--color-accent-500); }

/* ============================================================
   2. FENÊTRE DE SORTIE
   ============================================================ */

.en-modal-fond {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  padding: 1.2rem;
  background: rgba(10,28,31,.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .32s var(--en-ease);
}
.en-modal-fond.en-on { opacity: 1; }

.en-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: 92vh; overflow-y: auto;
  padding: 2.6rem 2.2rem 2rem;
  border-radius: 24px;
  background: var(--color-neutral-50);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.6);
  transform: translateY(18px) scale(.97);
  transition: transform .42s var(--en-ease);
  text-align: center;
}
.en-modal-fond.en-on .en-modal { transform: none; }

.en-modal-x {
  position: absolute; top: .9rem; right: 1rem;
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font-size: 1.7rem; line-height: 1; color: var(--color-neutral-500);
  padding: .2rem .45rem; border-radius: 8px;
  transition: color .25s, background .25s;
}
.en-modal-x:hover { color: var(--color-neutral-900); background: var(--color-neutral-100); }
.en-modal-x:focus-visible { outline: 2px solid var(--color-accent-600); }

.en-modal-tag {
  display: inline-block;
  font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-accent-700);
  background: var(--color-accent-100);
  padding: .32rem .85rem; border-radius: 999px;
  margin-bottom: 1.1rem;
}
.en-modal h2 {
  font-size: clamp(1.4rem, 3.4vw, 1.85rem);
  line-height: 1.22; color: var(--color-primary-900);
  margin: 0 0 .9rem; text-wrap: balance;
}
.en-modal-txt {
  font-size: .97rem; line-height: 1.65; color: var(--color-neutral-700);
  max-width: 46ch; margin: 0 auto 1.7rem;
}
.en-modal-actions {
  display: flex; flex-direction: column; gap: .6rem;
  max-width: 340px; margin: 0 auto 1.4rem;
}
.en-modal-note {
  font-size: .74rem; color: var(--color-neutral-500); line-height: 1.5;
  max-width: 42ch; margin: 0 auto 1rem;
}
.en-modal-plus-tard {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: .85rem; color: var(--color-neutral-500);
  text-decoration: underline; text-underline-offset: 3px;
  padding: .4rem;
}
.en-modal-plus-tard:hover { color: var(--color-neutral-900); }
.en-modal-plus-tard:focus-visible { outline: 2px solid var(--color-accent-600); outline-offset: 2px; }

/* ============================================================
   3. ENVOYEZ-MOI MES RÉSULTATS
   ============================================================ */

.en-resultats {
  display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap;
  padding: 1.5rem 1.7rem;
  border-radius: 18px;
  margin-bottom: var(--space-5);
  background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
  box-shadow: 0 18px 44px -22px rgba(15,42,46,.7);
}
.en-res-txt { flex: 1; min-width: 220px; }
.en-res-txt b { display: block; color: #fff; font-size: 1.05rem; font-weight: 600; }
.en-res-txt span { display: block; color: #b7bfb8; font-size: .88rem; margin-top: .25rem;
  line-height: 1.5; }
.en-res-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.en-res-actions .en-btn {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}
.en-res-actions .en-btn:hover { background: rgba(255,255,255,.18); }
.en-res-actions .en-btn.en-primary {
  background: linear-gradient(120deg, #8a6a2c, #a8853f 60%, #a8853f);
  border-color: transparent;
}

/* ============================================================
   4. PARCOURS SUGGÉRÉ
   ============================================================ */

.en-parcours {
  padding: var(--space-10) 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 0%, rgba(47,111,116,.08), transparent 65%),
    var(--color-neutral-100);
  border-top: 1px solid var(--color-neutral-200);
}
.en-parcours-titre {
  font-size: clamp(1.5rem, 3.4vw, 2rem);
  color: var(--color-primary-900);
  margin: .35rem 0 .6rem;
}
.en-parcours-sous {
  color: var(--color-neutral-700);
  font-size: .97rem; max-width: 56ch; margin-bottom: var(--space-6);
}

.en-suites { display: flex; flex-direction: column; gap: .8rem; }

.en-suite {
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1.15rem 1.4rem;
  border-radius: 16px;
  text-decoration: none;
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-200);
  border-left: 4px solid var(--tone, var(--color-primary-500));
  box-shadow: 0 1px 2px rgba(15,42,46,.04);
  transition: transform .38s var(--en-ease), box-shadow .38s var(--en-ease),
              border-color .38s var(--en-ease);
}
.en-suite:hover {
  transform: translateX(6px);
  box-shadow: 0 16px 38px -20px rgba(15,42,46,.5);
  border-color: var(--tone, var(--color-primary-500));
}
.en-suite:focus-visible { outline: 2px solid var(--color-accent-600); outline-offset: 3px; }

.en-suite-ic {
  width: 46px; height: 46px; flex: none;
  border-radius: 13px;
  display: grid; place-items: center;
  font-size: 1.35rem;
  background: color-mix(in srgb, var(--tone, #2f6f74) 14%, transparent);
}
.en-suite-txt { flex: 1; min-width: 0; }
.en-suite-txt b {
  display: block; font-size: 1.02rem; font-weight: 700;
  color: var(--color-primary-900); margin-bottom: .15rem;
}
.en-suite-txt span {
  display: block; font-size: .88rem; color: var(--color-neutral-700); line-height: 1.5;
}
.en-suite > svg {
  width: 20px; height: 20px; flex: none;
  color: var(--tone, var(--color-primary-500));
  transition: transform .38s var(--en-ease);
}
.en-suite:hover > svg { transform: translateX(5px); }

/* ============================================================
   5. ADAPTATIONS
   ============================================================ */

@media (max-width: 640px) {
  .en-bar {
    left: .6rem; right: .6rem; bottom: .6rem;
    width: auto; transform: translateY(calc(100% + 2rem));
    padding: .85rem 1rem;
  }
  .en-bar.en-on { transform: translateY(0); }
  .en-bar-txt span { display: none; }
  .en-bar-actions { width: 100%; }
  .en-bar-btn { flex: 1; justify-content: center; }
  .en-modal { padding: 2.2rem 1.4rem 1.6rem; }
  .en-resultats { padding: 1.3rem 1.2rem; }
  .en-res-actions { width: 100%; }
  .en-res-actions .en-btn { flex: 1; }
  .en-suite { gap: .9rem; padding: 1rem; }
  .en-suite-ic { width: 40px; height: 40px; font-size: 1.15rem; }
}



@media (prefers-reduced-motion: reduce) {
  .en-bar, .en-modal, .en-modal-fond, .en-suite, .en-btn { transition: none !important; }
  .en-suite:hover { transform: none; }
}

@media print {
  .en-bar, .en-modal-fond, .en-parcours { display: none !important; }
  .en-resultats { background: #fff; border: 1px solid #ccc; box-shadow: none; }
  .en-res-txt b, .en-res-txt span { color: #0f2a2e !important; }
}

/* ============================================================
   6. PONTS — d'un contenu vers le calculateur qui le concrétise
   ============================================================ */

.en-pont {
  display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap;
  margin: var(--space-6) 0;
  padding: 1.35rem 1.6rem;
  border-radius: 18px;
  background:
    linear-gradient(120deg,
      color-mix(in srgb, var(--tone, #2f6f74) 9%, var(--color-neutral-50)),
      var(--color-neutral-50) 65%);
  border: 1px solid color-mix(in srgb, var(--tone, #2f6f74) 22%, transparent);
  border-left: 4px solid var(--tone, #2f6f74);
  transition: transform .38s var(--en-ease), box-shadow .38s var(--en-ease);
}
.en-pont:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px -22px color-mix(in srgb, var(--tone, #2f6f74) 60%, transparent);
}

.en-pont-ic {
  width: 50px; height: 50px; flex: none;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 1.45rem;
  background: color-mix(in srgb, var(--tone, #2f6f74) 16%, transparent);
}

.en-pont-txt { flex: 1; min-width: 200px; }
.en-pont-txt b {
  display: block;
  font-size: 1.05rem; font-weight: 700; line-height: 1.35;
  color: var(--color-primary-900);
  margin-bottom: .25rem;
}
.en-pont-txt span {
  display: block;
  font-size: .89rem; color: var(--color-neutral-700); line-height: 1.5;
}

.en-pont-go {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.35rem;
  border-radius: 999px;
  font-size: .9rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  background: var(--tone, #2f6f74);
  color: #fff;
  box-shadow: 0 8px 22px -10px var(--tone, #2f6f74);
  transition: transform .32s var(--en-ease), box-shadow .32s var(--en-ease);
}
.en-pont-go svg { width: 15px; height: 15px; }
.en-pont-go:hover { transform: translateX(3px); box-shadow: 0 14px 30px -10px var(--tone, #2f6f74); }
.en-pont-go:focus-visible { outline: 2px solid var(--color-accent-600); outline-offset: 3px; }
.en-pont:hover .en-pont-go svg { transform: translateX(3px); }

@media (max-width: 560px) {
  .en-pont { padding: 1.1rem 1.2rem; gap: .9rem; }
  .en-pont-go { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .en-pont, .en-pont-go { transition: none; }
  .en-pont:hover { transform: none; }
}
@media print { .en-pont { break-inside: avoid; box-shadow: none; } }

/* =========================================================================
   LE BLOC DE CONTACT RÉUTILISABLE
   =========================================================================
   Injecté par h2o-engage partout où on met <div data-contact>.
   Il apparaît à la fin de chaque page de contenu : quelqu'un qui vient de
   lire une explication est exactement dans l'état d'esprit pour écrire.
   ========================================================================= */

.en-contact {
  padding: var(--space-10) 0;
  background:
    radial-gradient(760px 320px at 15% 0%, rgba(47,111,116,.16), transparent 62%),
    linear-gradient(165deg, #0f2a2e 0%, #17383d 100%);
  color: #eef0ea;
}

.en-contact-inner {
  display: flex; gap: var(--space-6); align-items: flex-start; flex-wrap: wrap;
}

.en-contact-pastille {
  width: 62px; height: 62px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #a8853f, #8a6a2c);
  display: grid; place-items: center;
  font-size: var(--font-size-lg); font-weight: var(--font-weight-bold); color: #fff;
}

.en-contact-txt { flex: 1; min-width: 260px; }

.en-contact-txt h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.22;
  margin: 0 0 var(--space-3); color: #fff; letter-spacing: -.015em;
}
.en-contact-txt p {
  font-size: var(--font-size-base); line-height: 1.7;
  color: #b7bfb8; margin: 0 0 var(--space-5); max-width: 58ch;
}

.en-contact-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }

.en-contact-note {
  font-size: var(--font-size-sm) !important;
  color: #96a19b !important;
  margin: var(--space-5) 0 0 !important;
}

@media (max-width: 560px) {
  .en-contact-actions .en-btn { width: 100%; justify-content: center; }
}

/* ==========================================================================
   Épargne et impôt — Bouton flottant « Texter Julien » (mobile seulement)
   ========================================================================== */
.fdi-sms-flottant {
  display: none; /* le JS l'affiche uniquement quand le numéro est configuré */
}
@media (max-width: 768px) {
  .fdi-sms-flottant {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 90;
    padding: 0.85rem 1.25rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #123f45 0%, #1f6a72 100%);
    border: 1px solid rgba(220,187,114,.7);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35), 0 0 0 0 rgba(220,187,114,.45);
    animation: fdi-halo 2.6s ease-out infinite;
  }
  .fdi-sms-flottant:active { transform: scale(0.97); }
}
@keyframes fdi-halo {
  0%   { box-shadow: 0 8px 28px rgba(0,0,0,.35), 0 0 0 0 rgba(220,187,114,.45); }
  70%  { box-shadow: 0 8px 28px rgba(0,0,0,.35), 0 0 0 14px rgba(220,187,114,0); }
  100% { box-shadow: 0 8px 28px rgba(0,0,0,.35), 0 0 0 0 rgba(220,187,114,0); }
}
@media (prefers-reduced-motion: reduce) {
  .fdi-sms-flottant { animation: none; }
}
/* Le bouton « Envoyer mon résultat » prend toute la largeur sur mobile */
@media (max-width: 560px) {
  .fdi-envoyer-resultat { width: 100%; justify-content: center; }
}

/* --- Widget flottant « Texter Julien » : pilule + panneau repliable --- */
.fdi-widget { position: fixed; z-index: 60; }

/* Le panneau : carte au-dessus de la pilule */
.fdi-widget-panneau {
  position: fixed;
  right: 1rem;
  bottom: 4.5rem;
  width: min(20rem, calc(100vw - 2rem));
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  padding: 1.1rem 1.1rem 1.25rem;
}
.fdi-widget-panneau h3 { margin: 0 0 .25rem; font-size: 1.1rem; }
.fdi-widget-note { margin: 0 0 .8rem; font-size: .9rem; color: var(--color-muted, #64748b); }
.fdi-widget-panneau label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: .55rem;
}
.fdi-widget-panneau input {
  display: block;
  width: 100%;
  margin-top: .25rem;
  padding: .55rem .6rem;
  font-size: 1rem;
  border: 1px solid var(--color-border, #cbd5e1);
  border-radius: .5rem;
}
.fdi-widget-panneau input.fdi-champ-manquant { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220, 38, 38, .15); }
.fdi-widget-aide { display: block; font-weight: 400; color: var(--color-muted, #64748b); margin-top: .2rem; }
.fdi-widget-erreur { color: #b91c1c; font-size: .85rem; margin: .4rem 0; }
.fdi-widget-panneau .btn { width: 100%; justify-content: center; margin-top: .5rem; }
.fdi-widget-fermer {
  position: absolute;
  top: .4rem;
  right: .6rem;
  border: 0;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted, #64748b);
  padding: .25rem;
}

/* --- Avis de confiance : 100 % legit, avec le cœur --- */
.fdi-legit {
  background: var(--color-surface-alt, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-left: 4px solid var(--color-primary, #1d4ed8);
  border-radius: .75rem;
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem;
  font-size: .95rem;
}
.fdi-legit p { margin: 0; }

/* --- Crédits photos --- */
.fdi-credits-photos {
  font-size: .78rem;
  color: var(--color-muted, #94a3b8);
  text-align: center;
  padding: 0 1rem 1.2rem;
  margin: 0;
}
