/* Calculateur de cash-flow - styles. Scope total sous .rrcf */
/* ---- Scope total : tout vit sous .rrcf ---- */
.rrcf, .rrcf *, .rrcf *::before, .rrcf *::after { box-sizing:border-box; }
.rrcf {
  /* Palette Agir Investir */
  --ink:#0f2748;            /* bleu nuit, texte fort        */
  --brand:#1556a4;          /* bleu marque (logo)           */
  --brand-deep:#0d3c78;     /* bleu profond, bandeau        */
  --muted:#5d6b85;          /* texte secondaire             */
  --line:#e3e9f2;           /* filets                       */
  --field:#f2f6fc;          /* fond des champs              */
  --in:#138a52; --in-bg:#e9f6ef;   /* positif / entrees     */
  --out:#cf3b2c; --out-bg:#fceceb; /* negatif / sorties     */
  --radius:16px;

  position:relative; overflow:hidden;
  max-width:880px; margin:0 auto; padding:30px 28px 24px;
  background:#fff; border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:0 22px 60px -34px rgba(15,39,72,.55);
  font-family:"Poppins",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink); line-height:1.45; text-align:left;
  -webkit-font-smoothing:antialiased;
}
/* liseré de marque en haut de la carte */
.rrcf::before {
  content:""; position:absolute; top:0; left:0; right:0; height:5px;
  background:linear-gradient(90deg,var(--brand) 0%,var(--brand-deep) 100%);
}

.rrcf__head { text-align:center; margin-bottom:24px; }
.rrcf__eyebrow {
  margin:0 0 6px; font-size:12px; letter-spacing:.18em; text-transform:uppercase;
  font-weight:700; color:var(--brand);
}
.rrcf__title { margin:0; font-size:28px; font-weight:800; letter-spacing:-.02em; color:var(--ink); }
.rrcf__sub { margin:6px 0 0; font-size:14px; color:var(--muted); }

