/* ══════════════════════════════════════════════
   TontiPay Invest — Design System
   ══════════════════════════════════════════════ */

:root {
  --bg: #0F172A;
  --bg-card: #1E293B;
  --bg-elevated: #334155;
  --surface: #1E293B;
  --border: #334155;
  --accent: #16A34A;
  --accent-hover: #15803D;
  --accent-light: #22C55E;
  --text: #F9FAFB;
  --text-secondary: #D1D5DB;
  --muted: #9CA3AF;
  --danger: #EF4444;
  --warning: #F59E0B;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.25);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: .2s ease;
}

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

html { scroll-behavior:smooth; }

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

#app { flex:1; display:flex; flex-direction:column; }
#main-content {
  flex:1;
  --bg: #0B1121;
  --bg-card: #1E293B;
  --bg-elevated: #334155;
  --surface: #1A2332;
  --border: #2A3A4E;
  background: var(--bg);
}

a { color:var(--accent-light); text-decoration:none; transition:color var(--transition); }
a:hover { color:#fff; }
img { max-width:100%; display:block; }

/* ── Container ── */
.container { width:100%; max-width:1200px; margin:0 auto; padding:0 20px; }

/* ── Typography ── */
.text-center { text-align:center; }
.text-accent { color:var(--accent-light); }
.section-title { font-size:1.75rem; font-weight:700; margin-bottom:32px; text-align:center; }

/* ── Buttons ── */
.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 22px;
  font-size:14px;
  font-weight:600;
  border:none;
  border-radius:var(--radius-sm);
  cursor:pointer;
  transition:all var(--transition);
  text-decoration:none;
  font-family:var(--font);
  line-height:1.4;
}
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:var(--accent-hover); color:#fff; }
.btn-primary:disabled { opacity:.5; cursor:not-allowed; }
.btn-outline { background:transparent; color:var(--text); border:1px solid var(--border); }
.btn-outline:hover { border-color:var(--accent); color:var(--accent-light); }
.btn-ghost { background:transparent; color:var(--text-secondary); }
.btn-ghost:hover { background:var(--surface); color:#fff; }
.btn-lg { padding:14px 32px; font-size:16px; }
.btn-sm { padding:7px 16px; font-size:13px; }
.btn-full { width:100%; }

/* ── Header ── */
#main-header {
  background:var(--bg);
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:100;
}
.header-inner {
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:64px;
}
.logo { display:flex; align-items:center; gap:8px; color:#fff; font-weight:700; font-size:18px; }
.logo:hover { color:#fff; }
.logo-img { height:36px; width:auto; display:block; border-radius:4px; }
.logo-text { font-size:16px; font-weight:700; color:#fff; }
@media (max-width:480px){ .logo-text { display:none; } }
.logo-icon {
  width:28px; height:28px;
  display:flex; align-items:center; justify-content:center;
  font-size:16px;
}
.logo-accent { color:var(--accent-light); }
.nav { display:flex; align-items:center; gap:8px; }
.nav a { color:var(--muted); font-size:14px; font-weight:500; padding:8px 14px; border-radius:var(--radius-sm); transition:all var(--transition); }
.nav a:hover { color:#fff; background:var(--surface); }
.nav .btn-primary { color:#fff; }
.nav .btn-primary:hover { background:var(--accent-hover); }
.auth-only { display:none; }
.logged-in .auth-only { display:inline-flex; }
.logged-out .no-auth-only { display:inline-flex; }
.no-auth-only { display:none; }

/* ── Nav email / avatar ── */
.nav-email { max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.avatar-xs {
  width:24px; height:24px; border-radius:50%;
  background:var(--accent); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700; flex-shrink:0;
}

/* ── Mobile menu ── */
.mobile-menu-btn {
  display:none;
  flex-direction:column;
  gap:4px;
  background:none;
  border:none;
  cursor:pointer;
  padding:8px;
}
.mobile-menu-btn span {
  display:block;
  width:22px; height:2px;
  background:var(--text);
  border-radius:2px;
  transition:var(--transition);
}
.mobile-menu-btn.open span:nth-child(1) { transform:rotate(45deg) translate(4px,4px); }
.mobile-menu-btn.open span:nth-child(2) { opacity:0; }
.mobile-menu-btn.open span:nth-child(3) { transform:rotate(-45deg) translate(4px,-4px); }

@media (max-width:768px) {
  .mobile-menu-btn { display:flex; }
  .nav { display:none; position:absolute; top:64px; left:0; right:0; background:var(--bg); border-bottom:1px solid var(--border); flex-direction:column; padding:12px 20px; gap:4px; }
  .nav.open { display:flex; }
  .nav a { width:100%; }
}

/* ── Footer ── */
#main-footer {
  background:var(--bg-card);
  border-top:1px solid var(--border);
  padding:24px 0;
  margin-top:48px;
}
.footer-inner { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; font-size:13px; color:var(--muted); }
.footer-brand { display:flex; align-items:center; gap:10px; font-weight:500; }
.footer-icon { height:32px; width:auto; border-radius:4px; }
.footer-links { display:flex; gap:16px; }
.footer-links a { color:var(--muted); font-size:13px; }
.footer-links a:hover { color:var(--accent-light); }
.footer-copy { width:100%; text-align:center; font-size:12px; }
.footer-social { width:100%; display:flex; align-items:center; justify-content:center; gap:12px; padding-top:12px; border-top:1px solid var(--border); margin-top:8px; }
.footer-social-label { font-size:12px; color:var(--muted); }
.social-link { color:var(--muted); transition:color var(--transition); display:flex; }
.social-link:hover { color:var(--accent-light); }
[dir="rtl"] .footer-social { flex-direction:row-reverse; }

/* ── Hero ── */
.hero {
  padding:100px 0 80px;
  text-align:center;
  background: linear-gradient(180deg, #0B1121 0%, var(--bg) 100%);
  position:relative;
  overflow:hidden;
}
.hero::before {
  content:''; position:absolute; top:-50%; left:-50%; width:200%; height:200%;
  background:radial-gradient(ellipse at 30% 50%, rgba(22,163,74,.08) 0%, transparent 60%);
  pointer-events:none;
}
.hero-split { display:flex; align-items:center; gap:48px; position:relative; z-index:1; }
.hero-text { flex:1; text-align:left; }
.hero h1 { font-size:2.8rem; font-weight:800; line-height:1.15; margin-bottom:16px; }
.hero h1 span { color:var(--accent-light); }
.hero-sub { color:var(--muted); font-size:1.1rem; max-width:540px; margin:0 0 32px; line-height:1.7; }
.hero-actions { display:flex; gap:12px; flex-wrap:wrap; }
.hero-actions .btn-primary {
  background:linear-gradient(135deg,var(--accent),var(--accent-light));
  box-shadow:0 4px 20px rgba(22,163,74,.3);
}
.hero-actions .btn-primary:hover { box-shadow:0 6px 28px rgba(22,163,74,.45); transform:translateY(-2px); }
.hero-visual { flex:0 0 320px; }
.hero-stats-card {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:28px 24px; box-shadow:var(--shadow);
}
.hsc-row { display:flex; justify-content:space-between; padding:10px 0; font-size:14px; }
.hsc-row + .hsc-row { border-top:1px solid var(--border); }
.hsc-row span { color:var(--muted); }
.hsc-row strong { color:var(--accent-light); font-weight:700; }

/* ── Trust bar ── */
.trust-bar { background:var(--bg-card); border-top:1px solid var(--border); border-bottom:1px solid var(--border); padding:28px 0; }
.trust-bar-inner { display:flex; align-items:center; justify-content:space-around; gap:16px; flex-wrap:wrap; }
.trust-item { display:flex; align-items:center; gap:8px; font-size:14px; color:var(--text-secondary); }
.trust-item strong { font-size:1.5rem; font-weight:700; color:var(--accent-light); }
.trust-divider { width:1px; height:32px; background:var(--border); }
@media (max-width:600px) { .trust-divider { display:none; } .trust-item { width:45%; justify-content:center; } }

/* ── How section ── */
.how-section { background:var(--bg); }
.how-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.how-card {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:32px 24px; text-align:center; transition:all var(--transition); position:relative;
}
.how-card:hover { border-color:var(--accent); transform:translateY(-4px); box-shadow:0 8px 32px rgba(0,0,0,.2); }
.how-num {
  width:48px; height:48px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--accent-light));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:20px; font-weight:700; margin:0 auto 16px;
  box-shadow:0 4px 12px rgba(22,163,74,.3);
}
.how-card h3 { font-size:16px; font-weight:600; margin-bottom:8px; }
.how-card p { font-size:14px; color:var(--muted); line-height:1.6; }

/* ── Section (generic) ── */
.section { padding:64px 0; }

/* ── Simulator ── */
.simulator-section { background:var(--bg-card); }
.simulator {
  background:var(--bg); border:1px solid var(--border); border-radius:var(--radius);
  padding:32px; display:flex; flex-direction:column; gap:24px;
}
.simulator-row { display:grid; grid-template-columns:1fr 1fr; gap:32px; }
.simulator-field label { display:block; font-size:14px; font-weight:500; color:var(--text-secondary); margin-bottom:12px; }
.simulator-field input[type="range"] {
  width:100%; height:6px; -webkit-appearance:none; appearance:none;
  background:var(--surface); border-radius:3px; outline:none;
}
.simulator-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance:none; width:20px; height:20px; border-radius:50%;
  background:var(--accent-light); cursor:pointer; box-shadow:0 2px 8px rgba(22,163,74,.4);
}
.simulator-values { display:flex; justify-content:space-between; font-size:12px; color:var(--muted); margin-top:6px; }
.simulator-result {
  display:flex; gap:24px; background:var(--bg-card); border-radius:var(--radius-sm);
  padding:20px 24px; border:1px solid var(--border);
}
.sim-col { flex:1; text-align:center; }
.sim-label { display:block; font-size:12px; color:var(--muted); margin-bottom:4px; }
.sim-value { font-size:1.3rem; font-weight:700; color:var(--text); }
.sim-value.accent { color:var(--accent-light); }

/* ── Diaspora ── */
.diaspora-section { background:var(--bg); }
.diaspora-card {
  display:flex; align-items:center; gap:40px;
  background:linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border:1px solid var(--border); border-radius:var(--radius); padding:48px;
}
.diaspora-content { flex:1; }
.diaspora-content h2 { font-size:1.6rem; font-weight:700; margin-bottom:12px; }
.diaspora-content > p { color:var(--muted); font-size:15px; line-height:1.7; margin-bottom:20px; }
.diaspora-content ul { list-style:none; padding:0; margin-bottom:24px; }
.diaspora-content li { padding:8px 0; font-size:14px; color:var(--text-secondary); display:flex; align-items:center; gap:8px; }
.diaspora-content li::before { content:'\2713'; color:var(--accent-light); font-weight:700; font-size:16px; }
.diaspora-visual { font-size:80px; line-height:1; color:var(--accent-light); opacity:.6; flex-shrink:0; }

/* ── Testimonials ── */
.testimonials-section { background:var(--bg-card); }
.testimonials-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.testimonial-card {
  background:var(--bg); border:1px solid var(--border); border-radius:var(--radius);
  padding:28px 24px; display:flex; flex-direction:column; transition:all var(--transition);
}
.testimonial-card:hover { border-color:var(--accent); transform:translateY(-3px); }
.testimonial-stars { color:var(--warning); font-size:16px; letter-spacing:2px; margin-bottom:12px; }
.testimonial-text { font-size:14px; color:var(--muted); line-height:1.7; flex:1; margin-bottom:20px; font-style:italic; }
.testimonial-author { display:flex; align-items:center; gap:12px; padding-top:16px; border-top:1px solid var(--border); }
.ta-avatar {
  width:40px; height:40px; border-radius:50%;
  background:linear-gradient(135deg,var(--accent),var(--accent-light));
  color:#fff; display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:16px; flex-shrink:0;
}
.testimonial-author div strong { display:block; font-size:14px; font-weight:600; }
.testimonial-author div span { font-size:12px; color:var(--muted); }

/* ── Partners ── */
.partners-section { background:var(--bg); }
.partners-grid { display:flex; justify-content:center; align-items:center; gap:32px; flex-wrap:wrap; }
.partner-item {
  padding:16px 24px; background:var(--bg-card); border:1px solid var(--border);
  border-radius:var(--radius-sm); font-size:15px; font-weight:600; color:var(--text-secondary);
  transition:all var(--transition);
}
.partner-item:hover { border-color:var(--accent); color:var(--accent-light); }

/* ── CTA section ── */
.cta-section {
  background:linear-gradient(180deg, var(--bg-card) 0%, #0B1121 100%);
  text-align:center; padding:80px 0 100px; position:relative;
}
.cta-section h2 { font-size:2rem; font-weight:700; margin-bottom:12px; }
.cta-section p { color:var(--muted); font-size:16px; margin-bottom:32px; max-width:500px; margin-left:auto; margin-right:auto; }
.cta-section .waitlist-form { max-width:400px; margin:0 auto; }

/* ── Projects grid ── */
.projects-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:24px; }
.project-card {
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  transition:all var(--transition);
  display:flex; flex-direction:column;
  color:inherit;
}
.project-card:hover { border-color:var(--accent); transform:translateY(-3px); color:inherit; }
.project-card-img {
  height:160px;
  background-size:cover;
  background-position:center;
  position:relative;
  display:flex; gap:6px; padding:12px; flex-wrap:wrap; align-content:flex-start;
}
.project-card-body { padding:20px; flex:1; display:flex; flex-direction:column; }
.project-title { font-size:16px; font-weight:600; margin-bottom:6px; color:#fff; }
.project-desc { font-size:13px; color:var(--muted); margin-bottom:12px; flex:1; }
.project-meta { display:flex; gap:12px; font-size:12px; color:var(--muted); margin-bottom:12px; flex-wrap:wrap; }
.project-progress { margin-top:auto; }
.progress-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.progress-header strong { font-size:14px; color:var(--accent-light); }
.progress-pct { font-size:12px; color:var(--muted); }
.progress-bar { height:8px; background:var(--surface); border-radius:4px; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg,var(--accent),var(--accent-light)); border-radius:4px; transition:width .5s ease; }
.progress-footer { display:flex; justify-content:space-between; font-size:11px; color:var(--muted); margin-top:4px; }
.project-porteur { display:flex; align-items:center; gap:8px; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); font-size:13px; color:var(--text-secondary); }
.porteur-avatar {
  width:28px; height:28px; border-radius:50%;
  background:var(--surface); color:var(--text);
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:600; flex-shrink:0;
}
.porteur-avatar.lg { width:44px; height:44px; font-size:20px; background:var(--accent); color:#fff; }
.porteur-score { margin-left:auto; font-size:12px; color:var(--muted); }

/* ── Badges ── */
.badge {
  display:inline-flex; align-items:center;
  padding:4px 10px;
  border-radius:20px;
  font-size:11px; font-weight:600;
  gap:4px;
}
.badge-cat { background:rgba(22,163,74,.15); color:var(--accent-light); }
.badge-verified { background:rgba(22,163,74,.25); color:var(--accent-light); }
.badge-status { background:var(--surface); color:var(--muted); }
.badge-collecte { background:rgba(22,163,74,.2); color:var(--accent-light); }
.badge-finance { background:rgba(245,158,11,.2); color:var(--warning); }
.badge-realisation { background:rgba(59,130,246,.2); color:#60A5FA; }
.badge-termine { background:var(--accent); color:#fff; }
.badge-echoue { background:rgba(239,68,68,.2); color:var(--danger); }

/* ── Page header ── */
.page-header { padding:32px 0; border-bottom:1px solid var(--border); }
.page-header h1 { font-size:1.75rem; font-weight:700; }
.page-desc { color:var(--muted); font-size:14px; margin-top:4px; }

/* ── Filters ── */
.filters {
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  padding:20px 0;
  align-items:center;
}
.filters > * { flex:1; min-width:200px; }
.search-box { position:relative; }
.search-icon { position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; color:var(--muted); }
.search-box .form-input { padding-left:36px; }

/* ── Form elements ── */
.form-input, .form-select {
  width:100%;
  padding:10px 14px;
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text);
  font-size:14px;
  font-family:var(--font);
  transition:border-color var(--transition);
  outline:none;
}
.form-input:focus, .form-select:focus { border-color:var(--accent); }
.form-input::placeholder { color:var(--muted); }
.form-select { cursor:pointer; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; padding-right:32px; }
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; font-weight:500; color:var(--text-secondary); margin-bottom:6px; }
textarea.form-input { font-family:var(--font); min-height:80px; }

/* ── Back link ── */
.back-link { display:inline-block; color:var(--muted); font-size:14px; margin-bottom:16px; }
.back-link:hover { color:var(--accent-light); }

/* ── Projet detail ── */
.projet-detail { padding:24px 0; }
.projet-layout { display:grid; grid-template-columns:1fr 360px; gap:32px; align-items:start; }
@media (max-width:900px) { .projet-layout { grid-template-columns:1fr; } }
.projet-tags { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.projet-titre { font-size:1.75rem; font-weight:700; margin-bottom:16px; }
.projet-description { color:var(--text-secondary); font-size:15px; line-height:1.7; margin-bottom:20px; white-space:pre-wrap; }
.projet-metas { display:flex; flex-wrap:wrap; gap:16px; font-size:13px; color:var(--muted); margin-bottom:24px; }
.porteur-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:20px; }
.porteur-card h3 { font-size:14px; font-weight:600; margin-bottom:12px; color:var(--text-secondary); }
.porteur-row { display:flex; align-items:center; gap:12px; }
.porteur-name { font-weight:600; }
.porteur-detail { font-size:13px; color:var(--muted); margin-top:2px; }

/* ── Invest card ── */
.invest-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:24px; position:sticky; top:88px; }
.invest-header { display:flex; justify-content:space-between; align-items:baseline; }
.invest-label { font-size:13px; color:var(--muted); }
.invest-amount { font-size:1.3rem; font-weight:700; color:var(--accent-light); }
.invest-goal { font-size:13px; color:var(--muted); margin-top:2px; }
.invest-pct { font-size:12px; color:var(--muted); margin-bottom:4px; }
.invest-days { font-size:13px; margin-top:8px; color:var(--warning); }
.invest-card h4 { font-size:15px; font-weight:600; margin-bottom:12px; }
.invest-form { display:flex; flex-direction:column; gap:10px; }
.invest-msg { font-size:13px; margin-top:4px; }
.invest-msg.success { color:var(--accent-light); }
.invest-msg.error { color:var(--danger); }
.divider { border:none; border-top:1px solid var(--border); margin:16px 0; }

/* ── Auth ── */
.auth-page {
  display:flex; align-items:center; justify-content:center;
  padding:48px 20px;
  flex:1;
}
.auth-box { width:100%; max-width:420px; text-align:center; }
.auth-brand { display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:24px; }
.auth-brand .logo-text { font-size:22px; font-weight:700; }
.auth-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:32px 28px; text-align:left; }
.auth-card h2 { font-size:20px; font-weight:600; margin-bottom:20px; text-align:center; }
.auth-error { background:rgba(239,68,68,.12); color:var(--danger); padding:10px 14px; border-radius:var(--radius-sm); margin-bottom:16px; font-size:13px; }
.auth-switch { text-align:center; margin-top:20px; font-size:13px; color:var(--muted); }
.auth-switch button { background:none; border:none; color:var(--accent-light); cursor:pointer; font-size:13px; font-weight:600; text-decoration:underline; }
.cgu-label { display:flex; align-items:flex-start; gap:8px; font-size:12px; color:var(--muted); line-height:1.5; }
.cgu-label input[type="checkbox"] { margin-top:2px; width:14px; height:14px; accent-color:var(--accent); flex-shrink:0; }
.cgu-label a { color:var(--accent-light); text-decoration:underline; }
.auth-forgot { display:block; text-align:right; font-size:12px; color:var(--muted); margin-top:-8px; margin-bottom:16px; }
.auth-forgot:hover { color:var(--accent-light); }

/* ── Tabs ── */
.tabs { width:100%; }
.tab-header { display:flex; gap:0; border-bottom:1px solid var(--border); margin-bottom:24px; }
.tab-btn {
  flex:1; padding:12px 16px; font-size:14px; font-weight:500;
  background:none; border:none; border-bottom:2px solid transparent;
  color:var(--muted); cursor:pointer; font-family:var(--font);
  transition:all var(--transition); text-align:center;
}
.tab-btn:hover { color:var(--text); background:rgba(22,163,74,.05); }
.tab-btn.active { color:var(--accent-light); border-bottom-color:var(--accent-light); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }
.auth-tabs .tab-btn { font-size:13px; padding:10px 8px; }
@media (max-width:480px) {
  .auth-tabs .tab-header { flex-direction:column; border-bottom:none; gap:4px; }
  .auth-tabs .tab-btn { border:1px solid var(--border); border-radius:var(--radius-sm); }
  .auth-tabs .tab-btn.active { border-color:var(--accent); }
}

/* ── Dashboard ── */
.dash-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:24px; flex-wrap:wrap; gap:12px; }
.dash-header h1 { font-size:1.5rem; font-weight:700; }
.dash-greeting { color:var(--muted); font-size:14px; }
.user-email { color:var(--text); }
.dash-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin-bottom:32px; }
.stat-card {
  background:var(--bg-card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
}
.stat-icon { width:36px; height:36px; border-radius:var(--radius-sm); background:rgba(22,163,74,.15); display:flex; align-items:center; justify-content:center; margin-bottom:12px; }
.stat-icon svg { width:18px; height:18px; stroke:var(--accent-light); }
.stat-label { font-size:13px; color:var(--muted); margin-bottom:4px; }
.stat-value { font-size:1.2rem; font-weight:700; }
.dash-section { margin-bottom:32px; }
.section-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.section-header h2 { font-size:18px; font-weight:600; }

/* ── Invest list ── */
.invests-list { display:flex; flex-direction:column; gap:8px; }
.invest-item {
  display:flex; align-items:center; justify-content:space-between;
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:14px 18px; flex-wrap:wrap; gap:12px;
}
.invest-item-main { display:flex; align-items:center; gap:16px; }
.invest-item-amount { font-weight:600; color:var(--accent-light); }
.invest-item-date { font-size:13px; color:var(--muted); }
.invest-item-link { font-size:13px; color:var(--accent-light); }

/* ── Card ── */
.card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:24px; }

