/* Arkans Wealth Management — Simulateurs internes */
:root {
  --petrol: #26474e;
  --petrol-2: #1b363c;
  --ink: #0e1c1f;
  --teal: #4fb3ae;
  --teal-soft: #e3f3f2;
  --bg: #f4f6f6;
  --white: #ffffff;
  --text: #1c2526;
  --muted: #5d6b6d;
  --border: #dde4e4;
  --red: #c0392b;
  --green: #2e8b6a;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--text); background: var(--bg); line-height: 1.55; }
h1, h2, h3 { font-family: 'Sora', 'Inter', sans-serif; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
.container { width: min(1240px, 100% - 32px); margin-inline: auto; }

/* Header */
.topbar { background: var(--ink); color: var(--white); position: sticky; top: 0; z-index: 50; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 40px; }
.brand .tag { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--teal); border-left: 1px solid rgba(255,255,255,.2); padding-left: 14px; }
.topnav { display: flex; gap: 6px; }
.topnav a { padding: 8px 14px; border-radius: 8px; font-size: .9rem; font-weight: 500; color: rgba(255,255,255,.75); }
.topnav a:hover { color: var(--white); background: rgba(255,255,255,.06); }
.topnav a.active { color: var(--white); background: var(--petrol); }

/* Page header */
.page-head { background: linear-gradient(135deg, var(--petrol) 0%, var(--petrol-2) 100%); color: var(--white); padding: 36px 0 32px; }
.page-head h1 { color: var(--white); font-size: clamp(1.6rem, 3vw, 2.1rem); }
.page-head p { opacity: .8; margin-top: 6px; }
.page-head .container { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.client-box { display: flex; gap: 10px; align-items: center; }
.client-box input { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: var(--white); padding: 9px 12px; border-radius: 8px; font-family: inherit; font-size: .9rem; width: 220px; }
.client-box input::placeholder { color: rgba(255,255,255,.55); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: .9rem; border: none; cursor: pointer; font-family: inherit; transition: .15s; }
.btn-teal { background: var(--teal); color: var(--ink); }
.btn-teal:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--petrol); }
.btn-ghost:hover { background: var(--teal-soft); }
.btn-sm { padding: 6px 12px; font-size: .82rem; }

main { padding: 28px 0 60px; }

/* Layout */
.layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.layout > * { min-width: 0; }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 1.05rem; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.panel h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-family: 'Inter', sans-serif; margin: 18px 0 10px; }
.sticky { position: sticky; top: 88px; }

