/* Suxession Design System — DESIGN.md */

:root {
  --bg: #FAF8F5;
  --surface: #F0ECE6;
  --surface-elevated: #FFFFFF;
  --border: #E0DCD6;
  --text: #2D2926;
  --text-muted: #6B6560;
  --text-subtle: #9B9590;
  --primary: #1B4332;
  --primary-light: #2D6A4F;
  --accent: #C9A84C;
  --accent-light: #D4BA6A;
  --error: #B91C1C;
  --warning: #92400E;
  --success: #166534;
  --info: #1E40AF;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 var(--space-lg); width: 100%; }

/* Header */
.header { border-bottom: 1px solid var(--border); padding: var(--space-md) 0; background: var(--surface-elevated); }
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-display); font-size: 32px; font-weight: 400; color: var(--primary); letter-spacing: -0.01em; }
.toggle-pro { font-size: 13px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: var(--space-sm); min-height: 44px; padding: var(--space-xs) var(--space-sm); }
.toggle-pro input { accent-color: var(--primary); width: 20px; height: 20px; cursor: pointer; }

/* Main */
main { flex: 1; padding: var(--space-2xl) 0; }

/* Section titles */
.section-title { font-family: var(--font-display); font-size: 28px; font-weight: 400; margin-bottom: var(--space-xl); color: var(--text); }
.subsection-title { font-family: var(--font-display); font-size: 20px; font-weight: 400; margin: var(--space-xl) 0 var(--space-md); color: var(--text); }

/* Steps */
.steps { display: flex; gap: var(--space-xs); margin-bottom: var(--space-xl); overflow-x: auto; }
.step {
  flex: 1; min-width: 0; padding: 12px var(--space-md); text-align: center;
  font-size: 13px; font-weight: 500; border-radius: var(--radius-sm);
  color: var(--text-subtle); background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; white-space: nowrap; transition: all 0.15s ease-out;
  min-height: 44px;
}
.step.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.step.done { background: var(--surface-elevated); color: var(--primary); border-color: var(--primary); }

/* Form */
.form-step { display: none; border: none; min-height: 200px; }
.form-step.active { display: block; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
.form-group { margin-bottom: var(--space-lg); }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: var(--space-xs); }
.form-hint { font-size: 13px; color: var(--text-muted); margin-top: var(--space-xs); }
.form-input {
  width: 100%; padding: 10px var(--space-md); border: 1px solid var(--border);
  border-radius: var(--radius-md); font-family: var(--font-body); font-size: 15px;
  color: var(--text); background: var(--surface-elevated);
  min-height: 44px; /* touch target */
  transition: border-color 0.15s ease-out;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,67,50,0.1); }
.form-input::placeholder { color: var(--text-subtle); }
.form-input.error { border-color: var(--error); }
select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6560' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.checkbox-label { display: flex; align-items: center; gap: var(--space-sm); font-size: 14px; margin-bottom: var(--space-sm); cursor: pointer; }
.checkbox-label input { accent-color: var(--primary); width: 18px; height: 18px; }
.form-details { margin-top: var(--space-lg); }
.form-details summary {
  font-size: 14px; font-weight: 500; color: var(--primary); cursor: pointer;
  padding: var(--space-sm) 0; border-bottom: 1px solid var(--border); margin-bottom: var(--space-md);
}
.form-nav { display: flex; justify-content: space-between; margin-top: var(--space-xl); padding-top: var(--space-lg); border-top: 1px solid var(--border); }

/* Heritier / AV / Donation cards */
.item-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--space-md); margin-bottom: var(--space-md);
}
.item-card .item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-sm); }
.item-card .item-header span { font-weight: 500; font-size: 14px; }
.item-card .btn-remove { background: none; border: none; color: var(--error); cursor: pointer; font-size: 13px; padding: var(--space-xs); }
.item-card .form-grid { gap: var(--space-md); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-sm);
  padding: 10px var(--space-lg); border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; min-height: 44px;
  transition: all 0.15s ease-out; text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: var(--text); }
.btn-accent:hover { background: var(--accent-light); }
.btn-secondary { background: var(--surface-elevated); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text-subtle); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--surface); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible, .step:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Cards */
.card { background: var(--surface-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); margin-bottom: var(--space-xl); }
.stat-card { background: var(--surface-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: var(--space-xs); }
.stat-card .stat-value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-card .stat-value.accent { color: var(--accent); }

/* Data table */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left; padding: var(--space-sm) var(--space-md); font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid var(--border);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
}
.data-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .amount { text-align: right; font-weight: 500; white-space: nowrap; }
.data-table .total td { font-weight: 600; border-top: 2px solid var(--primary); border-bottom: none; }
.data-table .ref { font-family: var(--font-mono); font-size: 12px; color: var(--primary); }
.col-ref { display: table-cell; }

