/* =====================================================
   PORTAIL CITOYEN ANIDA — Styles
   portail.anida.sn
   ===================================================== */

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

:root {
  --green:     #1a5c2e;
  --green-d:   #133f20;
  --green-m:   #2d8c4e;
  --green-l:   #e8f5ee;
  --green-ll:  #f0faf4;
  --gold:      #d4a017;
  --gold-l:    #fef9e7;
  --blue:      #2563eb;
  --blue-l:    #eff6ff;
  --red:       #dc2626;
  --red-l:     #fef2f2;
  --orange:    #d97706;
  --orange-l:  #fffbeb;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-400:  #9ca3af;
  --gray-500:  #6b7280;
  --gray-700:  #374151;
  --gray-900:  #111827;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--gray-700);
  background: var(--gray-50);
}

/* ===== NAVBAR ===== */
.navbar {
  background: var(--green);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.navbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}
.navbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
}
.navbar__logo img { height: 36px; filter: brightness(0) invert(1); }
.navbar__logo-txt { font-weight: 700; font-size: .95rem; }
.navbar__logo-sub { font-size: .68rem; opacity: .75; display: block; }
.navbar__sep { flex: 1; }
.navbar__links { display: flex; align-items: center; gap: 6px; }
.navbar__link {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: .86rem;
  transition: .15s;
}
.navbar__link:hover { background: rgba(255,255,255,.12); color: #fff; }
.navbar__link.active { background: rgba(255,255,255,.18); color: #fff; }
.navbar__btn {
  background: #fff;
  color: var(--green);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: .15s;
}
.navbar__btn:hover { background: var(--green-ll); }
.navbar__notif {
  position: relative;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  font-size: 1.1rem;
}
.navbar__notif-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid var(--green);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--green-d) 0%, var(--green) 50%, var(--green-m) 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: .78rem;
  margin-bottom: 16px;
}
.hero__title { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; line-height: 1.25; }
.hero__sub { font-size: 1.05rem; opacity: .88; max-width: 580px; margin: 0 auto 28px; }
.hero__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__btn-prim {
  background: #fff;
  color: var(--green);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  font-size: .95rem;
  transition: .2s;
}
.hero__btn-prim:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.hero__btn-sec {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.35);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  font-size: .95rem;
  transition: .2s;
}
.hero__btn-sec:hover { background: rgba(255,255,255,.2); }

/* ===== STATS BAND ===== */
.stats-band {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: 20px;
}
.stats-band__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  justify-content: space-around;
  flex-wrap: wrap;
}
.stat-item { text-align: center; padding: 8px 20px; }
.stat-item__val { font-size: 1.8rem; font-weight: 800; color: var(--green); }
.stat-item__lbl { font-size: .78rem; color: var(--gray-500); }

/* ===== CONTAINER ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section { padding: 48px 20px; }
.section-title { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); margin-bottom: 6px; }
.section-sub { color: var(--gray-500); margin-bottom: 28px; }

/* ===== GRILLE TYPES DEMANDES ===== */
.demandes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.demande-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.demande-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--card-color, var(--green));
}
.demande-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--card-color, var(--green));
}
.demande-card__icon { font-size: 2rem; margin-bottom: 10px; }
.demande-card__title { font-weight: 700; font-size: .95rem; color: var(--gray-900); margin-bottom: 4px; }
.demande-card__desc { font-size: .8rem; color: var(--gray-500); line-height: 1.5; }
.demande-card__badge {
  position: absolute;
  top: 12px; right: 12px;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--green-l);
  color: var(--green);
}

/* ===== STEPS (comment ça marche) ===== */
.steps { display: flex; gap: 0; flex-wrap: wrap; }
.step { flex: 1; min-width: 180px; padding: 20px; text-align: center; position: relative; }
.step::after {
  content: '→';
  position: absolute;
  right: -10px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--gray-400);
}
.step:last-child::after { display: none; }
.step__num {
  width: 40px; height: 40px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: .9rem;
  margin: 0 auto 10px;
}
.step__title { font-weight: 700; font-size: .88rem; margin-bottom: 4px; }
.step__desc { font-size: .78rem; color: var(--gray-500); }

