:root {
  --bg: #0b1220;
  --bg-card: #1a2436;
  --bg-card-2: #141d2e;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #16a34a;
  --primary-light: #22c55e;
  --primary-dark: #15803d;
  --danger: #ef4444;
  --warning: #d97706;
  --border: #2c3a52;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --font-heading: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.35);
  --shadow-md: 0 12px 28px -14px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.25);
  --shadow-lg: 0 30px 60px -24px rgba(0,0,0,.6), 0 4px 14px rgba(0,0,0,.3);
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 12% -10%, rgba(22,163,74,.10), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(22,163,74,.06), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary-light); text-decoration: none; transition: color .15s var(--ease); }
a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 12px;
  z-index: 100;
  background: var(--primary);
  color: #06210f;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  transition: top .15s ease;
}
.skip-link:focus {
  top: 12px;
  text-decoration: none;
}

h1, h2, h3 { font-family: var(--font-heading); font-weight: 800; letter-spacing: -.02em; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

header.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(20, 29, 46, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; color: var(--text); letter-spacing: -.02em; }
.brand svg { width: 30px; height: 30px; color: var(--primary-light); }
nav.main-nav { display: flex; gap: 20px; align-items: center; }
nav.main-nav a { color: var(--text-muted); font-weight: 500; transition: color .15s var(--ease); }
nav.main-nav a:hover { color: var(--text); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -.005em;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease), color .15s var(--ease), box-shadow .2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  color: #06210f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 1px 2px rgba(0,0,0,.25), 0 6px 16px -10px rgba(22,163,74,.5);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #2fd968, var(--primary-light));
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.25), 0 10px 22px -10px rgba(22,163,74,.55);
}
.btn-primary:active { transform: translateY(0); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary-light); color: var(--primary-light); text-decoration: none; background: rgba(22,163,74,.08); }
.btn-danger { background: var(--danger); color: #2b0707; }
.btn-danger:hover { filter: brightness(1.08); text-decoration: none; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

main { padding: 32px 0 64px; min-height: 60vh; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.card {
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.card img.thumb { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #0a1120; display: block; }
.thumb-lg { width: 100%; max-width: 420px; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); background: #0a1120; display: block; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.05rem; }
.card-body p { margin: 0; color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: var(--primary);
  width: fit-content;
}
.badge.pending { background: rgba(217, 119, 6, .15); color: var(--warning); }
.badge.rejected, .badge.banned { background: rgba(239, 68, 68, .15); color: var(--danger); }
.badge.frozen { background: rgba(148, 163, 184, .15); color: var(--text-muted); }

.progress {
  height: 8px;
  background: #0a1120;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span { display: block; height: 100%; background: var(--primary); }

.meta-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--text-muted); }

form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
label { font-size: 0.9rem; color: var(--text); font-weight: 600; display: block; margin-bottom: 6px; }
input, textarea, select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0d1626;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
input:hover, textarea:hover, select:hover { border-color: #3a4a68; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(34,197,94,.18);
}
input::placeholder, textarea::placeholder { color: #64748b; }
textarea { resize: vertical; min-height: 100px; }

.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: rgba(239,68,68,.12); border: 1px solid rgba(239,68,68,.4); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.4); color: #86efac; }
.alert-warn { background: rgba(217,119,6,.12); border: 1px solid rgba(217,119,6,.4); color: #fcd34d; }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; }
tr:hover td { background: rgba(255,255,255,0.02); }

.panel { background: linear-gradient(160deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: linear-gradient(160deg, var(--bg-card), var(--bg-card-2)); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.stat .label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-family: var(--font-heading); font-size: 1.7rem; font-weight: 800; margin-top: 6px; }

.icon { width: 18px; height: 18px; flex-shrink: 0; }

footer.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 40px;
}
.footer-grid {
  display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between;
  padding: 36px 0 20px;
}
.footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.footer-brand svg { width: 22px; height: 22px; }
.footer-tagline { max-width: 320px; margin-top: 8px; font-size: .85rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { padding: 16px 0; border-top: 1px solid var(--border); text-align: center; font-size: .8rem; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px;
  background: var(--bg-card-2);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  flex-shrink: 0;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: rgba(34,197,94,.1); color: var(--primary); text-decoration: none; }
.admin-content { flex: 1; padding: 28px 32px; }

@media (max-width: 720px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; }
}

/* ==================== Ajouts : nav mobile, actions-row, page d'accueil, auth ==================== */

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Navigation responsive */
.nav-toggle { display: none; }
@media (max-width: 780px) {
  header.site-header .bar { flex-wrap: wrap; }
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--border);
    background: transparent; color: var(--text); cursor: pointer;
  }
  .nav-toggle svg { width: 20px; height: 20px; }
  nav.main-nav {
    display: none; width: 100%; flex-direction: column; align-items: stretch;
    gap: 4px; padding-top: 14px; border-top: 1px solid var(--border); margin-top: 14px;
  }
  nav.main-nav.open { display: flex; }
  nav.main-nav a { padding: 10px 6px; }
  nav.main-nav .btn { width: 100%; justify-content: center; }
}

/* Hero de la page d'accueil */
.hero {
  text-align: center;
  padding: 64px 20px 46px;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  background:
    radial-gradient(900px 360px at 50% 0%, rgba(34,197,94,.18), transparent 65%),
    linear-gradient(180deg, var(--bg-card-2), var(--bg));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}
.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3rem);
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--text) 35%, var(--primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p { color: var(--text-muted); max-width: 640px; margin: 0 auto 28px; font-size: 1.05rem; line-height: 1.65; }
.hero .actions-row { justify-content: center; }

/* Bandeau de statistiques sous le hero */
.stats-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 32px;
}
.stats-strip .stat-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; text-align: center;
}
.stats-strip .stat-box .num { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; color: var(--primary-light); }
.stats-strip .stat-box .label { color: var(--text-muted); font-size: .82rem; margin-top: 2px; }