/* ── Steps ── */
.steps { display:flex; flex-direction:column; gap:32px; }
.step { display:flex; gap:20px; align-items:flex-start; }
.step-num {
  width:44px; height:44px; flex-shrink:0;
  background:var(--accent); color:#fff;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:18px; font-weight:700;
}
.step-content h3 { font-size:16px; font-weight:600; margin-bottom:6px; }
.step-content p { color:var(--muted); font-size:14px; line-height:1.6; }

/* ── FAQ ── */
.faq-list { display:flex; flex-direction:column; gap:8px; }
.faq-item { border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.faq-question {
  width:100%; display:flex; justify-content:space-between; align-items:center;
  background:var(--bg-card); border:none;
  padding:16px 20px;
  font-size:14px; font-weight:500;
  color:var(--text); cursor:pointer;
  font-family:var(--font);
  text-align:left;
  transition:background var(--transition);
}
.faq-question:hover { background:var(--surface); }
.faq-arrow { transition:transform var(--transition); font-size:12px; color:var(--muted); }
.faq-answer {
  max-height:0; overflow:hidden;
  padding:0 20px;
  font-size:14px; color:var(--muted); line-height:1.6;
  transition:all .3s ease;
}
.faq-answer.open { max-height:300px; padding:0 20px 16px; }

/* ── States ── */
.loader { display:flex; align-items:center; justify-content:center; padding:48px 0; }
.spinner { width:28px; height:28px; border:3px solid var(--border); border-top-color:var(--accent-light); border-radius:50%; animation:spin .6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.empty-state, .error-state { text-align:center; padding:48px 0; color:var(--muted); }
.error-state { color:var(--danger); }

/* ── PW field ── */
.pw-field { position:relative; }
.pw-field .form-input { padding-right:40px; }
.pw-toggle { position:absolute; right:8px; top:50%; transform:translateY(-50%); background:none; border:none; color:var(--muted); cursor:pointer; padding:6px; display:flex; align-items:center; }
.pw-toggle:hover { color:var(--text); }

/* ── Photo upload ── */
.photo-upload { position:relative; cursor:pointer; flex-shrink:0; }
.profil-photo { width:64px; height:64px; border-radius:50%; object-fit:cover; border:2px solid var(--accent); }
.photo-badge { position:absolute; bottom:0; right:0; font-size:14px; background:var(--bg-card); border:2px solid var(--border); border-radius:50%; width:24px; height:24px; display:flex; align-items:center; justify-content:center; }

/* ── Admin table ── */
.admin-table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:var(--radius-sm); }
.admin-table { width:100%; border-collapse:collapse; font-size:13px; }
.admin-table th, .admin-table td { padding:10px 14px; text-align:left; border-bottom:1px solid var(--border); }
.admin-table th { background:var(--surface); font-weight:600; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.5px; }
.admin-table tr:last-child td { border-bottom:none; }
.admin-table tr:hover td { background:rgba(22,163,74,.04); }
.admin-select { background:var(--surface); color:var(--text); border:1px solid var(--border); border-radius:4px; padding:4px 8px; font-size:12px; cursor:pointer; }
.admin-link { margin-left:8px; font-size:12px; }
.admin-link:hover { color:var(--accent-light); }

/* ── Document item (profil) ── */
.doc-item { display:flex; align-items:center; gap:10px; padding:10px 14px; background:var(--surface); border-radius:var(--radius-sm); font-size:13px; color:var(--text-secondary); }

/* ── Checkbox ── */
.form-check { display:flex; align-items:flex-start; gap:8px; margin-bottom:12px; }
.form-check input[type="checkbox"] { margin-top:3px; width:16px; height:16px; accent-color:var(--accent); }
.form-check label { font-size:12px; color:var(--muted); }

/* ── Activity log ── */
.activity-list { display:flex; flex-direction:column; gap:6px; }
.activity-item { display:flex; align-items:center; gap:10px; padding:8px 12px; background:var(--surface); border-radius:var(--radius-sm); font-size:13px; }
.activity-dot { width:8px; height:8px; border-radius:50%; background:var(--accent-light); flex-shrink:0; }

/* ── Cookie banner ── */
#cookie-banner, #cgu-banner {
  position:fixed; bottom:0; left:0; right:0; z-index:99999;
  background:var(--bg-card); border-top:1px solid var(--border);
  padding:16px 24px; box-shadow:0 -4px 24px rgba(0,0,0,.3);
}
.cookie-content { max-width:900px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.cookie-content p { font-size:13px; color:var(--muted); flex:1; }
.cookie-actions { display:flex; gap:8px; flex-shrink:0; }

/* ── Password error ── */
#pwd-error { display:none; }

/* ── Toast ── */
#toast-container {
  position:fixed; bottom:24px; right:24px; z-index:9999;
  display:flex; flex-direction:column; gap:8px;
  pointer-events:none;
}
.toast {
  background:var(--bg-card); border:1px solid var(--border);
  padding:12px 20px; border-radius:var(--radius-sm);
  font-size:14px; color:var(--text);
  box-shadow:var(--shadow);
  transform:translateY(20px); opacity:0;
  transition:all .3s ease;
  pointer-events:auto;
  max-width:360px;
}
.toast.show { transform:translateY(0); opacity:1; }
.toast.toast-success { border-left:3px solid var(--accent); }
.toast.toast-error { border-left:3px solid var(--danger); }