/* ===== MAIN CONTENT ===== */
.main-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px; }
.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header__title { font-size: 1.4rem; font-weight: 800; color: var(--gray-900); }
.page-header__sub { font-size: .85rem; color: var(--gray-500); margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card__body { padding: 20px 24px; }
.card__header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card__title { font-weight: 700; font-size: .95rem; color: var(--gray-900); }

/* ===== FORMULAIRES ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .84rem; font-weight: 600; color: var(--gray-700); margin-bottom: 5px; }
.form-label span { color: var(--red); }
.form-control {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .88rem;
  color: var(--gray-900);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,92,46,.1);
}
.form-control:hover:not(:focus) { border-color: var(--gray-400); }
.form-hint { font-size: .75rem; color: var(--gray-400); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media(max-width:640px){ .form-row { grid-template-columns: 1fr; } }
textarea.form-control { resize: vertical; min-height: 90px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: .2s;
  background: var(--gray-50);
}
.upload-zone:hover { border-color: var(--green); background: var(--green-ll); }
.upload-zone__icon { font-size: 1.8rem; margin-bottom: 6px; }
.upload-zone__txt { font-size: .82rem; color: var(--gray-500); }

/* ===== BOUTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .15s;
  font-family: inherit;
}
.btn--primary { background: var(--green); color: #fff; }
.btn--primary:hover { background: var(--green-d); }
.btn--secondary { background: #fff; color: var(--gray-700); border-color: var(--gray-200); }
.btn--secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn--outline-green { background: transparent; color: var(--green); border-color: var(--green); }
.btn--outline-green:hover { background: var(--green-l); }
.btn--danger { background: var(--red); color: #fff; }
.btn--sm { padding: 6px 13px; font-size: .8rem; }
.btn--lg { padding: 13px 28px; font-size: .98rem; }
.btn--full { width: 100%; justify-content: center; }

/* ===== BADGES ===== */
.badge { display: inline-block; padding: 3px 9px; border-radius: 12px; font-size: .72rem; font-weight: 700; }
.badge--green  { background: var(--green-l);   color: var(--green); }
.badge--blue   { background: var(--blue-l);    color: var(--blue); }
.badge--orange { background: var(--orange-l);  color: var(--orange); }
.badge--red    { background: var(--red-l);     color: var(--red); }
.badge--gray   { background: var(--gray-100);  color: var(--gray-500); }
.badge--yellow { background: #fef9c3;          color: #854d0e; }

/* ===== ALERTES ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .88rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert--success { background: var(--green-l); color: var(--green-d); border: 1px solid #bbf7d0; }
.alert--error   { background: var(--red-l);   color: #7f1d1d;        border: 1px solid #fca5a5; }
.alert--warning { background: var(--orange-l);color: #78350f;        border: 1px solid #fcd34d; }
.alert--info    { background: var(--blue-l);  color: #1e3a8a;        border: 1px solid #93c5fd; }

/* ===== SUIVI TIMELINE ===== */
.timeline { position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--gray-200);
}
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--gray-300);
  border: 2px solid #fff;
}
.timeline-item.active::before { background: var(--green); }
.timeline-item.done::before   { background: var(--green); }
.timeline-date { font-size: .72rem; color: var(--gray-400); }
.timeline-title { font-weight: 700; font-size: .88rem; color: var(--gray-800); }
.timeline-body  { font-size: .82rem; color: var(--gray-600); margin-top: 2px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 10px 14px; text-align: left; font-size: .78rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); }
td { padding: 12px 14px; font-size: .86rem; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ===== AUTH PAGES ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--green-d) 0%, var(--green) 100%);
}
.auth-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo img { height: 50px; }
.auth-title { font-size: 1.3rem; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; text-align: center; }
.auth-sub { font-size: .84rem; color: var(--gray-500); text-align: center; margin-bottom: 24px; }
.auth-divider { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }
.auth-footer { text-align: center; font-size: .82rem; color: var(--gray-500); margin-top: 16px; }
.auth-footer a { color: var(--green); text-decoration: none; font-weight: 600; }

