/* Zfinpro Tools - styles legers, mobile-first (complement au CDN Tailwind) */
:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --brand: #0b5c40;
  --brand-2: #0b5e73;
  --accent: #c77f3c;
  --line: #e2e8f0;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.container-wide { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px; max-width: 1040px; margin: 0 auto;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 18px; color: var(--ink);
}
.brand .dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: inline-block;
}
.lang-switch { display: flex; gap: 4px; flex-wrap: wrap; }
.lang-switch a {
  font-size: 13px; font-weight: 600; padding: 5px 9px; border-radius: 8px;
  color: var(--muted); border: 1px solid var(--line); background: #fff;
}
.lang-switch a.active { color: #fff; background: var(--brand); border-color: var(--brand); }

/* Logo + menu principal */
.brand { gap: 9px; }
.logo-mark { display: block; border-radius: 8px; flex-shrink: 0; }
.brand-name { font-weight: 800; }
.site-header .bar { flex-wrap: wrap; }
.main-nav { display: flex; gap: 16px; margin-left: auto; margin-right: 8px; flex-wrap: wrap; }
.main-nav a { font-size: 14px; font-weight: 600; color: var(--muted); }
.main-nav a:hover { color: var(--brand); text-decoration: none; }
@media (max-width: 560px) { .main-nav { order: 3; width: 100%; margin: 4px 0 0; } }

/* Pages institutionnelles */
.static-page { max-width: 720px; }
.static-page h2 { font-size: 19px; margin: 20px 0 8px; }
.static-page p { margin: 0 0 12px; color: #334155; }
.static-page a { color: var(--brand-2); font-weight: 600; }

/* Footer nav */
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 12px; }
.footer-nav a { font-size: 13px; color: var(--ink); font-weight: 600; }
.footer-nav a:hover { color: var(--brand); }

/* Layout */
main { padding: 24px 0 40px; }
.crumbs { font-size: 13px; color: var(--muted); margin: 4px 0 14px; }
h1 { font-size: 26px; line-height: 1.25; margin: 0 0 10px; }
.intro { color: var(--muted); margin: 0 0 20px; }

/* Card + form */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 20px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 11px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,107,75,0.12);
}
.actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.btn {
  appearance: none; border: none; cursor: pointer;
  font-size: 16px; font-weight: 700; padding: 12px 20px; border-radius: 10px;
  background: var(--brand); color: #fff;
}
.btn:hover { background: #0c5a3f; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #f1f5f9; }

/* Results */
.result {
  margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #fbfdff, #f4f8ff); padding: 18px;
}
.result-grid { margin: 0; }
.result-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line);
}
.result-row:last-child { border-bottom: none; }
.result-row dt { color: var(--muted); font-size: 14px; margin: 0; }
.result-row dd { margin: 0; font-weight: 700; font-size: 16px; }
.result-row--big dd { font-size: 24px; color: var(--brand); }
.ai-answer h3 { font-size: 16px; margin: 14px 0 6px; }
.ai-answer p { margin: 6px 0; }
.ai-answer ul { margin: 6px 0 6px 18px; }
.ai-loading, .ai-warning { color: var(--muted); margin: 0; }

/* Ad slots */
.ad-slot {
  margin: 20px 0; padding: 10px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: #fff; min-height: 100px;
  display: flex; align-items: center; justify-content: center;
}
.ad-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; }

/* Tool grid (hub) */
.tool-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 8px 0 24px; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .tool-grid { grid-template-columns: 1fr 1fr 1fr; } }
.tool-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); color: var(--ink);
}
.tool-card:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-1px); transition: .15s; }
.tool-card h2 { font-size: 16px; margin: 0 0 6px; }
.tool-card p { font-size: 13px; color: var(--muted); margin: 0; }
.tool-card .badge {
  display: inline-block; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--brand); border-radius: 999px; padding: 2px 9px; margin-bottom: 8px;
}