/* ── Responsive helpers ── */
@media (max-width:768px) {
  .hero { padding:64px 0 48px; }
  .hero h1 { font-size:1.8rem; }
  .hero-split { flex-direction:column; gap:32px; }
  .hero-text { text-align:center; }
  .hero-sub { margin-left:auto; margin-right:auto; }
  .hero-actions { justify-content:center; }
  .hero-visual { flex:unset; width:100%; max-width:320px; margin:0 auto; }
  .hero-sub { font-size:1rem; }
  .how-grid { grid-template-columns:1fr; }
  .projects-grid { grid-template-columns:1fr; }
  .filters > * { min-width:100%; }
  .footer-inner { flex-direction:column; text-align:center; }
  .section-title { font-size:1.3rem; }
  #toast-container { left:16px; right:16px; bottom:16px; }
  .toast { max-width:100%; }
  .simulator { padding:20px; }
  .simulator-row { grid-template-columns:1fr; }
  .simulator-result { flex-direction:column; gap:12px; }
  .testimonials-grid { grid-template-columns:1fr; }
  .partners-grid { gap:16px; }
  .how-grid { grid-template-columns:1fr; }
  .diaspora-card { flex-direction:column; text-align:center; padding:32px 24px; }
  .diaspora-content ul { text-align:left; }
  .diaspora-visual { font-size:60px; }
  .auth-box { max-width:100%; }
  .team-grid { grid-template-columns:1fr; }
  .securite-grid { grid-template-columns:1fr; }
  .blog-grid { grid-template-columns:1fr; }
  #main-footer ~ [style*="grid-template-columns:1fr 1fr"] { grid-template-columns:1fr !important; }
  .cta-section { padding:56px 0 72px; }
  .cta-section h2 { font-size:1.5rem; }
}