/* Scenarios */
.scenario-grid { margin-bottom: var(--space-xl); }
.scenario-cards-grid { display: grid; gap: var(--space-lg); }
.scenario-col { background: var(--surface-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-lg); }
.scenario-col.highlighted { border-color: var(--accent); border-width: 2px; }
.scenario-col h4 { font-family: var(--font-display); font-size: 18px; margin-bottom: var(--space-md); }
.scenario-item { display: flex; justify-content: space-between; padding: var(--space-xs) 0; font-size: 14px; }
.scenario-item .label { color: var(--text-muted); }
.scenario-item .value { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0; }
.scenario-item.total { border-top: 1px solid var(--border); padding-top: var(--space-sm); margin-top: var(--space-sm); font-weight: 600; }
.scenario-item.savings { color: var(--success); }
.scenario-item.eco-immediate { color: var(--text-muted); font-size: 13px; }

/* Filter pills */
.filter-section { margin-bottom: var(--space-md); }
.filter-label { font-size: 13px; color: var(--text-muted); margin-bottom: var(--space-xs); }
.filter-bar { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.filter-pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 9999px; background: var(--surface-elevated); font-size: 13px; color: var(--text-muted); cursor: pointer; transition: all 0.15s; }
.filter-pill:hover { border-color: var(--primary-light); color: var(--text); }
.filter-pill.active { opacity: 0.5; text-decoration: line-through; }

/* Results actions */
.results-actions { display: flex; gap: var(--space-md); margin-top: var(--space-xl); }

/* Pro only */
.pro-only { display: none; }
body.pro-mode .pro-only { display: block; }
body.pro-mode .col-ref { display: table-cell; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: var(--space-xl) 0; margin-top: var(--space-3xl); }
.disclaimer { font-size: 12px; color: var(--text-subtle); line-height: 1.5; max-width: 700px; }

/* Loading spinner */
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ══════════════════════════════════════════════════
   WIZARD LAYOUT
   ══════════════════════════════════════════════════ */

.wizard-layout {
  display: flex;
  min-height: calc(100vh - 80px); /* footer only, header hidden in wizard mode */
}

/* Hide header when wizard is visible (sidebar has its own branding) */
body.wizard-active .header { display: none; }

