/* ==========================================================================
   ONACIG / SilyPay — Portail Promoteur
   Thème institutionnel unifié (aligné sur le back-office)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,300;0,6..12,400;0,6..12,500;0,6..12,600;0,6..12,700;0,6..12,800;1,6..12,400&display=swap');

:root {
  /* Identité ONACIG */
  --onacig-primary: #123133;
  --onacig-primary-dark: #0b2224;
  --onacig-primary-light: #1c4a4d;
  --onacig-gold: #FCD116;
  --onacig-gold-dark: #b8890a;

  /* Couleurs nationales (accents ponctuels uniquement) */
  --guinee-green: #006233;
  --guinee-red: #CE1126;

  /* Neutres */
  --ink: #162325;
  --muted: #62767a;
  --muted-2: #8a9a99;
  --line: #e6ebe9;
  --line-strong: #d3dcda;
  --surface: #ffffff;
  --surface-soft: #f5f8f7;
  --bg: #f2f5f4;

  /* États du circuit de traitement */
  --st-paiement: #b8860b;
  --st-orientation: #6f5bd0;
  --st-traitement: #0d6efd;
  --st-validation: #0aa06e;
  --st-livraison: #0f8b8d;
  --st-terminee: #14804a;
  --st-rejetee: #c62828;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(15, 35, 37, .05);
  --shadow-sm: 0 2px 6px rgba(15, 35, 37, .06), 0 1px 2px rgba(15, 35, 37, .07);
  --shadow-md: 0 12px 28px rgba(15, 35, 37, .09), 0 3px 8px rgba(15, 35, 37, .06);
  --shadow-lg: 0 24px 56px rgba(15, 35, 37, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Variantes de charte (mix ONACIG / SilyPay / Événements) ---------- */
/* Par défaut : charte institutionnelle ONACIG (vert). Appliquée via body.theme-onacig (implicite). */

.theme-sily {
  --onacig-primary: #15244B;
  --onacig-primary-dark: #0d1730;
  --onacig-primary-light: #223768;
  --onacig-gold: #F5B227;
  --onacig-gold-dark: #cf8d0f;
  --bg: #f3f5fa;
  --surface-soft: #eef1f9;
  --line: #e2e6f0;
  --line-strong: #ccd3e6;
}

.theme-events {
  --onacig-primary: #591b39;
  --onacig-primary-dark: #3b0f26;
  --onacig-primary-light: #7a2650;
  --onacig-gold: #FCD116;
  --onacig-gold-dark: #d9ae00;
  --bg: #f7f2f4;
  --surface-soft: #f4ebee;
  --line: #ecdfe4;
  --line-strong: #dcc3cd;
}

/* ---------- Motifs / textures de fond ---------- */
.bg-pattern-dots {
  background-image: radial-gradient(color-mix(in srgb, var(--onacig-primary) 14%, transparent) 1.4px, transparent 1.4px);
  background-size: 18px 18px;
}
.bg-pattern-soft {
  background: radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--onacig-gold) 16%, transparent), transparent 40%),
              radial-gradient(circle at 88% 92%, color-mix(in srgb, var(--onacig-primary) 10%, transparent), transparent 45%),
              var(--surface-soft);
}
.media-tile {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(140deg, var(--onacig-primary), var(--onacig-primary-light));
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: normal; }
.media-tile .media-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.55) 100%);
}
.media-tile .media-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem 1.1rem; color: #fff; z-index: 1; }

/* Cartes teintées (accent doux) */
.card-tint-primary { background: color-mix(in srgb, var(--onacig-primary) 6%, white); border-color: color-mix(in srgb, var(--onacig-primary) 16%, white); }
.card-tint-gold { background: color-mix(in srgb, var(--onacig-gold) 10%, white); border-color: color-mix(in srgb, var(--onacig-gold) 30%, white); }
.card-tint-dark { background: var(--onacig-primary); color: #fff; border-color: var(--onacig-primary); }
.card-tint-dark h1, .card-tint-dark h2, .card-tint-dark h3, .card-tint-dark h4, .card-tint-dark h5, .card-tint-dark h6 { color: #fff; }
.card-tint-dark .text-muted { color: rgba(255,255,255,.7) !important; }

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

html, body {
  font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  scroll-behavior: smooth;
  letter-spacing: .1px;
}

body { min-height: 100vh; }

h1, h2, h3, h4, h5, h6 { font-family: 'Nunito Sans', sans-serif; font-weight: 800; color: var(--onacig-primary); letter-spacing: -.01em; }
h1 { letter-spacing: -.02em; }
p { line-height: 1.7; }

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

.text-onacig { color: var(--onacig-primary) !important; }
.text-gold { color: var(--onacig-gold-dark) !important; }
.text-muted-2 { color: var(--muted-2) !important; }
.bg-onacig { background-color: var(--onacig-primary) !important; }
.bg-onacig-soft { background-color: var(--surface-soft) !important; }

.section-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  color: var(--onacig-gold-dark); font-weight: 800; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .07em;
}
.section-eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--onacig-gold-dark); display: inline-block; border-radius: 2px; }