/* Barre de recherche + filtres catégories en pastilles */
.search-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.search-bar input[type="text"] { max-width: 320px; flex: 1; min-width: 200px; }

.category-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.category-pills a {
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--text-muted); font-size: .85rem; font-weight: 500;
}
.category-pills a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.category-pills a.active { background: var(--primary); border-color: var(--primary); color: #06210f; font-weight: 700; }

.card:hover { transform: translateY(-4px); border-color: #3f5a4a; box-shadow: var(--shadow-md); }

/* Pages d'authentification (login/register) */
.auth-page { display: flex; justify-content: center; padding: 24px 0 40px; }
.auth-card {
  width: 100%; max-width: 440px;
  background: linear-gradient(160deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 40px 36px; box-shadow: var(--shadow-lg);
}
.auth-card .auth-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; font-family: var(--font-heading); font-weight: 800; font-size: 1.15rem; }
.auth-card .auth-logo svg { width: 28px; height: 28px; color: var(--primary-light); }
.auth-card h1 { text-align: center; font-size: 1.5rem; margin: 0 0 6px; }
.auth-card .auth-subtitle { text-align: center; color: var(--text-muted); font-size: .9rem; margin-bottom: 26px; }
.auth-card .auth-footer { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: .9rem; }

/* ==================== FAQ ==================== */
.faq-page { max-width: 760px; margin: 0 auto; }
.faq-intro { text-align: center; margin-bottom: 32px; }
.faq-intro h1 { justify-content: center; }
.faq-intro p { color: var(--text-muted); }
.faq-section-title { margin: 32px 0 12px; font-size: 1.05rem; color: var(--primary); }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 18px; transition: border-color .15s ease;
}
.faq-item[open] { border-color: var(--primary); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; cursor: pointer; font-weight: 600; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; transition: transform .2s ease; }
.faq-item[open] summary svg { transform: rotate(180deg); color: var(--primary); }
.faq-item p { color: var(--text-muted); padding: 0 0 16px; margin: 0; line-height: 1.6; }
.faq-contact { text-align: center; color: var(--text-muted); margin-top: 32px; font-size: .9rem; }

/* ==================== Fluidité mobile ==================== */
@media (max-width: 640px) {
  /* Empêche le zoom automatique iOS Safari sur les champs de formulaire */
  input, select, textarea { font-size: 16px; }

  .container { padding: 0 16px; }
  .hero { padding: 40px 18px 30px; border-radius: 12px; }
  .hero h1 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .hero p { font-size: .92rem; }

  .grid { grid-template-columns: 1fr; gap: 14px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 26px 20px; }
  .search-bar { flex-direction: column; }
  .search-bar input[type="text"] { max-width: none; }

  /* Cibles tactiles confortables */
  .btn { padding: 11px 16px; min-height: 44px; }
  .btn-sm { min-height: 38px; padding: 8px 14px; }
  .main-nav a, .main-nav .btn { min-height: 44px; }

  .footer-grid { flex-direction: column; }
}

/* ==================== Boîte de don ==================== */
.donate-box { position: sticky; top: 90px; }
.quick-amounts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.quick-amount-btn {
  flex: 1; min-width: 56px; padding: 8px 4px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-card-2); color: var(--text);
  font-weight: 600; font-size: .85rem; cursor: pointer; transition: all .15s ease;
}
.quick-amount-btn:hover { border-color: var(--primary); }
.quick-amount-btn.active { background: var(--primary); border-color: var(--primary); color: #06210f; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }
.checkbox-label input { width: auto; }
.donate-note { display: flex; align-items: flex-start; gap: 6px; color: var(--text-muted); font-size: .8rem; margin-top: 10px; line-height: 1.5; }
.donate-note svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; }