/* ══════════════════════════════════════════════
   RTL Support
   ══════════════════════════════════════════════ */
[dir="rtl"] .nav { flex-direction:row-reverse; }
[dir="rtl"] .header-inner { flex-direction:row-reverse; }
[dir="rtl"] .footer-inner { flex-direction:row-reverse; }
[dir="rtl"] .hero-split { flex-direction:row-reverse; }
[dir="rtl"] .step { flex-direction:row-reverse; }
[dir="rtl"] .step-num { margin-left:0; margin-right:0; }
[dir="rtl"] .diaspora-card { flex-direction:row-reverse; }
[dir="rtl"] .invest-item { flex-direction:row-reverse; }
[dir="rtl"] .faq-question { text-align:right; }
[dir="rtl"] .faq-arrow { transform:rotate(180deg); }
[dir="rtl"] .faq-arrow.open { transform:rotate(90deg); }
[dir="rtl"] .project-porteur { flex-direction:row-reverse; }
[dir="rtl"] .porteur-score { margin-left:0; margin-right:auto; }
[dir="rtl"] .project-meta { flex-direction:row-reverse; }
[dir="rtl"] .projet-metas { flex-direction:row-reverse; }
[dir="rtl"] .invest-card { text-align:right; }
[dir="rtl"] .auth-card { text-align:right; }
[dir="rtl"] .form-check { flex-direction:row-reverse; }
[dir="rtl"] .pw-field .form-input { padding-right:14px; padding-left:40px; }
[dir="rtl"] .pw-toggle { right:auto; left:8px; }
[dir="rtl"] .admin-table th,
[dir="rtl"] .admin-table td { text-align:right; }
[dir="rtl"] .admin-link { margin-left:0; margin-right:8px; }
[dir="rtl"] .search-icon { left:auto; right:12px; }
[dir="rtl"] .search-box .form-input { padding-left:14px; padding-right:36px; }
[dir="rtl"] .form-select { background-position:left 12px center; padding-right:14px; padding-left:32px; }