/* ===== FOOTER ===== */
.footer {
  background: var(--green-d);
  color: rgba(255,255,255,.8);
  padding: 36px 20px 20px;
  margin-top: 60px;
}
.footer__inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer__brand-name { color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.footer__brand-desc { font-size: .78rem; line-height: 1.7; opacity: .7; }
.footer__title { color: #fff; font-weight: 700; font-size: .88rem; margin-bottom: 10px; }
.footer__links { list-style: none; }
.footer__links li { margin-bottom: 6px; }
.footer__links a { color: rgba(255,255,255,.7); text-decoration: none; font-size: .8rem; transition: .15s; }
.footer__links a:hover { color: #fff; }
.footer__bottom { max-width: 1100px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); display: flex; justify-content: space-between; font-size: .75rem; flex-wrap: wrap; gap: 8px; }
@media(max-width:768px){ .footer__inner { grid-template-columns: 1fr 1fr; } }
@media(max-width:480px){ .footer__inner { grid-template-columns: 1fr; } .navbar__links { display: none; } }

/* ===== DASHBOARD CITOYEN ===== */
.dash-grid { display: grid; grid-template-columns: 260px 1fr; gap: 20px; }
.dash-sidebar { }
.dash-sidebar__menu { list-style: none; }
.dash-sidebar__item a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gray-700);
  font-size: .86rem;
  transition: .15s;
}
.dash-sidebar__item a:hover { background: var(--gray-100); }
.dash-sidebar__item.active a { background: var(--green-l); color: var(--green); font-weight: 700; }
.dash-sidebar__sep { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gray-400); padding: 12px 14px 4px; }
@media(max-width:768px){ .dash-grid { grid-template-columns: 1fr; } .dash-sidebar { display: none; } }

/* ===== RESPONSIVE ===== */
@media(max-width:640px) {
  .hero__title { font-size: 1.6rem; }
  .demandes-grid { grid-template-columns: 1fr 1fr; }
}
@media(max-width:400px) {
  .demandes-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 24px 20px; }
}

/* ===== NAVBAR LOGO EMBLEM (sans image) ===== */
.navbar__logo-emblem {
  width: 38px; height: 38px;
  background: rgba(255,255,255,.15);
  border: 2px solid rgba(255,255,255,.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.navbar__logo-leaf { font-size: 1.1rem; }
.navbar__logo-txt  { display: block; font-weight: 800; font-size: .95rem; color: #fff; line-height: 1.2; }
.navbar__logo-sub  { display: block; font-size: .62rem; color: rgba(255,255,255,.65); }

/* Notif badge dans navbar */
.navbar__notif {
  position: relative;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 1.05rem;
  transition: .15s;
}
.navbar__notif:hover { background: rgba(255,255,255,.12); }
.navbar__notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  background: #ef4444;
  color: #fff;
  font-size: .58rem;
  font-weight: 800;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--green);
  padding: 0 3px;
}

/* Avatar + menu déroulant utilisateur */
.navbar__avatar-wrap { position: relative; }
.navbar__avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 2px solid rgba(255,255,255,.35);
  color: #fff;
  font-weight: 800;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: .15s;
}
.navbar__avatar:hover { background: rgba(255,255,255,.3); }
.navbar__usermenu {
  display: none;
  position: absolute;
  top: calc(100% + 8px); right: 0;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 210px;
  z-index: 200;
  overflow: hidden;
}
.navbar__usermenu.open { display: block; }
.navbar__usermenu-header {
  padding: 12px 14px;
  background: var(--green-ll);
  border-bottom: 1px solid var(--gray-200);
  display: flex; flex-direction: column; gap: 2px;
}
.navbar__usermenu-header strong { font-size: .88rem; color: var(--gray-900); }
.navbar__usermenu-header small  { font-size: .72rem; color: var(--gray-500); }
.navbar__usermenu a {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  font-size: .84rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: .12s;
}
.navbar__usermenu a:hover { background: var(--gray-50); }

/* ===== PAGE AUTH — logo plus grand ===== */
.auth-logo-circle {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--green-ll);
  border: 3px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 2rem;
}