/* Related links */
.related { margin-top: 8px; }
.related h2 { font-size: 15px; margin: 0 0 10px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
@media (min-width: 640px) { .related ul { grid-template-columns: 1fr 1fr; } }
.related a { font-size: 14px; }

/* Contenu enrichi (guide / methode / FAQ / disclaimer) */
.content-block { margin: 22px 0; }
.content-block h2 { font-size: 19px; margin: 0 0 10px; }
.content-block p { margin: 0 0 10px; color: #334155; }
.formula {
  background: #0f1b3d; color: #e8eefc; border-radius: 10px;
  padding: 12px 14px; overflow-x: auto;
}
.formula code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; white-space: nowrap; }
/* Cas pratique chiffre */
.case-steps { margin: 8px 0 12px; padding-left: 22px; }
.case-steps li { margin-bottom: 7px; color: #334155; }
.case-steps code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13.5px; background: #f1f5f9; border-radius: 5px; padding: 2px 7px;
  display: inline-block; word-break: break-word;
}
.case-result {
  background: #f1f7f4; border-left: 3px solid var(--brand);
  padding: 11px 14px; border-radius: 0 8px 8px 0; margin: 12px 0;
}

.faq-item {
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff;
}
.faq-item summary {
  cursor: pointer; padding: 12px 14px; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--brand); font-size: 20px; line-height: 1; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-answer { padding: 0 14px 12px; }
.faq-item .faq-answer p { margin: 0; color: #475569; font-size: 15px; }
.disclaimer-box {
  border: 1px solid #e7cfa8; background: #fdf7ee; border-radius: 12px;
  padding: 14px 16px; margin: 20px 0; color: #6b4f2a; font-size: 14px;
}
.disclaimer-box strong { display: block; margin-bottom: 4px; color: #8a5a1a; }
.disclaimer-box p { margin: 0; }

/* ---- RICH CALCULATOR UI ---- */
.rich-calc { padding-top: 14px; }
.rich-calc .trust-badges {
  margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
  justify-content: center; font-size: 12.5px;
}
.inputs-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 620px) { .inputs-grid { grid-template-columns: 1fr 1fr; } }
.inputs-grid .field { margin-bottom: 0; }
.inputs-grid .field--wide { grid-column: 1 / -1; }
.inputs-grid label {
  display: flex; align-items: center; gap: 7px; font-size: 13.5px; margin-bottom: 7px;
}
.inputs-grid label .f-ico { color: var(--brand); flex-shrink: 0; width: 18px; height: 18px; }
/* IMPORTANT : le flex:1 ne cible QUE le texte du label (.lbl).
   S'il touchait aussi .hint, la pastille (i) s'etirerait en ovale. */
.inputs-grid label > .lbl { flex: 1; min-width: 0; }
.hint {
  display: inline-flex; align-items: center; justify-content: center; cursor: help;
  width: 18px; height: 18px; min-width: 18px; max-width: 18px; min-height: 18px;
  flex: 0 0 18px; flex-shrink: 0; box-sizing: border-box; padding: 0; margin-left: 6px;
  border-radius: 50%; background: #e2e8f0; color: #475569;
  font-size: 11px; line-height: 1; font-weight: 700; font-style: italic; user-select: none;
}
.hint:hover { background: var(--brand); color: #fff; }

/* Selecteur manuel de devise */
.currency-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--line);
}
.currency-bar label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0; }
.currency-bar select {
  padding: 7px 12px; font-size: 14px; font-weight: 600; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer;
}
.currency-bar select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,92,64,.12); }

/* Prereglages regionaux en menu deroulant (remplace les badges empiles) */
.preset-select {
  display: block; width: 100%; margin-bottom: 8px;
  padding: 8px 11px; font-size: 13px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 9px; background: #f8fafc; cursor: pointer;
}
.preset-select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,92,64,.12); }
.affix--empty input { padding-left: 12px; padding-right: 12px; }
.affix--empty .affix { display: none; }

/* Input avec affixe devise / % integre */
.input-affix { position: relative; display: block; }
.input-affix .affix {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 700; font-size: 14px; pointer-events: none;
}
.affix--before .affix { left: 13px; }
.affix--before input { padding-left: 40px; }
.affix--after .affix { right: 13px; }
.affix--after input { padding-right: 44px; }

/* Widgets de resultat */
.viz { margin: 0 0 14px; text-align: center; }
.viz svg { width: 100%; max-width: 340px; height: auto; }

/* Icones */
.ico { color: var(--brand); vertical-align: middle; }
.tool-h1 { display: flex; align-items: center; gap: 10px; }
.tool-h1 .h1-ico { color: var(--brand); flex-shrink: 0; }
.tool-h1 span { display: inline-block; }
.card-ico { color: var(--brand); margin-bottom: 8px; }
.tool-card .badge { position: absolute; top: 12px; right: 12px; margin: 0; }
.tool-card { position: relative; }

/* Resultat : encadre mis en valeur + bouton copier */
.result { box-shadow: inset 0 0 0 1px rgba(15,107,75,.08); }
.result-row--big dd { font-size: 26px; }
.copy-btn {
  margin-top: 12px; appearance: none; cursor: pointer;
  border: 1px solid var(--brand); background: #fff; color: var(--brand);
  font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px;
}
.copy-btn:hover { background: var(--brand); color: #fff; }

/* Barre de reassurance "bank-grade" : pastilles de texte pur, sobres, sans icone */
.trust-badges {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 4px 0 8px;
}
.trust-badges span {
  white-space: nowrap; font-size: 12px; font-weight: 400; letter-spacing: .01em;
  color: #64748b; background: #f8fafc; border: 1px solid #e8edf3;
  border-radius: 6px; padding: 5px 12px;
}

/* Barre de recherche (accueil) */
.tool-search { margin: 4px 0 18px; }
.tool-search input {
  width: 100%; padding: 14px 18px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  box-shadow: var(--shadow);
}
.tool-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,107,75,0.12); }
.no-result { text-align: center; color: var(--muted); padding: 20px; }