/* ---------- Boutons ---------- */
.btn-onacig, .primary-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--onacig-primary);
  color: #fff !important;
  border: 1px solid var(--onacig-primary);
  padding: .68rem 1.45rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .92rem;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  white-space: nowrap;
}
.btn-onacig:hover, .primary-button:hover {
  background: var(--onacig-primary-dark);
  border-color: var(--onacig-primary-dark);
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-onacig:active, .primary-button:active { transform: translateY(0); }

.btn-onacig-gold {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--onacig-gold);
  color: var(--onacig-primary) !important;
  border: 1px solid var(--onacig-gold);
  padding: .68rem 1.45rem;
  border-radius: 999px;
  font-weight: 800;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn-onacig-gold:hover { background: var(--onacig-gold-dark); border-color: var(--onacig-gold-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.outline-button, .btn-onacig-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: transparent;
  color: var(--onacig-primary) !important;
  border: 1.5px solid var(--line-strong);
  padding: .63rem 1.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: .92rem;
  transition: all .18s var(--ease);
}
.outline-button:hover, .btn-onacig-outline:hover {
  background: var(--onacig-primary);
  border-color: var(--onacig-primary);
  color: #fff !important;
  transform: translateY(-2px);
}

/* ---------- Cartes ---------- */
.card-onacig {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: box-shadow .22s var(--ease), transform .22s var(--ease), border-color .22s var(--ease);
}
.card-onacig:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--line-strong); }