/* Sidebar */
.wizard-sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  padding: var(--space-xl) var(--space-lg);
  display: flex;
  flex-direction: column;
}
.wizard-sidebar-logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  color: var(--accent);
  margin-bottom: var(--space-2xl);
}
.wizard-sidebar-nav { flex: 1; }
.wizard-sidebar-item {
  padding: var(--space-sm) 0;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.wizard-sidebar-item.active { color: #fff; font-weight: 500; }
.wizard-sidebar-item.done { color: rgba(255,255,255,0.8); }
.wizard-sidebar-dot { font-size: 12px; width: 16px; text-align: center; }
.wizard-sidebar-item.clickable { cursor: pointer; }
.wizard-sidebar-item.clickable:hover { color: #fff; }
.wizard-sidebar-footer {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin-top: auto;
  padding-top: var(--space-xl);
}
.wizard-sidebar-version {
  font-size: 10px;
  opacity: 0.7;
}

/* Content area */
.wizard-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-xl);
  min-height: 0;
}
.wizard-main {
  max-width: 580px;
  width: 100%;
}

/* Fade animation between questions */
.wizard-main {
  animation: wizardFadeIn 200ms ease-out;
}
@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* Skip message banner */
.wizard-skip-banner {
  background: rgba(27,67,50,0.05);
  border-left: 3px solid var(--primary);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-lg);
  font-size: 13px;
  color: var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Question elements */
.wizard-counter {
  display: none;
}
.wizard-debug-counter {
  font-size: 11px;
  color: var(--text-subtle, rgba(0,0,0,0.2));
  text-align: right;
  margin-top: var(--space-xl);
}
.wizard-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 400;
  margin-bottom: var(--space-md);
  color: var(--text);
  line-height: 1.3;
}
.wizard-hint {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}
.wizard-context-note {
  font-size: 14px;
  color: var(--text);
  background: var(--surface-alt, #f0f5ff);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  margin-bottom: var(--space-lg);
  line-height: 1.5;
}
.wizard-context-note.warning {
  border-left-color: var(--error);
  background: #fff5f5;
}

/* Choice buttons */
.wizard-choices {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}
.wizard-choice {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  transition: all 0.15s ease-out;
  min-height: 52px;
}
.wizard-choice:hover {
  border-color: var(--primary);
  background: rgba(27,67,50,0.06);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(27,67,50,0.08);
}
.wizard-choice:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.wizard-choice-key {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.wizard-choice-content { flex: 1; }
.wizard-choice-label { display: block; font-size: 15px; font-weight: 500; color: var(--text); }
.wizard-choice-hint { display: block; font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Inputs */
.wizard-input-wrap {
  position: relative;
  margin-bottom: var(--space-lg);
}
.wizard-input {
  width: 100%;
  padding: 14px var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 18px;
  color: var(--text);
  background: var(--surface-elevated);
  transition: border-color 0.15s ease-out;
}
.wizard-input-wrap:has(.wizard-input-suffix) .wizard-input {
  padding-right: 48px;
}
.wizard-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,67,50,0.1);
}
.wizard-input-suffix {
  position: absolute;
  right: var(--space-lg);
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
select.wizard-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B6560' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* Group / multi-fields */
.wizard-group, .wizard-item-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.wizard-field { margin-bottom: var(--space-sm); }
.wizard-field-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}
.wizard-field .wizard-input { font-size: 15px; padding: 10px var(--space-md); }

/* Multi-field sum (patrimoine décomposé) */
.wizard-multi-field-sum .wizard-field { margin-bottom: var(--space-sm); }
.wizard-multi-field-sum .wizard-input { text-align: right; font-variant-numeric: tabular-nums; }
.wizard-total-separator { border: none; border-top: 1px solid var(--border); margin: var(--space-lg) 0 var(--space-md) 0; }
.wizard-total { display: flex; justify-content: space-between; align-items: center; font-size: 18px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.wizard-info-banner {
  background: rgba(30, 64, 175, 0.05);
  border-left: 3px solid var(--info, #1E40AF);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-lg);
  font-size: 13px;
  color: var(--info, #1E40AF);
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}

/* Checkbox cards (international gate) */
.wizard-checkbox-cards { display: flex; flex-direction: column; gap: var(--space-sm); }
.wizard-checkbox-card {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-elevated);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.15s ease-out;
}
.wizard-checkbox-card:hover { border-color: var(--primary); }
.wizard-checkbox-card.checked { border-color: var(--primary); background: rgba(27,67,50,0.04); }
.wizard-checkbox-card input[type="checkbox"] {
  width: 20px; height: 20px; flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.wizard-checkbox-card-label { font-size: 15px; font-weight: 500; color: var(--text); }
.wizard-checkbox-card-hint { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.wizard-checkbox-skip { font-size: 13px; color: var(--text-subtle); margin-top: var(--space-sm); text-align: center; }

/* Item cards (for multi-item) */
.wizard-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  font-size: 14px;
}
.wizard-item-actions {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
}
.wizard-item-card .btn-remove,
.wizard-item-card .btn-edit {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: var(--space-xs);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wizard-item-card .btn-remove { color: var(--error); }
.wizard-item-card .btn-edit { color: var(--text-subtle); }
.wizard-item-card .btn-edit:hover { color: var(--primary-light); }

/* Navigation */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}
.wizard-key-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-subtle);
  margin-top: var(--space-sm);
}

/* Recap */
.wizard-recap { margin-bottom: var(--space-xl); }
.wizard-recap-section {
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}
.wizard-recap-heading {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: var(--space-sm);
}
.wizard-recap-line {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  font-size: 14px;
}
.wizard-recap-label { color: var(--text-muted); }
.wizard-recap-value { font-weight: 500; font-variant-numeric: tabular-nums; }
.wizard-recap-total { font-weight: 600; border-top: 1px solid var(--border); padding-top: var(--space-sm); margin-top: var(--space-xs); }
.wizard-recap-total .wizard-recap-label { color: var(--text); }

/* Convention banner in results */
.convention-banner {
  background: rgba(27,67,50,0.05);
  border: 1px solid rgba(27,67,50,0.15);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-xl);
  font-size: 14px;
  color: var(--primary);
}
.convention-banner strong { font-weight: 600; }
.convention-banner.alerte-denoncee {
  background: rgba(146,64,14,0.08);
  border-color: rgba(146,64,14,0.25);
  color: var(--warning);
}

/* Mobile progress bar */
.wizard-mobile-progress {
  display: none;
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-elevated);
  border-bottom: 1px solid var(--border);
}
.wizard-mobile-dots {
  display: flex;
  gap: var(--space-xs);
  justify-content: center;
  margin-bottom: var(--space-xs);
}
.wizard-mobile-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.wizard-mobile-dot.active { background: var(--primary); }
.wizard-mobile-dot.done { background: var(--accent); }
.wizard-mobile-section {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .wizard-sidebar { display: none; }
  .wizard-mobile-progress { display: block; }
  .wizard-content { padding: var(--space-lg); }
  .wizard-title { font-size: 24px; }
  .wizard-group, .wizard-item-form { grid-template-columns: 1fr; }
  .wizard-nav {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: var(--space-md);
    border-top: 1px solid var(--border);
    margin: 0 calc(-1 * var(--space-lg));
  }
  .wizard-nav .btn { flex: 1; min-height: 48px; }
  .wizard-key-hint { display: none; }
}