@media (max-width: 900px) {
  .donate-box { position: static; }
}

/* ==================== Profil utilisateur ==================== */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.field-hint { color: var(--text-muted); font-size: .8rem; margin-top: 4px; }
.field-hint svg { vertical-align: -3px; margin-right: 2px; }
input:disabled { opacity: .6; cursor: not-allowed; }

@media (max-width: 800px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* ==================== Édition de projet (formulaire en sections) ==================== */
.edit-fieldset { border: none; padding: 0; margin: 0; }
.edit-fieldset:disabled { opacity: .55; }

.form-section { margin-bottom: 18px; }
.form-section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 16px; padding-bottom: 12px; font-size: .95rem;
  border-bottom: 1px solid var(--border);
}
.form-section-title svg { width: 17px; height: 17px; color: var(--primary); }

.current-image-row { display: flex; gap: 18px; align-items: flex-start; }
.current-image-block { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.current-image-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.current-image-thumb { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card-2); }

.locked-section { background: var(--bg-card-2); }
.locked-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 10px; }
.locked-grid > div { display: flex; flex-direction: column; gap: 2px; }
.locked-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

@media (max-width: 560px) {
  .current-image-row { flex-direction: column; }
  .current-image-thumb { width: 100%; height: 160px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; justify-content: center; }
}

/* ==================== Page d'attente de paiement ==================== */
.pending-card { text-align: center; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto 20px;
  border: 4px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.operator-choice { display: flex; gap: 8px; }
.operator-option {
  flex: 1; display: flex; align-items: center; gap: 6px; font-weight: normal;
  padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  font-size: .88rem; transition: border-color .15s ease;
}
.operator-option:has(input:checked) { border-color: var(--primary); background: rgba(34,197,94,.08); }
.operator-option input { width: auto; }

/* ==================== Glisser-déposer (upload) ==================== */
.dropzone {
  position: relative;
  border: 2px dashed var(--border); border-radius: 12px; padding: 24px 16px;
  text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease;
  color: var(--text-muted);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: rgba(34,197,94,.05); }
.dropzone.has-file { border-color: var(--primary); border-style: solid; }
.dropzone svg { width: 28px; height: 28px; margin-bottom: 8px; color: var(--primary); }
.dropzone p { margin: 0; font-size: .88rem; }
.dropzone-browse { color: var(--primary); text-decoration: underline; font-weight: 600; }
.dropzone-filename { margin-top: 6px !important; font-weight: 600; color: var(--text) !important; word-break: break-all; }
/* L'input couvre TOUTE la zone (transparent) plutôt qu'un hack 1x1px : un champ
   "required" quasi invisible empêche certains navigateurs d'afficher leur bulle
   de validation native et bloque silencieusement l'envoi du formulaire. */
.dropzone-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; margin: 0; padding: 0; z-index: 1;
}
/* L'icône, le texte et l'aperçu doivent rester visuellement AU-DESSUS de
   l'input invisible (empilement explicite, ne pas compter sur l'ordre par
   défaut du navigateur) ; pointer-events:none pour que clics/glisser
   continuent d'atteindre l'input en dessous. */
.dropzone > svg, .dropzone > p, .dropzone > img {
  position: relative; z-index: 2; pointer-events: none;
}
.dropzone-preview { max-width: 100%; max-height: 140px; border-radius: 8px; margin-top: 10px; display: none; }
.dropzone-preview-square { width: 140px; height: 140px; max-width: 140px; object-fit: cover; }
.dropzone-preview.visible { display: inline-block; }