.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Formulaires ---------- */
.form-control, .form-select, textarea.form-control, .bp {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .68rem .95rem;
  font-size: .95rem;
  background: var(--surface);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-control:focus, .form-select:focus, .bp:focus {
  border-color: var(--onacig-primary);
  box-shadow: 0 0 0 .2rem rgba(18, 49, 51, .1);
}
.form-label, .label-text { font-weight: 700; font-size: .86rem; color: var(--onacig-primary); margin-bottom: .35rem; }
.border-input { border: 1.5px solid var(--line) !important; }
.input-group-text { border: 1.5px solid var(--line); }

/* ---------- Badges de statut du circuit ---------- */
.badge-status { padding: .45rem .9rem; border-radius: 999px; font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; gap: .4rem; letter-spacing: .01em; }
.badge-paiement    { background: color-mix(in srgb, var(--st-paiement) 14%, white);    color: var(--st-paiement); }
.badge-orientation { background: color-mix(in srgb, var(--st-orientation) 14%, white); color: var(--st-orientation); }
.badge-traitement  { background: color-mix(in srgb, var(--st-traitement) 14%, white);  color: var(--st-traitement); }
.badge-validation  { background: color-mix(in srgb, var(--st-validation) 14%, white);  color: var(--st-validation); }
.badge-livraison   { background: color-mix(in srgb, var(--st-livraison) 14%, white);   color: var(--st-livraison); }
.badge-terminee    { background: color-mix(in srgb, var(--st-terminee) 14%, white);    color: var(--st-terminee); }
.badge-rejetee     { background: color-mix(in srgb, var(--st-rejetee) 14%, white);     color: var(--st-rejetee); }

/* ---------- Navbar ---------- */
.onacig-navbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 1px 0 var(--line), 0 2px 12px rgba(15,35,37,.03);
}
.onacig-navbar::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--onacig-gold) 0%, var(--onacig-gold) 40%, var(--guinee-red) 40%, var(--guinee-red) 70%, var(--onacig-primary) 70%);
  opacity: .9;
}
.onacig-navbar .navbar-brand { display: flex; align-items: center; gap: .6rem; }
.onacig-navbar .navbar-brand img { height: 42px; }
.brand-duo { display: flex; align-items: center; gap: .65rem; }
.brand-duo .brand-chip-onacig { height: 40px; width: auto; }
.brand-duo .brand-chip-sily { height: 34px; width: auto; border-radius: 8px; }
.brand-duo .brand-sep { width: 1px; height: 28px; background: var(--line-strong); }
.onacig-navbar .brand-text { line-height: 1.1; }
.onacig-navbar .brand-text strong { display: block; color: var(--onacig-primary); font-weight: 800; font-size: 1.05rem; }
.onacig-navbar .brand-text span { display: block; color: var(--muted); font-size: .72rem; }
.onacig-navbar .nav-link { color: var(--ink); font-weight: 600; font-size: .91rem; padding: .5rem .9rem !important; position: relative; }
.onacig-navbar .nav-link.active, .onacig-navbar .nav-link:hover { color: var(--onacig-primary); }
.onacig-navbar .nav-link.active::after {
  content: ""; position: absolute; left: .9rem; right: .9rem; bottom: .1rem; height: 2px;
  background: var(--onacig-gold-dark); border-radius: 2px;
}
.nav-link-verify { color: var(--onacig-primary-dark) !important; font-weight: 800 !important; background: color-mix(in srgb, var(--onacig-gold) 22%, white); border-radius: 999px; padding: .45rem 1rem !important; }
.nav-link-verify:hover { background: var(--onacig-gold); }
.onacig-topbar { background: var(--onacig-primary); color: #eaf3f2; font-size: .8rem; }
.onacig-topbar a { color: #eaf3f2; opacity: .9; }
.onacig-topbar a:hover { opacity: 1; color: var(--onacig-gold); }

/* ---------- Motif de sécurité (guilloche léger) ---------- */
.security-pattern {
  position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image:
    repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, #fff 0 1px, transparent 1px 14px);
}

/* ---------- Hero ---------- */
.onacig-hero {
  background: linear-gradient(150deg, var(--onacig-primary) 0%, var(--onacig-primary-dark) 100%);
  color: #fff;
  border-radius: 0 0 36px 36px;
  position: relative;
  overflow: hidden;
}
.onacig-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 88% 12%, rgba(252, 209, 22, .18), transparent 42%);
  pointer-events: none;
}
.onacig-hero .eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--onacig-gold);
  font-weight: 700; font-size: .78rem;
  padding: .42rem .95rem; border-radius: 999px;
  letter-spacing: .03em;
  position: relative; z-index: 1;
}
.onacig-hero h1 { color: #fff; position: relative; z-index: 1; }
.onacig-hero p.lead { color: rgba(255,255,255,.85); position: relative; z-index: 1; }
.onacig-hero > .container { position: relative; z-index: 1; }
.onacig-hero .watermark-emblem {
  position: absolute; right: -60px; top: 50%; transform: translateY(-50%);
  width: 340px; opacity: .07; pointer-events: none; z-index: 0;
}

/* ---------- Étapes (mécanisme / stepper) ---------- */
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; height: 100%; position: relative; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.step-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.step-card .step-num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--onacig-primary); color: var(--onacig-gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; margin-bottom: .9rem;
}

