/* =========================================================
   SellAfri — Feuille de style principale
   Palette : vert agricole, terre cuite, ocre doré
   ========================================================= */

:root {
  --sa-green: #1f7a4d;
  --sa-green-dark: #145c39;
  --sa-green-light: #e8f5ee;
  --sa-orange: #e8792f;
  --sa-orange-dark: #c85f1c;
  --sa-ocre: #f2a71b;
  --sa-earth: #6b4226;
  --sa-cream: #fbf7ef;
  --sa-dark: #212b24;
  --sa-text-muted: #6b7a71;
  --sa-radius: 16px;
  --sa-shadow: 0 10px 30px rgba(21, 60, 40, .08);
  --sa-shadow-hover: 0 16px 40px rgba(21, 60, 40, .16);
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--sa-dark);
  background-color: var(--sa-cream);
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
}

a { text-decoration: none; }

.text-green { color: var(--sa-green) !important; }
.text-orange { color: var(--sa-orange) !important; }
.bg-green { background-color: var(--sa-green) !important; }
.bg-green-light { background-color: var(--sa-green-light) !important; }
.bg-cream { background-color: var(--sa-cream) !important; }
.bg-orange { background-color: var(--sa-orange) !important; color: #fff; }

/* -------------------- Boutons -------------------- */
.btn-primary {
  background-color: var(--sa-green);
  border-color: var(--sa-green);
  font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--sa-green-dark);
  border-color: var(--sa-green-dark);
}
.btn-outline-primary {
  color: var(--sa-green);
  border-color: var(--sa-green);
  font-weight: 600;
}
.btn-outline-primary:hover {
  background-color: var(--sa-green);
  border-color: var(--sa-green);
}
.btn-orange {
  background-color: var(--sa-orange);
  border-color: var(--sa-orange);
  color: #fff;
  font-weight: 600;
}
.btn-orange:hover {
  background-color: var(--sa-orange-dark);
  border-color: var(--sa-orange-dark);
  color: #fff;
}
.btn-lg { border-radius: 50px; padding: .8rem 1.8rem; }
.btn-sm.rounded-pill, .btn.rounded-pill { font-weight: 600; }

/* -------------------- Navbar -------------------- */
.site-navbar {
  background-color: rgba(251, 247, 239, .96);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 20px rgba(21, 60, 40, .06);
  padding-top: .8rem;
  padding-bottom: .8rem;
}
.navbar-brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--sa-green-dark) !important;
}
.navbar-brand span { color: var(--sa-orange); }
.navbar-brand i { color: var(--sa-orange); }
.nav-link {
  font-weight: 500;
  color: var(--sa-dark) !important;
  margin: 0 .4rem;
}
.nav-link:hover { color: var(--sa-green) !important; }
.avatar-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--sa-green);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}

/* -------------------- Hero -------------------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--sa-green-dark) 0%, var(--sa-green) 55%, var(--sa-ocre) 130%);
  color: #fff;
  overflow: hidden;
  padding: 5.5rem 0 7rem;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 15% 25%, rgba(255,255,255,.10) 0, transparent 40%),
                     radial-gradient(circle at 85% 75%, rgba(255,255,255,.10) 0, transparent 45%);
}
.hero .hero-badge {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50px;
  padding: .4rem 1rem;
  font-size: .85rem;
  display: inline-flex; align-items: center; gap: .5rem;
}
.hero h1 {
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  line-height: 1.15;
}
.hero p.lead { color: rgba(255,255,255,.9); }
.hero-stats {
  display: flex; gap: 2.2rem; flex-wrap: wrap;
}
.hero-stats .stat-num {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
}
.hero-stats .stat-label { font-size: .85rem; color: rgba(255,255,255,.8); }

.hero-visual {
  position: relative;
  z-index: 1;
}
.hero-card-float {
  position: absolute;
  background: #fff;
  color: var(--sa-dark);
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow-hover);
  padding: .9rem 1.1rem;
  font-size: .85rem;
  font-weight: 600;
}

.search-box {
  background: #fff;
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow-hover);
  padding: 1rem;
  margin-top: -3.2rem;
  position: relative;
  z-index: 2;
}
.search-box .form-select, .search-box .form-control {
  border-radius: 10px;
  border: 1px solid #e3ded0;
}

/* -------------------- Sections generales -------------------- */
.section { padding: 4.5rem 0; }
.section-title-eyebrow {
  color: var(--sa-orange);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-size: .8rem;
}
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-sub { color: var(--sa-text-muted); max-width: 620px; }