/* ── Multi-item sub-form ── */
.wizard-subform {
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-lg);
  margin-top: var(--space-md);
}
.wizard-subform-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-md);
}
.wizard-subform-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}
.wizard-item-card--editing {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.wizard-empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--text-muted);
  font-size: 14px;
}
.wizard-empty-state p {
  margin-bottom: var(--space-md);
}

/* ── Validation messages ── */
.wizard-validation {
  min-height: 0;
  transition: min-height 150ms ease-out;
}
.wizard-validation-error {
  color: var(--error);
  font-size: 13px;
  margin-top: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: rgba(185, 28, 28, 0.06);
  border-left: 3px solid var(--error);
  border-radius: var(--radius-sm);
}
.wizard-validation-warning {
  color: var(--warning);
  font-size: 13px;
  margin-top: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: rgba(146, 64, 14, 0.06);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
}

/* ── Calc error (API errors) ── */
.wizard-calc-error {
  color: var(--error);
  font-size: 13px;
  padding: var(--space-sm) var(--space-md);
  background: rgba(185, 28, 28, 0.06);
  border-left: 3px solid var(--error);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
  white-space: pre-line;
}

/* ── Tooltip ⓘ ── */
.wizard-tooltip-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  vertical-align: super;
  line-height: 1;
}
.wizard-tooltip-text {
  display: none;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  padding: var(--space-sm);
  background: var(--surface);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.wizard-tooltip-text.visible {
  display: block;
}
/* Desktop: show on hover */
@media (hover: hover) {
  .wizard-tooltip-toggle:hover + .wizard-tooltip-text,
  .wizard-tooltip-toggle:focus + .wizard-tooltip-text {
    display: block;
  }
}

/* ── Auto-save badge ── */
.wizard-save-badge {
  font-size: 12px;
  color: var(--success);
  padding: var(--space-xs) var(--space-sm);
  opacity: 0;
  transition: opacity 200ms ease-out;
}
.wizard-save-badge.visible {
  opacity: 1;
}

/* ── Resume banner ── */
.wizard-resume-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  max-width: 400px;
  margin: var(--space-2xl) auto;
}
.wizard-resume-banner p {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text);
  margin-bottom: var(--space-lg);
}
.wizard-resume-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

/* ── Recap edit button ── */
.recap-edit {
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 14px;
  padding: var(--space-xs);
  margin-left: var(--space-sm);
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}
.recap-edit:hover { color: var(--primary-light); }

/* ── Recap guide ── */
.wizard-recap-guide {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: rgba(22, 101, 52, 0.05);
  border-radius: var(--radius-sm);
}

/* ── Beneficiaires ── */
.wizard-beneficiaires {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.wizard-benef-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
}
.wizard-benef-row label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 14px;
}
.wizard-benef-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}
.wizard-benef-part {
  font-family: var(--font-body);
  font-size: 14px;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Scenario descriptions ── */
.scenario-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: var(--space-xs) 0 var(--space-md);
  line-height: 1.4;
}
.scenario-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}
.scenario-empty p:first-child {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--text);
  margin-bottom: var(--space-md);
}

/* ── Badges (strategique / immediat) ── */
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-strategique {
  background: var(--primary);
  color: var(--bg);
}
.badge-immediat {
  background: var(--accent);
  color: var(--text);
}

/* ── Scenario card header ── */
.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
}