/* Grille "Autres outils connexes" */
.related-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .related-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .related-grid { grid-template-columns: 1fr 1fr 1fr; } }
.related-card {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  color: var(--ink); font-size: 14px; font-weight: 600;
}
.related-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); transition: .15s; }
.related-card .ico { flex-shrink: 0; }

/* Section "Calculateurs populaires" (mise en avant data-driven sur l'accueil) */
.popular { margin: 6px 0 18px; }
.popular h2 { font-size: 16px; margin: 0 0 10px; }
.pop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .pop-grid { grid-template-columns: repeat(5, 1fr); } }
.pop-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  padding: 16px 10px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
}
.pop-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-2px); transition: .15s; }
.pop-card .ico { color: var(--brand); }

/* Encadre "Outil vedette" (accueil, sous les calculateurs populaires) */
.hero-tool {
  display: grid; grid-template-columns: 1fr; gap: 18px; align-items: center;
  margin: 4px 0 22px; padding: 22px 24px; border-radius: 16px;
  background: linear-gradient(135deg, #0f1b3d 0%, #0b5c40 100%);
  color: #fff; box-shadow: 0 10px 30px rgba(15, 27, 61, .18);
}
@media (min-width: 720px) { .hero-tool { grid-template-columns: 1fr 220px; } }
.hero-tool__kicker {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #7dd3a8; margin-bottom: 8px;
}
.hero-tool h2 { font-size: 22px; margin: 0 0 8px; color: #fff; line-height: 1.25; }
.hero-tool p { margin: 0 0 16px; font-size: 14px; color: #cfd9ea; max-width: 56ch; }
.hero-tool__cta { background: #fff; color: #0b5c40; font-weight: 700; }
.hero-tool__cta:hover { background: #eafaf2; color: #0b5c40; text-decoration: none; }
.hero-tool__viz { display: none; }
@media (min-width: 720px) { .hero-tool__viz { display: block; } }
.hero-tool__viz svg { width: 100%; height: auto; opacity: .95; }

/* Bloc "Prochaine etape" (maillage interne cible) */
.next-step { margin: 24px 0 8px; }
.next-step h2 { font-size: 17px; margin: 0 0 10px; }
.next-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .next-grid { grid-template-columns: repeat(3, 1fr); } }
.next-card {
  display: flex; align-items: center; gap: 9px; padding: 13px 14px;
  border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 10px; background: #fff; color: var(--ink);
  font-size: 14px; font-weight: 600;
}
.next-card:hover { background: #f6fbf8; text-decoration: none; border-color: var(--brand); }

/* Tiroir "Mes simulations recentes" */
.recent {
  margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: #fbfdff;
}
.recent h2 { font-size: 15px; margin: 0 0 8px; }
.recent ul { list-style: none; margin: 0; padding: 0; }
.recent li {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px;
}
.recent li:last-child { border-bottom: none; }
.recent .recent-val { color: var(--brand); font-weight: 700; white-space: nowrap; }
.recent-clear {
  margin-top: 10px; appearance: none; cursor: pointer; background: none;
  border: none; color: var(--muted); font-size: 12px; text-decoration: underline; padding: 0;
}

/* Barre d'engagement : partager / favoris */
.engage-bar {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.engage-btn {
  appearance: none; cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--muted); transition: .15s;
}
.engage-btn:hover { border-color: var(--brand); color: var(--brand); }
.engage-btn--ok { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Modale (favoris) */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 14px; padding: 26px 28px; max-width: 440px; width: 100%;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .3); text-align: center;
}
.modal h3 { margin: 0 0 10px; font-size: 18px; }
.modal p { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

/* Banniere B2B HovOps : discrete, simple lien sortant */
.b2b {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; margin: 26px 0 8px; padding: 20px 22px;
  border-radius: 14px; background: #f8fafc; border: 1px solid var(--line);
}
.b2b__body { flex: 1 1 340px; min-width: 0; }
.b2b h2 { font-size: 16px; margin: 0 0 6px; }
.b2b p { font-size: 14px; color: var(--muted); margin: 0; max-width: 64ch; }
.b2b__cta {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 20px; border-radius: 10px; white-space: nowrap;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700;
}
.b2b__cta:hover { background: #0a4a34; color: #fff; text-decoration: none; }

/* Call-to-action favori */
.fav-cta {
  margin: 22px 0 8px; padding: 14px 16px; border-radius: 12px;
  background: #f1f7f4; border: 1px dashed #b6d8c9; color: #2f4f42; font-size: 14px; text-align: center;
}
.fav-cta strong { color: var(--brand); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line); background: var(--card);
  padding: 22px 0; margin-top: 20px; color: var(--muted); font-size: 13px;
}
.site-footer .disclaimer { max-width: 760px; margin: 0 auto 8px; }