/* -------------------- Cartes categories -------------------- */
.category-card {
  background: #fff;
  border-radius: var(--sa-radius);
  padding: 1.6rem 1rem;
  text-align: center;
  box-shadow: var(--sa-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  border: 1px solid transparent;
  height: 100%;
}
.category-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--sa-shadow-hover);
  border-color: var(--sa-green-light);
}
.category-card .icon-wrap {
  width: 58px; height: 58px;
  border-radius: 16px;
  background: var(--sa-green-light);
  color: var(--sa-green);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto .9rem;
  overflow: hidden;
}
.category-card .icon-wrap.category-photo { background: none; }
.category-card .icon-wrap.category-photo img {
  width: 100%; height: 100%; object-fit: cover;
}
.category-card:hover .icon-wrap { background: var(--sa-green); color: #fff; }
.category-card span { font-weight: 600; font-size: .95rem; }

/* -------------------- Cartes produits -------------------- */
.product-card {
  background: #fff;
  border-radius: var(--sa-radius);
  overflow: hidden;
  box-shadow: var(--sa-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  height: 100%;
  border: 1px solid #f0ece1;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--sa-shadow-hover); }
.product-card .product-img-wrap {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: var(--sa-green-light);
}
.product-card .product-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.product-card:hover .product-img-wrap img { transform: scale(1.08); }
.product-card .product-img-wrap .no-img {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--sa-green); font-size: 2.6rem;
}
.product-card .badge-origin {
  position: absolute; top: .7rem; left: .7rem;
  background: rgba(255,255,255,.92);
  color: var(--sa-earth);
  font-size: .72rem; font-weight: 700;
  padding: .3rem .6rem; border-radius: 50px;
}
.product-card .badge-cat {
  position: absolute; top: .7rem; right: .7rem;
  background: var(--sa-orange);
  color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: .3rem .6rem; border-radius: 50px;
}
.product-card .body { padding: 1.1rem 1.2rem 1.3rem; }
.product-card .product-title {
  font-weight: 700; font-size: 1.02rem;
  margin-bottom: .2rem;
  color: var(--sa-dark);
}
.product-card .product-seller {
  font-size: .8rem; color: var(--sa-text-muted);
}
.product-card .product-price {
  font-family: 'Poppins', sans-serif;
  font-weight: 800; color: var(--sa-green);
  font-size: 1.15rem;
}
.product-card .product-price small {
  font-weight: 500; color: var(--sa-text-muted); font-size: .75rem;
}

/* -------------------- How it works -------------------- */
.step-card { text-align: center; padding: 1.5rem; }
.step-num {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--sa-green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-family: 'Poppins', sans-serif;
  margin: 0 auto 1rem;
}
.step-card.orange .step-num { background: var(--sa-orange); }

/* -------------------- Section CTA -------------------- */
.cta-band {
  background: linear-gradient(120deg, var(--sa-green-dark), var(--sa-green));
  border-radius: 24px;
  color: #fff;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: '';
  position: absolute; right: -60px; bottom: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}

/* -------------------- Cartes generiques / dashboard -------------------- */
.card-soft {
  background: #fff;
  border: 1px solid #f0ece1;
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow);
}
.stat-widget {
  background: #fff;
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow);
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-widget .icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  flex-shrink: 0;
}
.stat-widget .num { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.5rem; }
.stat-widget .label { color: var(--sa-text-muted); font-size: .85rem; }

.dashboard-sidebar {
  background: #fff;
  border-radius: var(--sa-radius);
  box-shadow: var(--sa-shadow);
  padding: 1.2rem;
}
.dashboard-sidebar .nav-link {
  color: var(--sa-dark) !important;
  border-radius: 10px;
  padding: .65rem .9rem;
  font-weight: 500;
  margin-bottom: .25rem;
}
.dashboard-sidebar .nav-link.active, .dashboard-sidebar .nav-link:hover {
  background: var(--sa-green-light);
  color: var(--sa-green-dark) !important;
}
.dashboard-sidebar .nav-link i { width: 20px; }

/* -------------------- Auth pages -------------------- */
.auth-wrapper {
  min-height: calc(100vh - 76px);
  display: flex; align-items: center;
  background: linear-gradient(135deg, var(--sa-green-light) 0%, #fff 60%);
  padding: 3rem 0;
}
.auth-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--sa-shadow-hover);
  overflow: hidden;
}
.auth-side {
  background: linear-gradient(150deg, var(--sa-green-dark), var(--sa-green));
  color: #fff;
  padding: 3rem 2.2rem;
  height: 100%;
}
.role-choice {
  border: 2px solid #e6e2d7;
  border-radius: 14px;
  padding: 1rem;
  cursor: pointer;
  transition: all .2s ease;
  height: 100%;
}
.role-choice:hover { border-color: var(--sa-green); }
.role-choice input:checked ~ .role-choice-inner,
.role-choice.active {
  border-color: var(--sa-green);
  background: var(--sa-green-light);
}
input[type=radio].role-radio { display: none; }
input[type=radio].role-radio:checked + .role-choice {
  border-color: var(--sa-green);
  background: var(--sa-green-light);
  box-shadow: 0 0 0 3px rgba(31,122,77,.15);
}