/* ==================== Badge vérifié (KYC) ==================== */
.verified-badge { background: rgba(34,197,94,.14) !important; color: var(--primary) !important; }
.verified-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; background: var(--primary);
  flex-shrink: 0; margin-left: 4px;
}
.verified-tick svg { width: 10px; height: 10px; color: #06210f; }

/* ==================== Pages légales ==================== */
.legal-page { max-width: 780px; margin: 0 auto; }
.legal-page h1 { margin-bottom: 4px; }
.legal-updated { color: var(--text-muted); font-size: .85rem; margin-bottom: 28px; }
.legal-page h2 { margin: 32px 0 12px; font-size: 1.1rem; color: var(--primary); }
.legal-page h3 { margin: 20px 0 8px; font-size: .95rem; color: var(--text); }
.legal-page p, .legal-page li { color: var(--text-muted); line-height: 1.7; }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin-bottom: 6px; }
.legal-page strong { color: var(--text); }
.legal-table { width: 100%; margin: 12px 0 20px; border-collapse: collapse; }
.legal-table th, .legal-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: .88rem; }
.legal-table th { color: var(--text); font-weight: 700; }
.legal-disclaimer { margin-top: 40px; padding: 14px 16px; background: var(--bg-card-2); border-radius: 10px; font-size: .8rem; font-style: italic; }

@media (max-width: 600px) {
  .legal-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ==================== Page KYC ==================== */
.kyc-page { max-width: 620px; margin: 0 auto; }
.kyc-steps { display: flex; list-style: none; padding: 0; margin: 24px 0 28px; }
.kyc-steps li {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; font-size: .8rem; color: var(--text-muted); position: relative;
}
.kyc-steps li:not(:last-child)::after {
  content: ''; position: absolute; top: 15px; left: 55%; width: 90%; height: 2px;
  background: var(--border); z-index: 0;
}
.kyc-steps li.done:not(:last-child)::after { background: var(--primary); }
.kyc-step-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--bg-card);
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  font-weight: 700; z-index: 1; color: var(--text-muted);
}
.kyc-step-num svg { width: 14px; height: 14px; }
.kyc-steps li.done .kyc-step-num { background: var(--primary); border-color: var(--primary); color: #06210f; }
.kyc-steps li.current .kyc-step-num { border-color: var(--primary); color: var(--primary); }
.kyc-steps li.current span:last-child { color: var(--text); font-weight: 600; }

.kyc-requirements { background: var(--bg-card-2); border-radius: 10px; padding: 16px 18px; margin-bottom: 22px; }
.kyc-requirements h3 { margin: 0 0 10px; font-size: .95rem; }
.kyc-requirements ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.kyc-requirements li { display: flex; align-items: flex-start; gap: 8px; font-size: .87rem; color: var(--text-muted); }
.kyc-requirements li svg { width: 16px; height: 16px; color: var(--primary); flex-shrink: 0; margin-top: 2px; }

@media (max-width: 480px) {
  .kyc-steps li { font-size: .7rem; }
}

/* ==================== Bouton "retour" (cohérent partout) ==================== */
.btn-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .88rem; font-weight: 600;
  margin-bottom: 18px; transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn-back:hover { color: var(--text); border-color: var(--primary); background: var(--bg-card-2); text-decoration: none; }
.btn-back svg { width: 15px; height: 15px; }

/* ==================== Composants communs (états, en-têtes, listes) ==================== */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1, .page-head h2 { margin: 0; }

.empty-state {
  text-align: center; padding: 40px 20px; border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--text-muted); background: var(--bg-card-2);
}
.empty-state svg { width: 34px; height: 34px; color: var(--text-muted); opacity: .7; margin-bottom: 10px; }
.empty-state h3 { margin: 0 0 6px; color: var(--text); font-size: 1rem; }
.empty-state p { margin: 0; font-size: .88rem; }

.btn-link {
  background: none; border: none; padding: 4px 0; cursor: pointer;
  color: var(--text-muted); font-size: .82rem; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px; font-family: inherit;
}
.btn-link:hover { color: var(--primary); }
.btn-link.danger:hover { color: var(--danger); }
.btn-link svg { width: 14px; height: 14px; }

.btn-icon {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon svg { width: 15px; height: 15px; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }

/* ==================== Sections de la page projet ==================== */
.project-section { margin-top: 40px; scroll-margin-top: 80px; }
.project-section > h2 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin-bottom: 16px; }
.project-section > h2 svg { width: 19px; height: 19px; color: var(--primary); }