.rrcf__grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.rrcf__panel { background:#fff; border:1px solid var(--line); border-radius:12px; padding:18px; }
.rrcf__panelHead { display:flex; align-items:center; gap:9px; margin-bottom:12px; }
.rrcf__panelHead h3 { margin:0; font-size:16px; font-weight:700; color:var(--ink); }
.rrcf__dot { width:10px; height:10px; border-radius:50%; flex:0 0 auto; }
.rrcf__dot--in { background:var(--in); }
.rrcf__dot--out { background:var(--out); }

.rrcf__field {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:9px 0; border-bottom:1px solid var(--line);
}
.rrcf__field:last-of-type { border-bottom:none; }
.rrcf__field > span:first-child { font-size:14px; color:var(--muted); flex:1; }

.rrcf .rrcf__inputWrap { position:relative; flex:0 0 auto; display:inline-block; }
/* Spécificité renforcée + !important : empêche le thème (Elementor / FunnelKit)
   d'écraser le padding et de faire chevaucher le € sur le chiffre. */
.rrcf .rrcf__inp {
  -webkit-appearance:none !important; appearance:none !important;
  width:122px !important; height:auto !important; min-height:0 !important; margin:0 !important;
  padding:9px 32px 9px 12px !important; text-align:right !important;
  font-family:inherit !important; font-size:15px !important; font-weight:600 !important;
  line-height:1.3 !important; color:var(--ink) !important;
  font-variant-numeric:tabular-nums;
  background:var(--field) !important; border:1.5px solid transparent !important; border-radius:9px !important;
  box-shadow:none !important; outline:none !important;
  transition:border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.rrcf .rrcf__inp:focus {
  border-color:var(--brand) !important; background:#fff !important;
  box-shadow:0 0 0 3px rgba(21,86,164,.12) !important;
}
.rrcf .rrcf__unit {
  position:absolute !important; right:12px; top:50%; transform:translateY(-50%);
  font-size:14px; line-height:1; color:var(--muted); pointer-events:none;
}

.rrcf__subtotal {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin-top:14px; padding:12px 14px; border-radius:10px;
  font-size:14px; font-weight:600;
}
.rrcf__subtotal strong { font-size:18px; font-variant-numeric:tabular-nums; }
.rrcf__subtotal--in { background:var(--in-bg); color:var(--in); }
.rrcf__subtotal--out { background:var(--out-bg); color:var(--out); }

.rrcf__result {
  margin-top:18px; padding:20px 24px; border-radius:14px;
  display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
  color:#fff; background:linear-gradient(120deg,var(--brand-deep),var(--brand));
  transition:background .25s ease;
}
.rrcf__result.is-positive { background:linear-gradient(120deg,#0e6b41,#16a05c); }
.rrcf__result.is-negative { background:linear-gradient(120deg,#9a2a1d,#cf3b2c); }
.rrcf__resultMain { display:flex; flex-direction:column; gap:2px; }
.rrcf__resultLabel { font-size:12px; letter-spacing:.05em; opacity:.85; text-transform:uppercase; font-weight:600; }
.rrcf__resultValue { font-size:36px; font-weight:800; letter-spacing:-.02em; font-variant-numeric:tabular-nums; line-height:1.1; }
.rrcf__resultSide { display:flex; flex-direction:column; align-items:flex-end; gap:7px; }
.rrcf__badge {
  font-size:12px; font-weight:700; letter-spacing:.03em; text-transform:uppercase;
  padding:5px 12px; border-radius:999px; background:rgba(255,255,255,.18);
}
.rrcf__resultYear { font-size:13px; opacity:.9; }
.rrcf__resultYear strong { font-variant-numeric:tabular-nums; }

/* ---- Bouton export PDF ---- */
.rrcf__actions { display:flex; justify-content:center; margin-top:18px; }
.rrcf .rrcf__btn {
  -webkit-appearance:none !important; appearance:none !important;
  display:inline-flex; align-items:center; gap:9px;
  margin:0 !important; padding:12px 22px !important;
  font-family:inherit !important; font-size:14px !important; font-weight:600 !important;
  line-height:1 !important; color:#fff !important; text-decoration:none !important;
  background:linear-gradient(120deg,var(--brand-deep),var(--brand)) !important;
  border:none !important; border-radius:999px !important; cursor:pointer;
  box-shadow:0 12px 28px -14px rgba(15,39,72,.7) !important;
  transition:transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.rrcf .rrcf__btn:hover { transform:translateY(-1px); box-shadow:0 16px 32px -14px rgba(15,39,72,.75) !important; }
.rrcf .rrcf__btn:active { transform:translateY(0); }
.rrcf .rrcf__btn:focus-visible { outline:none; box-shadow:0 0 0 3px rgba(21,86,164,.30) !important; }
.rrcf .rrcf__btn[disabled] { opacity:.65; cursor:wait; }
.rrcf .rrcf__btn svg { flex:0 0 auto; }

.rrcf__legal { margin:18px 0 0; text-align:center; font-size:12px; color:var(--muted); }

/* ---- Responsive ---- */
@media (max-width:640px){
  .rrcf { padding:24px 18px 20px; }
  .rrcf__grid { grid-template-columns:1fr; }
  .rrcf__title { font-size:23px; }
  .rrcf__result { flex-direction:column; align-items:flex-start; }
  .rrcf__resultSide { align-items:flex-start; }
  .rrcf__resultValue { font-size:32px; }
  .rrcf .rrcf__inp { width:112px !important; }
  .rrcf .rrcf__btn { width:100%; justify-content:center; }
}
@media (prefers-reduced-motion:reduce){
  .rrcf *, .rrcf *::before, .rrcf *::after { transition:none !important; }
}

/* ====== AJOUTS v1.1 : switch mode + champs euro/pourcent ====== */

/* Switch de mode (longue / courte duree) */
.rrcf__modes {
  display:flex; gap:6px; max-width:520px; margin:0 auto 22px;
  padding:5px; background:var(--field); border:1px solid var(--line); border-radius:999px;
}
.rrcf .rrcf__mode {
  -webkit-appearance:none !important; appearance:none !important;
  flex:1 1 0; margin:0 !important; padding:10px 12px !important;
  font-family:inherit !important; font-size:13.5px !important; font-weight:600 !important;
  line-height:1.2 !important; color:var(--muted) !important;
  background:transparent !important; border:none !important; border-radius:999px !important;
  cursor:pointer; transition:background .15s ease, color .15s ease, box-shadow .15s ease;
}
.rrcf .rrcf__mode:hover { color:var(--ink) !important; }
.rrcf .rrcf__mode.is-active {
  color:#fff !important;
  background:linear-gradient(120deg,var(--brand-deep),var(--brand)) !important;
  box-shadow:0 8px 18px -10px rgba(15,39,72,.7) !important;
}

/* Masquage propre des panneaux de revenus selon le mode */
.rrcf [hidden] { display:none !important; }

/* Champ avec switch euro / pourcent */
.rrcf__field--fee { flex-wrap:wrap; }
.rrcf__feeCtrl { display:inline-flex; align-items:center; gap:8px; flex:0 0 auto; }

.rrcf__seg {
  display:inline-flex; padding:3px; gap:2px;
  background:var(--field); border:1px solid var(--line); border-radius:8px;
}
.rrcf .rrcf__segBtn {
  -webkit-appearance:none !important; appearance:none !important;
  margin:0 !important; padding:5px 9px !important; min-width:30px;
  font-family:inherit !important; font-size:13px !important; font-weight:700 !important;
  line-height:1 !important; color:var(--muted) !important;
  background:transparent !important; border:none !important; border-radius:6px !important;
  cursor:pointer; transition:background .12s ease, color .12s ease;
}
.rrcf .rrcf__segBtn.is-active {
  color:#fff !important; background:var(--brand) !important;
}

@media (max-width:640px){
  .rrcf__modes { flex-direction:column; border-radius:16px; }
  .rrcf .rrcf__mode { border-radius:12px !important; }
  .rrcf__field--fee { align-items:flex-start; }
  .rrcf__feeCtrl { width:100%; justify-content:space-between; margin-top:6px; }
}

/* ====== AJOUTS v1.2 : icone info + champ nuitees ====== */
.rrcf__info {
  display:inline-flex; align-items:center; justify-content:center;
  width:15px; height:15px; margin-left:4px; vertical-align:middle;
  font-size:10px; font-weight:700; font-style:normal; line-height:1;
  color:#fff; background:var(--muted); border-radius:50%;
  cursor:help; user-select:none;
}
.rrcf__info:hover, .rrcf__info:focus { background:var(--brand); outline:none; }

/* Champ nuitees : plus de place a droite pour le mot "nuits" (evite le chevauchement) */
.rrcf .rrcf__inp--unitwide { padding-right:48px !important; }

/* ====== AJOUTS v1.3 : vraie bulle d'info (survol + focus, mobile inclus) ====== */
.rrcf__info { position:relative; }
.rrcf__tip {
  position:absolute; bottom:calc(100% + 9px); left:-6px;
  width:230px; max-width:72vw; padding:9px 11px;
  background:var(--ink); color:#fff;
  font-size:12px; font-weight:500; font-style:normal; line-height:1.4;
  letter-spacing:0; text-align:left; text-transform:none;
  border-radius:9px; box-shadow:0 12px 30px -10px rgba(15,39,72,.55);
  opacity:0; visibility:hidden; transform:translateY(4px);
  transition:opacity .15s ease, transform .15s ease;
  pointer-events:none; z-index:20; white-space:normal;
}
.rrcf__tip::after {
  content:""; position:absolute; top:100%; left:12px;
  border:6px solid transparent; border-top-color:var(--ink);
}
.rrcf__info:hover .rrcf__tip,
.rrcf__info:focus .rrcf__tip,
.rrcf__info:focus-within .rrcf__tip {
  opacity:1; visibility:visible; transform:translateY(0);
}