/* ── Articles ref sous le titre ── */
.scenario-articles {
  font-size: 12px;
  color: var(--text-muted);
  margin: var(--space-xs) 0 var(--space-md);
  font-family: var(--font-mono);
}

/* ── Expand panel ── */
.btn-expand {
  width: 100%;
  text-align: center;
  font-size: 13px;
  margin-top: var(--space-sm);
}
.expand-panel {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}
.data-table-compact { font-size: 13px; }

/* ── Detail sections (description, conditions, risques) ── */
.detail-section {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.detail-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}
.detail-section-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.detail-conditions {
  border-left: 3px solid var(--info);
}
.detail-risques {
  border-left: 3px solid var(--warning);
}
.data-table-compact th,
.data-table-compact td { padding: var(--space-xs) var(--space-sm); }

/* ── Liquidation table ── */
.liquidation-section { margin-top: var(--space-md); }
.liq-title { font-family: var(--font-display); font-size: 16px; margin-bottom: var(--space-sm); }
.liq-etape { text-align: center; color: var(--text-muted); }
.liq-article { font-family: var(--font-mono); font-size: 11px; }
.liq-detail { font-size: 12px; color: var(--text-muted); }
.liq-detail-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-style: italic; }

/* ── Copy button ── */
.btn-copy {
  font-size: 12px;
  margin-top: var(--space-sm);
  width: 100%;
  text-align: center;
}

/* ── Skeleton loader ── */
.scenario-skeleton {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--text-muted);
}
.scenario-skeleton .spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: var(--space-sm);
}

/* ══════════════════════════════════════════════════
   EXCLUSION WIZARD (Typeform-style)
   ══════════════════════════════════════════════════ */
.exclusion-wizard {
  max-width: 580px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
  grid-column: 1 / -1;
  animation: wizardFadeIn 200ms ease-out;
}
.exclusion-progress {
  width: 100%;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  margin-bottom: var(--space-lg);
  overflow: hidden;
}
.exclusion-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.3s ease-out;
}
.exclusion-counter {
  font-size: 12px;
  color: var(--text-subtle, rgba(0,0,0,0.3));
  margin-bottom: var(--space-sm);
}
.exclusion-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: var(--space-md);
  color: var(--text);
  line-height: 1.3;
}
.exclusion-hint {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}
.exclusion-context {
  font-size: 13px;
  color: var(--primary);
  background: rgba(27,67,50,0.06);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-lg);
  font-variant-numeric: tabular-nums;
}
.exclusion-choices {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}
.exclusion-choice {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s ease-out;
  min-height: 52px;
}
.exclusion-choice:hover {
  border-color: var(--primary);
  background: rgba(27,67,50,0.06);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(27,67,50,0.08);
}
.exclusion-choice:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.exclusion-choice-skip {
  color: var(--text-muted);
  font-weight: 400;
}
.exclusion-choice-key {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  flex-shrink: 0;
}
.exclusion-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* ── Sous-question valeur ── */
.valeur-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  max-width: 320px;
}
.valeur-input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  font-size: 18px;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  color: var(--text-primary);
  text-align: right;
  transition: border-color 0.15s ease-out;
  min-height: 48px;
}
.valeur-input:focus {
  outline: none;
  border-color: var(--primary);
}
.valeur-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}
.valeur-suffix {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
}