.project-metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px;
  margin: 20px 0; padding: 16px; background: var(--bg-card-2); border-radius: var(--radius);
  border: 1px solid var(--border);
}
.project-metrics > div { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.metric-num { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 800; color: var(--primary-light); }
.metric-label { font-size: .74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }

/* ==================== Notes / ratings ==================== */
.rating-block {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding: 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
}
.rating-summary { display: flex; align-items: center; gap: 14px; }
.rating-average { font-family: var(--font-heading); font-size: 2.3rem; font-weight: 800; line-height: 1; }
.rating-stars { display: flex; gap: 2px; color: var(--primary); }
.rating-stars svg { width: 17px; height: 17px; }
.rating-count { color: var(--text-muted); font-size: .82rem; margin: 4px 0 0; }
.rating-form { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.rating-form-label { color: var(--text-muted); font-size: .85rem; margin-right: 6px; }
.rating-star-btn {
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-muted); transition: color .15s ease, transform .1s ease;
}
.rating-star-btn:hover { color: var(--primary); transform: scale(1.15); }
.rating-star-btn.active { color: var(--primary); }
.rating-star-btn svg { width: 24px; height: 24px; }

/* ==================== Timeline des actualités ==================== */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot {
  position: absolute; left: -22px; top: 20px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--primary); border: 2px solid var(--bg);
}
.timeline-date { color: var(--text-muted); font-size: .8rem; margin: 2px 0 10px; }
.update-image { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; }

/* ==================== Commentaires ==================== */
.comment-form { margin-bottom: 20px; }
.comment {
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-card); margin-bottom: 12px;
}
.comment.reply { margin: 12px 0 0 20px; background: var(--bg-card-2); border-left: 3px solid var(--primary); }
.comment-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.comment-author { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .92rem; }
.comment-date { color: var(--text-muted); font-size: .78rem; }
.comment-body { margin: 0; line-height: 1.6; word-break: break-word; }
.comment-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.badge-owner { background: rgba(34,197,94,.14) !important; color: var(--primary) !important; font-size: .65rem !important; margin: 0 !important; }
.reply-form { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; flex-wrap: wrap; }
.reply-form textarea { flex: 1; min-width: 200px; }

/* ==================== Notifications ==================== */
.notification-list { display: flex; flex-direction: column; gap: 8px; }
.notification-item {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card);
}
.notification-item.unread { border-left: 3px solid var(--primary); background: var(--bg-card-2); }
.notification-icon {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(34,197,94,.12);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--primary);
}
.notification-icon svg { width: 17px; height: 17px; }
.notification-body { flex: 1; min-width: 0; }
.notification-title { margin: 0; font-weight: 700; font-size: .92rem; }
.notification-text { margin: 3px 0 0; color: var(--text-muted); font-size: .85rem; }
.notification-date { margin: 5px 0 0; color: var(--text-muted); font-size: .75rem; }
.notification-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* Pastille de compteur dans la navigation */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; margin-left: 4px;
}