/* -------------------- Contrat -------------------- */
.contract-box {
  background: #fffdf7;
  border: 1px solid #ecdfc0;
  border-radius: 14px;
  padding: 1.8rem;
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-line;
  font-size: .92rem;
  line-height: 1.7;
  font-family: 'Georgia', serif;
}

/* -------------------- Footer -------------------- */
.site-footer {
  background: var(--sa-dark);
  padding: 4rem 0 0;
}
.footer-links li { margin-bottom: .6rem; }
.footer-links a { color: rgba(255,255,255,.75); }
.footer-links a:hover { color: var(--sa-orange); }

/* -------------------- Preloader 3D -------------------- */
body.preloader-active { overflow: hidden; height: 100vh; }

.preloader {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--sa-green-dark) 0%, var(--sa-green) 55%, var(--sa-ocre) 140%);
  transition: opacity .6s ease, visibility .6s ease;
}
.preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.preloader-scene {
  perspective: 1100px;
  width: 160px; height: 160px;
}
.preloader-stage {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
}

/* Chaque produit occupe le centre de la scene et se succede aux autres :
   un cycle complet dure 9.6s (2.4s par produit) ; les delais decalent
   chaque element pour qu'ils s'enchainent un par un, sans jamais se superposer. */
.p-item {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  filter: drop-shadow(0 16px 20px rgba(0,0,0,.32));
  animation: productReveal 9.6s cubic-bezier(.34,1.56,.64,1) infinite;
}
.p-item-1 { animation-delay: 0s; }
.p-item-2 { animation-delay: 2.4s; }
.p-item-3 { animation-delay: 4.8s; }
.p-item-4 { animation-delay: 7.2s; }

.p-icon { width: 118px; height: 118px; }

@keyframes productReveal {
  0%   { opacity: 0; transform: perspective(700px) rotateY(-130deg) scale(.3) translateY(18px); }
  6%   { opacity: 1; transform: perspective(700px) rotateY(20deg) scale(1.14) translateY(-10px); }
  11%  { opacity: 1; transform: perspective(700px) rotateY(-6deg) scale(.97) translateY(2px); }
  14%  { opacity: 1; transform: perspective(700px) rotateY(0deg) scale(1) translateY(0); }
  20%  { opacity: 1; transform: perspective(700px) rotateY(0deg) scale(1) translateY(0); }
  25%  { opacity: 0; transform: perspective(700px) rotateY(130deg) scale(.3) translateY(-18px); }
  100% { opacity: 0; transform: perspective(700px) rotateY(130deg) scale(.3) translateY(-18px); }
}

.preloader-brand {
  margin-top: 2.4rem;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
}
.preloader-brand span { color: #ffe3c2; }
.preloader-tagline {
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  margin-top: .35rem;
  text-align: center;
  padding: 0 1.5rem;
}
.preloader-bar {
  width: 180px; height: 4px;
  background: rgba(255,255,255,.25);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 1.6rem;
}
.preloader-bar span {
  display: block; height: 100%; width: 35%;
  background: #fff; border-radius: 10px;
  animation: preloaderBar 1.3s ease-in-out infinite;
}
@keyframes preloaderBar {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(380%); }
}

@media (prefers-reduced-motion: reduce) {
  .p-item { animation: none; opacity: 1; transform: none; }
  .p-item:not(.p-item-1) { display: none; }
  .preloader-bar span { animation: none; width: 100%; }
}

/* -------------------- Divers -------------------- */
.badge-status-en_attente { background:#f2a71b; }
.badge-status-confirmee { background:#2f8fd1; }
.badge-status-expediee { background:#8a5cf5; }
.badge-status-livree { background:#1f7a4d; }
.badge-status-annulee { background:#d64545; }

.form-control:focus, .form-select:focus {
  border-color: var(--sa-green);
  box-shadow: 0 0 0 .2rem rgba(31,122,77,.15);
}
.form-label { font-weight: 600; font-size: .9rem; }

/* -------------------- Affichage / masquage du mot de passe -------------------- */
.password-wrapper { position: relative; }
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] { padding-right: 2.6rem; }
.password-toggle {
  position: absolute;
  top: 50%; right: .4rem;
  transform: translateY(-50%);
  border: none; background: transparent;
  color: var(--sa-text-muted);
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  padding: 0;
  font-size: 1.05rem;
  transition: color .15s ease, background-color .15s ease;
}
.password-toggle:hover { color: var(--sa-green); background-color: var(--sa-green-light); }
.password-toggle:focus { outline: none; box-shadow: 0 0 0 .15rem rgba(31,122,77,.25); }

.empty-state { text-align: center; padding: 4rem 1rem; color: var(--sa-text-muted); }
.empty-state i { font-size: 3rem; color: var(--sa-green-light); }

@media (max-width: 991px) {
  .hero { padding: 3.5rem 0 5rem; text-align: center; }
  .hero-stats { justify-content: center; }
}