/* ── Sélection pays résidence ── */
.pays-selection {
  margin-bottom: var(--space-xl);
}
.pays-selection-actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.btn-sm {
  font-size: 12px;
  padding: var(--space-xs) var(--space-sm);
  min-height: 32px;
}
.pays-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
}
.pays-checkbox-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-elevated);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease-out;
  min-height: 44px;
}
.pays-checkbox-label:hover {
  border-color: var(--primary);
  background: rgba(27,67,50,0.04);
}
.pays-checkbox-label input {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
}
.pays-checkbox-label span { display: flex; flex-direction: column; }
.pays-convention-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}
.pays-denoncee { border-color: var(--warning, #e6a817); }
.pays-denoncee .pays-convention-hint { color: var(--warning, #e6a817); }
.pays-sans-convention .pays-convention-hint { color: var(--text-subtle, #999); }

/* ── Pays équivalents (agrégation résidence) ── */
.pays-equivalents {
  font-size: 12px;
  color: var(--primary);
  background: rgba(27,67,50,0.06);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  line-height: 1.4;
}

/* ── Convention alert (dans carte) ── */
.convention-alert {
  font-size: 12px;
  color: var(--error);
  background: color-mix(in srgb, var(--error) 8%, transparent);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  margin: var(--space-xs) 0 var(--space-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr; }
  .scenario-cards-grid { grid-template-columns: 1fr; }
  .scenario-col { width: 100%; }
  .filter-bar { gap: var(--space-xs); }
  .expand-panel { overflow-x: auto; }
  .expand-panel .data-table { min-width: 500px; }
  .steps { gap: 2px; }
  .step { font-size: 11px; padding: var(--space-sm) var(--space-xs); }
  .section-title { font-size: 24px; }
  .col-ref { display: none; }
  body.pro-mode .col-ref { display: none; }
  .exclusion-wizard { padding: var(--space-xl) var(--space-md); }
  .exclusion-title { font-size: 20px; }
}

/* ── Persona-specific results ── */

.second-deces-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}
.second-deces-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.prochaines-etapes {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: var(--surface);
  border-radius: var(--radius-md);
}
.etapes-list {
  margin: var(--space-sm) 0 0 var(--space-md);
  padding: 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}
.etapes-list li {
  margin-bottom: var(--space-xs);
}

.freemium-teaser {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  background: linear-gradient(135deg, rgba(27,67,50,0.04), rgba(27,67,50,0.08));
  border: 1px solid rgba(27,67,50,0.15);
  border-radius: var(--radius-md);
  text-align: center;
}
.freemium-teaser p {
  margin: 0 0 var(--space-md);
  font-size: 15px;
  color: var(--text);
}
.freemium-teaser .btn {
  margin-top: var(--space-sm);
}

.fractionne-card {
  padding: var(--space-lg);
}
.fractionne-note {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

.pro-liquidation-scope {
  margin-top: var(--space-xl);
  padding: var(--space-md);
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════
   SPRINT UX GAPS — P0/P1/P2 additions
   ══════════════════════════════════════════════════ */

/* P1-8: Stat cards 4 columns */
.stat-cards { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) { .stat-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .stat-cards { grid-template-columns: 1fr; } }

/* Optimization page: top 3 grid */
.optim-top3-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-lg); margin-bottom: var(--space-lg); }

/* Compact scenarios table */
.optim-compact-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: var(--space-md); }
.optim-compact-table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; padding: var(--space-sm) var(--space-md); border-bottom: 2px solid var(--border); }
.optim-compact-table th.col-amount { text-align: right; }
.optim-compact-table td { padding: var(--space-sm) var(--space-md); border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); vertical-align: middle; }
.optim-compact-table td.col-amount { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.optim-compact-table td.col-eco { text-align: right; font-weight: 600; color: var(--success); font-variant-numeric: tabular-nums; white-space: nowrap; }
.optim-compact-table tr.top3-row { display: none; }
.optim-compact-table .rank-cell { font-weight: 600; color: var(--text-muted); width: 40px; }
.optim-compact-table .btn-expand-row { font-size: 12px; padding: 4px 10px; }
.optim-compact-table .hidden-row { display: none; }
.optim-compact-table .hidden-row.visible { display: table-row; }

/* Lever tags in cards */
.lever-tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin: var(--space-sm) 0; }
.lever-tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }

/* Per-lever fiches in expand */
.lever-fiche { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-md); margin-bottom: var(--space-sm); }
.lever-fiche-title { font-family: var(--font-body); font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: var(--space-xs); }
.lever-fiche-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: var(--space-sm); }
.lever-fiche-meta { display: flex; flex-wrap: wrap; gap: var(--space-lg); font-size: 12px; }
.lever-fiche-conditions { color: var(--info); flex: 1 1 200px; min-width: 0; }
.lever-fiche-risques { color: var(--warning); flex: 1 1 200px; min-width: 0; }
.lever-fiche-conditions strong, .lever-fiche-risques strong { font-weight: 600; display: block; margin-bottom: 2px; text-transform: uppercase; letter-spacing: 0.03em; font-size: 11px; }