/* Fields */
.field { margin-bottom: 14px; }
.field label { display: flex; justify-content: space-between; font-weight: 500; font-size: .85rem; margin-bottom: 6px; color: var(--text); }
.field label output { color: var(--petrol); font-weight: 600; }
.field input[type=number], .field input[type=text], .field select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .95rem; font-family: inherit; background: var(--white); color: var(--text); }
.field input:focus, .field select:focus { outline: 2px solid var(--teal); border-color: transparent; }
.field input[type=range] { width: 100%; accent-color: var(--teal); }
.hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* Segmented control */
.seg { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { flex: 1; padding: 9px 12px; border: none; background: none; border-radius: 7px; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; font-size: .88rem; white-space: nowrap; }
.seg button.active { background: var(--petrol); color: var(--white); }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { display: block; font-family: 'Sora', sans-serif; font-size: 1.45rem; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi small { font-size: .78rem; color: var(--muted); }
.kpi.main { background: var(--petrol); border-color: var(--petrol); }
.kpi.main span, .kpi.main small { color: rgba(255,255,255,.75); }
.kpi.main strong { color: var(--teal); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { background: var(--bg); color: var(--petrol); font-weight: 600; position: sticky; top: 0; }
tbody tr:hover { background: #fafcfc; }
tr.milestone td { background: var(--teal-soft); }
td input.cell { width: 110px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; text-align: right; font-family: inherit; font-size: .85rem; }
td input.cell.overridden { border-color: var(--teal); background: var(--teal-soft); font-weight: 600; }
.neg { color: var(--red); }

.chart-box { position: relative; height: 320px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; color: var(--white); }
.badge.ok { background: var(--green); } .badge.warn { background: var(--red); }
.alerts { margin-bottom: 16px; }
.alert { background: #fff6e6; border: 1px solid #f0d49b; color: #7a5410; border-radius: 8px; padding: 10px 14px; font-size: .85rem; margin-bottom: 8px; }
.disclaimer { font-size: .76rem; color: var(--muted); margin-top: 18px; }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
details > summary { cursor: pointer; font-weight: 600; color: var(--petrol); font-size: .9rem; }

/* Home */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.tile { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; transition: .2s; display: block; }
.tile:hover { border-color: var(--teal); transform: translateY(-3px); box-shadow: 0 12px 28px rgba(14,28,31,.08); }
.tile .ico { width: 48px; height: 48px; border-radius: 12px; background: var(--teal-soft); color: var(--petrol); display: grid; place-items: center; margin-bottom: 16px; }
.tile h2 { font-size: 1.2rem; margin-bottom: 8px; }
.tile p { color: var(--muted); font-size: .92rem; }
.tile .go { margin-top: 18px; color: var(--petrol); font-weight: 600; font-size: .9rem; }
.tile.soon { opacity: .55; pointer-events: none; }

footer { color: var(--muted); font-size: .78rem; padding: 24px 0 40px; text-align: center; }

.print-only { display: none; }

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .brand .tag { display: none; }
}
@media (max-width: 600px) {
  .topnav a { padding: 6px 8px; font-size: .8rem; }
  .brand img { height: 30px; }
  .client-box input { width: 100%; }
  .client-box { width: 100%; }
}

/* Impression / PDF client */
@media print {
  .topbar, .no-print, .client-box { display: none !important; }
  .print-only { display: block; }
  body { background: var(--white); }
  .page-head { background: none; color: var(--ink); padding: 0 0 12px; border-bottom: 2px solid var(--petrol); }
  .page-head h1 { color: var(--ink); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel, .kpi { break-inside: avoid; }
  .sticky { position: static; }
  td input.cell { border: none; background: none; }
}

/* ---- v3 : présentation prospect ---- */
.toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-bottom: 22px; }
.toolbar .seg { flex: 0 1 auto; }
.seg.profiles button small { display: block; font-weight: 500; font-size: .72rem; opacity: .75; }
.seg.profiles button { line-height: 1.25; padding: 7px 14px; }

.synthese { background: var(--white); border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 18px; font-size: 1.12rem; line-height: 1.6; color: var(--ink); }
.synthese b { color: var(--petrol); font-family: 'Sora', sans-serif; font-weight: 600; white-space: nowrap; }

.kpi.up strong { color: var(--green); }
.kpi.down strong { color: var(--red); }

.cards-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.cards-2 .panel { margin-top: 0 !important; }
.profile-bars { display: grid; gap: 10px; }
.pbar { display: grid; grid-template-columns: 110px 1fr 100px; align-items: center; gap: 10px; font-size: .88rem; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.pbar:hover { background: var(--bg); }
.pbar.active { background: var(--teal-soft); font-weight: 600; }
.pbar .track { height: 12px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.pbar .fill { height: 100%; background: var(--petrol); border-radius: 6px; transition: width .4s; }
.pbar.active .fill { background: var(--teal); }
.pbar b { text-align: right; font-variant-numeric: tabular-nums; }
.wait-big { font-family: 'Sora', sans-serif; font-size: 2rem; color: var(--red); margin: 6px 0; font-variant-numeric: tabular-nums; }
.inline-select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: .9rem; }

details.detail-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin-top: 18px; }
details.detail-panel[open] summary { margin-bottom: 14px; }
.detail-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 10px 18px; border-radius: 8px; font-size: .9rem; z-index: 100; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* Mode présentation */
.exit-present { display: none; position: fixed; bottom: 20px; right: 20px; z-index: 90; }
body.present .exit-present { display: inline-flex; }
body.present .topbar, body.present aside, body.present .no-present, body.present .client-box, body.present .disclaimer { display: none !important; }
body.present .layout { grid-template-columns: minmax(0, 1fr); }
body.present .page-head { padding: 20px 0; }
body.present .page-head .print-only { display: block; }
body.present .page-head .no-print { display: none; }
body.present .kpi strong { font-size: 2rem; }
body.present .synthese { font-size: 1.35rem; }
body.present .chart-box { height: 420px; }
body.present main { padding-top: 20px; }

/* Synthèse imprimable */
.print-cover { display: none; }
@media print {
  .print-cover { display: block; margin-bottom: 18px; }
  .print-cover h2 { font-size: 1.4rem; margin-bottom: 4px; }
  .print-cover ul { font-size: .85rem; color: var(--muted); margin: 10px 0 0 18px; }
  .toolbar, .cards-2 .inline-select, .detail-tools, .exit-present { display: none !important; }
  details.detail-panel { break-before: page; }
  .cards-2 { grid-template-columns: 1fr 1fr; }
  .chart-box { height: 280px; }
}
@media (max-width: 760px) {
  .cards-2 { grid-template-columns: 1fr; }
  .pbar { grid-template-columns: 90px 1fr 90px; }
}
.eco-bar { display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin: 12px 0 6px; background: var(--bg); }
.eco-bar div { height: 100%; transition: width .4s; }
#eco-paye { background: var(--petrol); }
#eco-remb { background: var(--teal); }

/* ---- Animations et effets au survol ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shine { from { transform: translateX(-120%) skewX(-20deg); } to { transform: translateX(220%) skewX(-20deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* Apparition progressive au chargement */
.page-head h1, .page-head p { animation: fadeUp .6s cubic-bezier(.2,.7,.2,1) backwards; }
.page-head p { animation-delay: .08s; }
.client-box { animation: fadeIn .6s .15s backwards; }
.toolbar, aside .panel, .synthese, .kpi, main section > .panel, .cards-2 > .panel, details.detail-panel, .tile {
  animation: fadeUp .55s cubic-bezier(.2,.7,.2,1) backwards;
}
.toolbar { animation-delay: .05s; }
aside .panel { animation-delay: .1s; }
.synthese { animation-delay: .12s; }
.kpi:nth-child(1) { animation-delay: .16s; } .kpi:nth-child(2) { animation-delay: .22s; }
.kpi:nth-child(3) { animation-delay: .28s; } .kpi:nth-child(4) { animation-delay: .34s; } .kpi:nth-child(5) { animation-delay: .4s; }
main section > .panel { animation-delay: .3s; }
.cards-2 > .panel:nth-child(1) { animation-delay: .36s; } .cards-2 > .panel:nth-child(2) { animation-delay: .42s; }
.tile:nth-child(1) { animation-delay: .1s; } .tile:nth-child(2) { animation-delay: .2s; } .tile:nth-child(3) { animation-delay: .3s; }

/* Cartes d'accueil */
.tile { position: relative; overflow: hidden; transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s, border-color .35s; }
.tile::after { content: ""; position: absolute; top: 0; left: 0; width: 40%; height: 100%; background: linear-gradient(90deg, transparent, rgba(79,179,174,.18), transparent); transform: translateX(-120%) skewX(-20deg); pointer-events: none; }
.tile:hover { transform: translateY(-8px) scale(1.03); box-shadow: 0 22px 44px rgba(14,28,31,.14); border-color: var(--teal); }
.tile:hover::after { animation: shine .9s ease; }
.tile .ico { transition: transform .4s cubic-bezier(.3,1.6,.5,1), background .3s, color .3s; }
.tile:hover .ico { transform: scale(1.18) rotate(-8deg); background: var(--teal); color: var(--white); }
.tile h2 { transition: color .3s; }
.tile:hover h2 { color: var(--petrol); }

/* Indicateurs */
.kpi { transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s, border-color .3s; }
.kpi:hover { transform: translateY(-5px) scale(1.04); box-shadow: 0 16px 32px rgba(14,28,31,.12); border-color: var(--teal); }
.kpi.main:hover { box-shadow: 0 16px 36px rgba(38,71,78,.35); }
.kpi strong { transition: transform .3s; transform-origin: left center; }
.kpi:hover strong { transform: scale(1.06); }

/* Encadrés */
.panel, .synthese, details.detail-panel { transition: box-shadow .3s, border-color .3s, transform .3s; }
main section > .panel:hover, .cards-2 > .panel:hover, details.detail-panel:hover { box-shadow: 0 14px 32px rgba(14,28,31,.08); border-color: #c9d8d7; }
.synthese:hover { transform: translateX(4px); box-shadow: 0 10px 26px rgba(14,28,31,.07); }

/* Boutons */
.btn { transition: transform .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s, filter .2s, background .2s; }
.btn:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 8px 18px rgba(14,28,31,.18); }
.btn:active { transform: scale(.97); }
.btn-teal:hover { filter: brightness(1.08); }

/* Sélecteurs (onglets, profils) */
.seg button { transition: background .25s, color .25s, transform .2s cubic-bezier(.3,1.6,.5,1), box-shadow .25s; }
.seg button:hover:not(.active) { background: var(--white); color: var(--petrol); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(14,28,31,.08); }
.seg button.active { box-shadow: 0 6px 14px rgba(38,71,78,.3); }

/* Navigation */
.topnav a { position: relative; transition: color .2s, background .2s; }
.topnav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px; background: var(--teal); transform: scaleX(0); transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.topnav a:hover::after { transform: scaleX(1); }
.brand img { transition: transform .4s cubic-bezier(.3,1.6,.5,1); }
.brand:hover img { transform: scale(1.08); }

/* Barres de comparaison */
.pbar { transition: background .25s, transform .25s cubic-bezier(.2,.7,.2,1); }
.pbar:hover { transform: translateX(6px); }
.pbar .track { transition: height .25s; }
.pbar:hover .track { height: 16px; }
.pbar:hover .fill { background: var(--teal); }

/* Champs */
.field input, .field select { transition: border-color .2s, box-shadow .25s, transform .2s; }
.field input:hover, .field select:hover { border-color: var(--teal); }
.field input:focus, .field select:focus { box-shadow: 0 0 0 4px rgba(79,179,174,.2); }
input[type=range] { transition: transform .2s; }
input[type=range]:hover { transform: scaleY(1.25); }

/* Tableau */
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--teal-soft); }
td input.cell { transition: border-color .2s, box-shadow .2s, transform .2s; }
td input.cell:hover { border-color: var(--teal); transform: scale(1.05); }
td input.cell:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(79,179,174,.25); }

/* Alertes, coût de l'attente */
.alert { animation: fadeUp .4s backwards; }
.wait-big { display: inline-block; animation: floaty 3s ease-in-out infinite; }
.eco-bar div { transition: width .5s cubic-bezier(.2,.7,.2,1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Allocation personnalisée ---- */
.alloc-params { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 16px; margin-bottom: 18px; }
.alloc-table td, .alloc-table th { text-align: left; }
.alloc-table td { padding: 6px 8px; vertical-align: middle; }
.alloc-table td.montant, .alloc-table tfoot td { font-variant-numeric: tabular-nums; }
.alloc-table input.cell, .alloc-table select.cell { width: auto; text-align: left; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-family: inherit; font-size: .85rem; background: var(--white); color: var(--text); }
.alloc-table input.cell.wide { width: 230px; }
.alloc-table input.cell.small { width: 70px; text-align: right; }
.alloc-table select.cell:hover { border-color: var(--teal); }
.alloc-table tfoot td { background: var(--bg); border-top: 2px solid var(--petrol); }
.icon-btn { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; transition: .2s; }
.icon-btn:hover { background: var(--red); border-color: var(--red); color: var(--white); transform: rotate(90deg) scale(1.1); }
.alloc-table tbody tr { animation: fadeUp .35s backwards; }
@media (max-width: 760px) { .alloc-params { grid-template-columns: 1fr; } }

/* Accueil en sections */
.home-section + .home-section { margin-top: 40px; }
.home-section > h2 { font-size: 1.2rem; margin-bottom: 4px; }
.home-section > p { color: var(--muted); font-size: .92rem; margin-bottom: 18px; }
.tile.feature { background: linear-gradient(135deg, var(--petrol), var(--petrol-2)); border-color: var(--petrol); color: var(--white); }
.tile.feature h2 { color: var(--white); }
.tile.feature p { color: rgba(255,255,255,.8); }
.tile.feature .ico { background: rgba(79,179,174,.25); color: var(--teal); }
.tile.feature:hover h2 { color: var(--teal); }
#env-bars .pbar { grid-template-columns: 150px 1fr 150px; }

/* Jalons tous les 5 ans (allocation) */
.milestones-panel { margin-bottom: 18px; }
.milestones { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.milestone-card { position: relative; padding: 18px 18px 16px; border-radius: var(--radius); background: var(--teal-soft); border: 1px solid #cfe7e5; animation: fadeUp .5s cubic-bezier(.2,.7,.2,1) backwards; transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s; }
.milestone-card::before { content: ""; position: absolute; left: 18px; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--teal); }
.milestone-card span { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--petrol); font-weight: 600; }
.milestone-card strong { display: block; font-family: 'Sora', sans-serif; font-size: 1.6rem; color: var(--ink); margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.milestone-card small { font-size: .8rem; color: var(--green); font-weight: 600; }
.milestone-card.last { background: var(--petrol); border-color: var(--petrol); }
.milestone-card.last span, .milestone-card.last small { color: rgba(255,255,255,.8); }
.milestone-card.last strong { color: var(--teal); }
.milestone-card:hover { transform: translateY(-6px) scale(1.04); box-shadow: 0 16px 32px rgba(14,28,31,.12); }
body.present .milestone-card strong { font-size: 2rem; }

/* Tableau détaillé compact (assurance-vie, PEA, PER) : tient dans la largeur sans défilement */
.cards-1 { margin-top: 18px; }
details.detail-panel table { font-size: .82rem; }
details.detail-panel th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
details.detail-panel th, details.detail-panel td { padding: 7px 8px; }
details.detail-panel td input.cell { width: 88px; padding: 4px 6px; }
details.detail-panel td:first-child { white-space: nowrap; }
details.detail-panel td:first-child .badge { display: block; width: max-content; margin-top: 3px; font-size: .66rem; padding: 1px 7px; }