@media (max-width:768px) {
  [dir="rtl"] .nav { flex-direction:column; }
  [dir="rtl"] .nav.open { display:flex; }
}
[dir="rtl"] .invest-header { flex-direction:row-reverse; }
[dir="rtl"] .progress-header { flex-direction:row-reverse; }
[dir="rtl"] .progress-footer { flex-direction:row-reverse; }
[dir="rtl"] .invest-item-main { flex-direction:row-reverse; }
[dir="rtl"] .blog-card-footer { flex-direction:row-reverse; }
[dir="rtl"] .ft-row { flex-direction:row-reverse; }
[dir="rtl"] .projet-description { text-align:right; }
[dir="rtl"] .testimonial-author { flex-direction:row-reverse; }
[dir="rtl"] .cookie-content { flex-direction:row-reverse; }
[dir="rtl"] .step-content { text-align:right; }
[dir="rtl"] .hero-text { text-align:right; }
[dir="rtl"] .hero-actions { justify-content:flex-start; }
[dir="rtl"] .diaspora-content ul { text-align:right; }
[dir="rtl"] .diaspora-content li::before { margin-left:0; margin-right:0; }
[dir="rtl"] .trust-bar-inner { flex-direction:row-reverse; }
[dir="rtl"] .simulator-result { flex-direction:row-reverse; }
[dir="rtl"] .tab-header { flex-direction:row-reverse; }
[dir="rtl"] .auth-tabs .tab-header { flex-direction:row-reverse; }
@media (max-width:480px) {
  [dir="rtl"] .auth-tabs .tab-header { flex-direction:column; }
}