/* Pays grouped list */
.pays-group { margin: var(--space-sm) 0; }
.pays-group-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-bottom: var(--space-xs); }
.pays-group-list { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.pays-chip { padding: 2px 8px; border-radius: var(--radius-sm); font-size: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }
.pays-chip.denoncee { border-color: var(--warning); color: var(--warning); }

/* Summary waterfall for optimization */
.optim-hero-savings { text-align: center; padding: var(--space-lg) var(--space-md); margin-bottom: var(--space-lg); }
.optim-hero-label { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: var(--space-xs); }
.optim-hero-value { font-family: var(--font-display); font-size: 3rem; font-weight: 400; color: var(--success); line-height: 1.1; }
.optim-hero-sub { font-size: 15px; color: var(--text-muted); margin-top: var(--space-xs); }
.optim-waterfall { display: flex; align-items: flex-end; gap: var(--space-lg); padding: var(--space-lg); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--space-lg); }
.optim-waterfall-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); }
.optim-waterfall-bar { width: 100%; border-radius: var(--radius-sm) var(--radius-sm) 0 0; min-height: 8px; transition: height 0.3s ease-out; }
.optim-waterfall-bar.base { background: var(--surface-elevated); border: 1px solid var(--border); }
.optim-waterfall-bar.optimise { background: var(--primary); }
.optim-waterfall-label { font-size: 13px; color: var(--text-muted); text-align: center; }
.optim-waterfall-value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
.optim-waterfall-value.success { color: var(--success); }
.optim-waterfall-arrow { font-size: 14px; color: var(--success); font-weight: 600; text-align: center; padding: 0 var(--space-sm); flex-shrink: 0; align-self: center; }
@media (max-width: 768px) {
  .optim-waterfall { flex-direction: column; align-items: stretch; }
  .optim-waterfall-arrow { transform: rotate(90deg); }
  .lever-fiche-meta { flex-direction: column; gap: var(--space-sm); }
}

/* P0-5: Scenarios 1-column layout — override for top3 */
.scenario-cards-grid { grid-template-columns: 1fr !important; }


/* P1-13: Montant principal prominent */
.scenario-amount-main {
  font-size: 24px;
  font-weight: 700;
  color: var(--success);
  margin: var(--space-xs) 0;
  font-variant-numeric: tabular-nums;
}

/* P1-14: Description visible in card body */
.scenario-desc-visible {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: var(--space-sm) 0 var(--space-md);
}