/* ==================== Support / messagerie ==================== */
.support-layout { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
.agent-status {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 10px;
  font-size: .88rem; margin-bottom: 20px; border: 1px solid var(--border); background: var(--bg-card-2);
}
.agent-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.agent-status.online .agent-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.agent-status.offline .agent-dot { background: var(--text-muted); }
.ticket-row { display: block; color: inherit; margin-bottom: 10px; }
.ticket-row:hover { text-decoration: none; }
.ticket-row h3 { margin: 6px 0 4px; font-size: 1rem; }

.badge-open { background: rgba(245,158,11,.15) !important; color: var(--warning) !important; }
.badge-answered { background: rgba(34,197,94,.15) !important; color: var(--primary) !important; }
.badge-pending_user { background: rgba(96,165,250,.15) !important; color: #60a5fa !important; }
.badge-closed { background: rgba(148,163,184,.15) !important; color: var(--text-muted) !important; }

.chat-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.chat-message { display: flex; }
.chat-message.from-user { justify-content: flex-end; }
.chat-bubble {
  max-width: 78%; padding: 12px 16px; border-radius: 14px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.from-user .chat-bubble { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.3); }
.chat-author { margin: 0 0 4px; font-size: .75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; }
.chat-body { margin: 0; line-height: 1.55; word-break: break-word; }
.chat-date { margin: 6px 0 0; font-size: .72rem; color: var(--text-muted); }

@media (max-width: 860px) {
  .support-layout { grid-template-columns: 1fr; }
  .chat-bubble { max-width: 90%; }
}
@media (max-width: 560px) {
  .rating-block { flex-direction: column; align-items: flex-start; }
  .comment.reply { margin-left: 10px; }
  .notification-item { flex-wrap: wrap; }
  .project-metrics { grid-template-columns: repeat(2, 1fr); }
}

/* ==================== Onboarding ==================== */
.onboarding { max-width: 900px; margin: 0 auto; }
.onboarding-head { text-align: center; margin-bottom: 28px; }
.onboarding-head p { color: var(--text-muted); }
.onboarding-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.onboarding-card {
  position: relative; padding: 22px 18px 18px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.onboarding-num {
  position: absolute; top: 14px; right: 16px; font-size: 1.6rem; font-weight: 800;
  color: var(--border); line-height: 1;
}
.onboarding-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; background: rgba(34,197,94,.12);
  color: var(--primary); margin-bottom: 12px;
}
.onboarding-icon svg { width: 19px; height: 19px; }
.onboarding-card h3 { margin: 0 0 6px; font-size: 1rem; }
.onboarding-card p { margin: 0; color: var(--text-muted); font-size: .87rem; line-height: 1.6; }
.onboarding-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }

/* Bandeau de rappel affiché sur le tableau de bord */
.onboarding-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; border-radius: var(--radius); margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(34,197,94,.12), transparent);
  border: 1px solid rgba(34,197,94,.3);
}
.onboarding-banner svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.onboarding-banner p { margin: 0; flex: 1; min-width: 200px; font-size: .9rem; }

/* ==================== Bandeaux PWA (installation / mise à jour) ==================== */
.pwa-banner[hidden] { display: none; }
.pwa-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; border-radius: 12px; font-size: .88rem;
  background: var(--bg-card); border: 1px solid var(--primary);
  box-shadow: 0 12px 32px -12px rgba(0,0,0,.6);
}
.pwa-banner-actions { display: flex; align-items: center; gap: 10px; }
@media (max-width: 520px) {
  .pwa-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .pwa-banner-actions { justify-content: center; }
}

/* Réglage des notifications push */
.push-settings { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.push-status { color: var(--text-muted); font-size: .84rem; margin: 0; }

/* ==================== En-tête de projet (logo à gauche, titre à droite) ==================== */
.project-header-row { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 16px; }
.project-header-thumb {
  width: 110px; height: 110px; object-fit: cover; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-card-2); flex-shrink: 0;
}
.project-header-info { flex: 1; min-width: 0; }
.project-header-info h1 { margin: 6px 0 4px; }

@media (max-width: 560px) {
  .project-header-row { flex-direction: column; align-items: center; text-align: center; }
  .project-header-thumb { width: 140px; height: 140px; }
}

/* ==================== Projets "à la une" ==================== */
.card-featured { position: relative; border-color: var(--primary) !important; }
.featured-flag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary); color: #06210f; font-size: .72rem; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
}
.featured-flag svg { width: 11px; height: 11px; }

/* ==================== Formulaire de mise en avant ==================== */
.boost-form { margin-top: 12px; padding: 14px; background: var(--bg-card-2); border-radius: 10px; display: flex; flex-direction: column; gap: 10px; max-width: 320px; }
.boost-options { display: flex; flex-direction: column; gap: 6px; }
.boost-option { display: flex; align-items: center; gap: 8px; font-weight: normal; font-size: .88rem; cursor: pointer; }
.boost-option input { width: auto; }

/* ==================== Carrousel horizontal (glisser/swiper) ==================== */
.carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 4px 14px;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.carousel-card {
  flex: 0 0 auto;
  width: 260px;
  scroll-snap-align: start;
}
/* Scrollbar discrète plutôt que masquée : garde l'affordance "ça défile" */
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-track { background: transparent; }
.carousel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.carousel::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.carousel { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

@media (max-width: 480px) {
  .carousel-card { width: 220px; }
}

/* ==================== Téléphone avec indicatif pays ==================== */
.phone-input-row { display: flex; gap: 8px; }
.phone-dial-select { flex: 0 0 130px; }
.phone-input-row input { flex: 1; min-width: 0; }

@media (max-width: 420px) {
  .phone-input-row { flex-direction: column; }
  .phone-dial-select { flex: 1; }
}

/* ==================== Zone dangereuse (suppression de compte) ==================== */
.danger-zone { border-color: var(--danger) !important; }
.danger-zone h3 { color: var(--danger); }