/* ══════════════════════════════════════════════
   Lang Selector
   ══════════════════════════════════════════════ */
.header__lang select {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  color:var(--text);
  font-size:12px;
  font-weight:500;
  padding:6px 28px 6px 10px;
  cursor:pointer;
  font-family:var(--font);
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 8px center;
  transition:border-color var(--transition);
}
.header__lang select:hover { border-color:var(--accent); }
.header__lang select:focus { outline:none; border-color:var(--accent-light); }
[dir="rtl"] .header__lang select { background-position:left 8px center; padding:6px 10px 6px 28px; }

/* ══════════════════════════════════════════════
   Canvas responsive (charts)
   ══════════════════════════════════════════════ */
canvas { max-width:100%; height:auto !important; }

/* ══════════════════════════════════════════════
   Profil tabs
   ══════════════════════════════════════════════ */
.profil-header { display:flex; align-items:center; gap:16px; margin-bottom:24px; }
.profil-avatar { width:80px; height:80px; border-radius:50%; object-fit:cover; border:3px solid var(--accent); }
.profil-avatar-placeholder { width:80px; height:80px; border-radius:50%; background:var(--surface); display:flex; align-items:center; justify-content:center; font-size:32px; font-weight:700; color:var(--muted); border:3px solid var(--border); }
.profil-name { font-size:1.3rem; font-weight:700; }
.profil-role { font-size:13px; color:var(--muted); }
.profil-section { margin-bottom:32px; }
.profil-section h3 { font-size:15px; font-weight:600; margin-bottom:16px; color:var(--text-secondary); }
.profil-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
@media (max-width:600px) { .profil-grid { grid-template-columns:1fr; } }