/* P1-15: Expand panel animation */
.expand-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s ease-out, opacity 0.25s ease-out;
}
.expand-panel[hidden] {
  display: block !important;
  max-height: 0;
  opacity: 0;
  padding: 0;
  margin: 0;
  border: none;
}
.expand-panel.expanded {
  max-height: 10000px;
  opacity: 1;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

/* P0-6: Avant/après table */
.avant-apres-table { width: 100%; font-size: 13px; border-collapse: collapse; margin: var(--space-md) 0; }
.avant-apres-table th { text-align: left; font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; padding: var(--space-xs) var(--space-sm); border-bottom: 1px solid var(--border); }
.avant-apres-table td { padding: var(--space-xs) var(--space-sm); border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.avant-apres-table .col-diff { color: var(--success); font-weight: 600; }

/* P1-9: Liquidation sections colorées */
.liq-section-header {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
  border-radius: var(--radius-sm);
}
.liq-section-optimisation { background: rgba(22,163,74,0.08); color: var(--success, #16A34A); }
.liq-section-assiette { background: rgba(27,67,50,0.06); color: var(--primary); }
.liq-section-liquidation { background: rgba(196,164,132,0.15); color: var(--accent); }
.liq-section-hors_succession { background: rgba(146,64,14,0.06); color: var(--warning); }
.liq-section-recouvrement { background: rgba(30,64,175,0.06); color: var(--info, #1E40AF); }

/* P1-10: Prochaines étapes structurées */
.etape-structured {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.etape-structured:last-child { border-bottom: none; }
.etape-number {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: var(--bg);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.etape-content { flex: 1; }
.etape-title { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 2px; }
.etape-desc { font-size: 13px; color: var(--text-muted); line-height: 1.4; }
.etape-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: var(--space-xs);
}
.etape-badge-urgent { background: rgba(185,28,28,0.1); color: var(--error); }
.etape-badge-info { background: rgba(30,64,175,0.08); color: var(--info, #1E40AF); }
.etape-badge-success { background: rgba(22,101,52,0.08); color: var(--success); }

/* P1-11: Option conjoint enrichie */
.conjoint-receives {
  font-size: 14px;
  color: var(--text);
  margin-top: var(--space-xs);
  font-weight: 500;
}
.conjoint-taux {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}



/* P2-17: Countdown */
.countdown-text {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* P2-18: Paiement fractionné card */
.fractionne-stat-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--success);
}

/* P2-19: Teaser horizontal */
.freemium-teaser-horizontal {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  text-align: left;
}
.freemium-teaser-horizontal p { flex: 1; margin: 0; }
.freemium-teaser-horizontal .btn { flex-shrink: 0; }


/* P2-21: Actions à réaliser */
.scenario-actions-list {
  margin: var(--space-md) 0;
  padding: 0;
  list-style: none;
}
.scenario-actions-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-xs) 0;
  font-size: 13px;
  color: var(--text);
}
.scenario-actions-list li::before {
  content: '→';
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
}

/* P2-22: Badge NOUVEAU */
.badge-nouveau {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-left: var(--space-xs);
}

/* P2-23: Auto-skip feedback */
.autoskip-feedback {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-muted);
  font-size: 14px;
  animation: wizardFadeIn 200ms ease-out;
}
.autoskip-feedback .skip-icon {
  font-size: 20px;
  margin-bottom: var(--space-xs);
}

/* P2-24: Trace dark theme */
.trace-dark {
  background: #1a1a2e;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 2;
}
.trace-dark .trace-line { padding: 2px 0; }
.trace-dark .trace-call { color: #7dd3fc; font-weight: 500; }
.trace-dark .trace-decision { background: rgba(251,191,36,0.1); border-left: 2px solid #fbbf24; padding-left: 8px; margin: 4px 0; }
.trace-dark .trace-article { color: #fbbf24; font-weight: 600; }
.trace-dark .trace-decision-text { color: #e2e8f0; font-style: italic; }
.trace-dark .trace-var-name { color: #94a3b8; }
.trace-dark .trace-var-value { color: #f0fdf4; font-weight: 600; }

/* P0-1: 2nd décès detailed table */
.second-deces-table { width: 100%; margin: var(--space-md) 0; }

/* P2-25: Compteur "sur Y" */
.wizard-counter-total { color: var(--text-subtle); }

/* P2-26: Répartition géo sections */
.geo-section-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: var(--space-md);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}
.geo-progress {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
  margin: var(--space-xs) 0 var(--space-md);
}
.geo-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease-out;
}

/* P2-4: TEPA warning banner */
.tepa-warning {
  background: rgba(146,64,14,0.08);
  border-left: 3px solid var(--warning);
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-sm);
  font-size: 13px;
  color: var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════
   PLANIFICATEUR — Restitution UX revamp
   ══════════════════════════════════════════════════ */

/* Hero KPI card */
.hero-kpi-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
  margin-bottom: var(--space-xl);
}
.hero-kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
}
.hero-kpi-value {
  font-family: var(--font-display);
  font-size: 3.5rem; /* Display XL per DESIGN.md */
  font-weight: 400;
  color: var(--text);
  margin-bottom: var(--space-sm);
}
.hero-kpi-sub {
  display: flex;
  gap: var(--space-xl);
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
  font-variant-numeric: tabular-nums;
}

/* Waterfall bars */
.waterfall-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.waterfall-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}
.waterfall-row-label {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.waterfall-bar {
  height: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  background: var(--surface);
}
.waterfall-segment-net {
  background: var(--primary);
  transition: width 0.4s ease-out;
}
.waterfall-segment-droits {
  background: var(--accent);
  transition: width 0.4s ease-out;
}
.waterfall-amounts {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.waterfall-amount-net {
  color: var(--primary);
  font-weight: 600;
}
.waterfall-amount-droits {
  color: var(--accent);
  font-weight: 600;
}

/* Simplified héritier table (planificateur) */
.table-simple-planif th,
.table-simple-planif td {
  padding: var(--space-sm) var(--space-md);
}
.table-simple-planif .col-net {
  font-weight: 600;
}

/* Detail expand toggle */
.detail-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  padding: var(--space-sm) 0;
  margin-top: var(--space-sm);
}
.detail-toggle:hover { color: var(--primary-light); }
.detail-toggle::before {
  content: '▸';
  display: inline-block;
  transition: transform 0.15s ease-out;
}
.detail-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}
.detail-expand-content {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.2s ease-out;
}
.detail-expand-content.expanded {
  max-height: 10000px;
  opacity: 1;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

/* Option conjoint — planificateur focus on net transmis */
.conjoint-net-transmis {
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin: var(--space-sm) 0;
}

/* 2nd décès detail section */
.second-deces-expand {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

/* Freemium teaser — optimisation focus */
.freemium-teaser .freemium-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-kpi-value { font-size: 28px; }
  .waterfall-bar { height: 24px; }
  .waterfall-amounts { font-size: 13px; }
  .conjoint-net-transmis { font-size: 20px; }
}