/* ---------- Timeline verticale (suivi de dossier) ---------- */
.tl { position: relative; padding-left: 2.1rem; }
.tl::before { content: ""; position: absolute; left: .78rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--line); }
.tl-step { position: relative; padding-bottom: 1.6rem; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step .tl-dot {
  position: absolute; left: -2.1rem; top: 0;
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 2px solid var(--line); color: var(--muted);
  font-size: .8rem;
}
.tl-step.is-done .tl-dot { background: var(--onacig-primary); border-color: var(--onacig-primary); color: #fff; }
.tl-step.is-active .tl-dot { background: var(--onacig-gold); border-color: var(--onacig-gold); color: var(--onacig-primary); }
.tl-step.is-rejected .tl-dot { background: var(--st-rejetee); border-color: var(--st-rejetee); color: #fff; }
.tl-step h6 { margin-bottom: .15rem; font-size: .92rem; }
.tl-step small { color: var(--muted); }

/* ---------- Wizard (nouvelle demande) ---------- */
.wizard-steps { display: flex; align-items: center; gap: .5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.wizard-steps .ws-item { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-weight: 700; font-size: .85rem; }
.wizard-steps .ws-item .ws-circle { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.wizard-steps .ws-item.done .ws-circle, .wizard-steps .ws-item.active .ws-circle { background: var(--onacig-primary); border-color: var(--onacig-primary); color: #fff; }
.wizard-steps .ws-item.done, .wizard-steps .ws-item.active { color: var(--onacig-primary); }
.wizard-steps .ws-sep { flex: 1; height: 2px; background: var(--line); min-width: 24px; }

/* ---------- Compatibilité vues détail demande ---------- */
.card-premium { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); transition: box-shadow .2s var(--ease); }
.card-premium:hover { box-shadow: var(--shadow-md); }
.label-title { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; margin-bottom: .2rem; }
.value-strong { font-weight: 700; font-size: .96rem; color: var(--ink); }
.btn-premium { border-radius: 999px; }

/* ---------- Sceau d'authenticité / certificat de vérification ---------- */
.certificate-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.certificate-card .certificate-band {
  height: 8px;
  background: linear-gradient(90deg, var(--onacig-gold) 0 33%, var(--guinee-red) 33% 66%, var(--onacig-primary) 66% 100%);
}
.certificate-card .certificate-watermark {
  position: absolute; right: -40px; bottom: -40px; width: 260px; opacity: .05; pointer-events: none;
}
.seal {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  position: relative;
}
.seal.seal-valid { background: color-mix(in srgb, var(--st-terminee) 12%, white); border: 2px dashed var(--st-terminee); color: var(--st-terminee); }
.seal.seal-invalid { background: color-mix(in srgb, var(--st-rejetee) 12%, white); border: 2px dashed var(--st-rejetee); color: var(--st-rejetee); }
.seal i { font-size: 2.6rem; }
.verify-field { border-bottom: 1px dashed var(--line); padding: .7rem 0; display: flex; justify-content: space-between; gap: 1rem; }
.verify-field:last-child { border-bottom: none; }
.verify-field .vf-label { color: var(--muted); font-size: .84rem; font-weight: 600; }
.verify-field .vf-value { font-weight: 700; text-align: right; color: var(--ink); }

/* ---------- Modales d'authentification ---------- */
.modal-onacig .modal-content { border: none; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-onacig .modal-header {
  background: linear-gradient(135deg, var(--onacig-primary), var(--onacig-primary-dark));
  color: #fff; border: none; padding: 1.75rem 1.75rem 1.25rem;
}
.modal-onacig .modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.modal-onacig .modal-body { padding: 1.75rem; }
.modal-onacig .modal-body .form-control, .modal-onacig .modal-body .form-select {
  border: 1.6px solid var(--line-strong);
}
.modal-onacig .modal-body .form-control:focus, .modal-onacig .modal-body .form-select:focus {
  border-color: var(--onacig-primary);
}
.modal-onacig .modal-brand-logos { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.modal-onacig .modal-brand-logos img { height: 30px; }
.modal-onacig .modal-brand-logos .sep { width: 1px; height: 20px; background: rgba(255,255,255,.3); }
.modal-switch-link { cursor: pointer; }

/* ---------- Divers ---------- */
.divider-dashed { border-top: 1px dashed var(--line); }
.icon-tile { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--surface-soft); color: var(--onacig-primary); font-size: 1.4rem; transition: transform .2s var(--ease); }
.card-onacig:hover .icon-tile { transform: scale(1.06); }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.stat-card .stat-num { font-size: 1.85rem; font-weight: 800; color: var(--onacig-primary); }
.stat-card .stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; }

footer.onacig-footer { background: var(--onacig-primary-dark); color: #d9e5e4; }
footer.onacig-footer a { color: #d9e5e4; opacity: .85; }
footer.onacig-footer a:hover { opacity: 1; color: var(--onacig-gold); }
footer.onacig-footer h6 { color: #fff; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
footer.onacig-footer .footer-bottom { background: rgba(0,0,0,.18); font-size: .82rem; }

.empty-state { text-align: center; padding: 3.5rem 1.5rem; color: var(--muted); }
.empty-state i { font-size: 2.6rem; opacity: .35; display: block; margin-bottom: .8rem; }

/* ---------- Pagination (Bootstrap 5) ---------- */
.pagination .page-link { color: var(--onacig-primary); border-color: var(--line); font-weight: 600; }
.pagination .page-item.active .page-link { background: var(--onacig-primary); border-color: var(--onacig-primary); }
.pagination .page-link:hover { background: var(--surface-soft); color: var(--onacig-primary-dark); }

@media (max-width: 767px) {
  .onacig-hero { border-radius: 0 0 22px 22px; }
  .wizard-steps .ws-item span.ws-label { display: none; }
  .onacig-hero .watermark-emblem { display: none; }
}

@media print {
  .onacig-navbar, footer.onacig-footer, .onacig-topbar, .no-print { display: none !important; }
}
