:root {
  --ae-white: #ffffff;
  --ae-red: #e20917;
  --ae-navy: #152945;
  --ae-gray-bg: #f4f4f4;
  --ae-gray-text: #6c757d;
  --ae-navbar-bg: #f8f9fb;
  --ae-navbar-border: rgba(21, 41, 69, 0.08);
}

body {
  font-family: 'Inter', 'Poppins', system-ui, sans-serif;
  color: #1d2733;
}

.ae-navy-bg { background-color: var(--ae-navy) !important; }
.ae-gray-bg { background-color: var(--ae-gray-bg) !important; }
.ae-text-red { color: var(--ae-red) !important; }
.ae-text-muted { color: var(--ae-gray-text) !important; }

.btn-ae-red {
  background-color: var(--ae-red);
  border-color: var(--ae-red);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
}
.btn-ae-red:hover { background-color: #c10813; border-color: #c10813; color: #fff; }

.btn-ae-navy {
  background-color: var(--ae-navy);
  border-color: var(--ae-navy);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
}
.btn-ae-navy:hover { background-color: #0f1f36; border-color: #0f1f36; color: #fff; }

.ae-navbar {
  background-color: var(--ae-navbar-bg) !important;
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--ae-navbar-border);
  box-shadow: 0 4px 24px rgba(21, 41, 69, 0.06);
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.ae-navbar-logo {
  height: 62px;
  width: auto;
  display: block;
}

.ae-navbar .nav-link,
.ae-navbar .dropdown-toggle {
  color: var(--ae-navy) !important;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.5rem 0.9rem !important;
  border-radius: 10px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.ae-navbar .nav-link:hover,
.ae-navbar .nav-link:focus,
.ae-navbar .dropdown-toggle:hover,
.ae-navbar .dropdown-toggle:focus,
.ae-navbar .dropdown-toggle.show {
  color: var(--ae-red) !important;
  background-color: rgba(21, 41, 69, 0.05);
}

.ae-navbar .dropdown-menu {
  border: 1px solid var(--ae-navbar-border);
  border-radius: 12px;
  box-shadow: 0 14px 36px rgba(21, 41, 69, 0.12);
  padding: 0.45rem;
  margin-top: 0.5rem;
}

.ae-navbar .dropdown-item {
  color: var(--ae-navy);
  font-weight: 500;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
}

.ae-navbar .dropdown-item:hover,
.ae-navbar .dropdown-item:focus {
  background-color: rgba(226, 9, 23, 0.08);
  color: var(--ae-red);
}

.ae-navbar .navbar-toggler {
  border-color: rgba(21, 41, 69, 0.18);
  padding: 0.45rem 0.6rem;
}

.ae-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(21, 41, 69, 0.12);
}

@media (max-width: 991.98px) {
  .ae-navbar .navbar-collapse {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--ae-navbar-border);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(21, 41, 69, 0.08);
  }

  .ae-navbar .navbar-nav {
    gap: 0.15rem;
  }
}

.ae-brand-dot { color: var(--ae-red); }

section { scroll-margin-top: 72px; }

.ae-hero {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}
.ae-hero-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(21, 41, 69, 0.7);
}
.ae-hero .container { position: relative; z-index: 2; }

.ae-stat-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  min-height: 220px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem;
  background-size: cover;
  background-position: center;
}
.ae-stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(21,41,69,0.92), rgba(21,41,69,0.45));
}
.ae-stat-card > * { position: relative; z-index: 2; }
.ae-stat-number { font-size: 1.8rem; font-weight: 800; }

.ae-card { border: 1px solid #e9ecef; border-radius: 12px; }
.ae-shadow-soft { box-shadow: 0 4px 16px rgba(21,41,69,0.06); }

.ae-icon-circle {
  width: 56px; height: 56px;
  min-width: 56px;
  border-radius: 50%;
  background-color: var(--ae-navy);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
}

.ae-step-number {
  width: 44px; height: 44px;
  border-radius: 50%;
  background-color: var(--ae-red);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  margin: 0 auto 0.75rem;
}
.ae-step-title { color: var(--ae-red); font-weight: 700; }

.ae-cover-cta {
  position: relative;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.ae-cover-cta::before {
  content: "";
  position: absolute; inset: 0;
  background-color: rgba(21,41,69,0.82);
}
.ae-cover-cta .container { position: relative; z-index: 2; }

.ae-footer a { color: #cdd6e2; text-decoration: none; }
.ae-footer a:hover { color: #fff; }

.ae-auth-wrap {
  min-height: 100vh;
  background-color: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
/* Carte des pages de connexion (acheteur + fournisseur)
   Ajuster les max-width ci-dessous pour chaque taille d'écran */
.ae-auth-card {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 16px;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3.25rem);
  box-shadow: 0 12px 32px rgba(21, 41, 69, 0.08);
}

@media (min-width: 576px) {
  .ae-auth-card { max-width: 320px; }
}

@media (min-width: 768px) {
  .ae-auth-card { max-width: 400px; }
}

@media (min-width: 992px) {
  .ae-auth-card { max-width: 580px; }
}

@media (min-width: 1200px) {
  .ae-auth-card { max-width: 560px; }
}

.ae-auth-card .form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.ae-auth-card .form-control {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 10px;
}

.ae-auth-card .btn-ae-red {
  padding: 0.8rem 1rem;
  font-size: 1.05rem;
}

.ae-auth-card .btn-ae-navy {
  padding: 0.8rem 1rem;
  font-size: 1.05rem;
}
.ae-odd-tile {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; text-align: center; padding: 0.5rem;
}
.ae-carousel img { border-radius: 12px; height: 380px; object-fit: cover; }

.ae-about-carousel {
  overflow: hidden;
  background: #f8f9fb;
}

.ae-about-carousel .carousel-inner,
.ae-about-carousel .carousel-item {
  height: 620px;
}

.ae-about-carousel img {
  width: 100%;
  height: 620px;
  object-fit: cover;
  display: block;
}

@media (max-width: 991.98px) {
  .ae-about-carousel .carousel-inner,
  .ae-about-carousel .carousel-item,
  .ae-about-carousel img {
    height: 300px;
  }
}

/* ===== Refonte moderne 2026 ===== */
.ae-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ae-red);
  background: rgba(226, 9, 23, 0.08);
  padding: .4rem .85rem;
  border-radius: 999px;
}
.ae-eyebrow.ae-eyebrow-light {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.ae-hero-modern {
  background:
    radial-gradient(1200px 500px at 100% -10%, rgba(21,41,69,.06), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
  padding-top: 6rem;
  padding-bottom: 3rem;
}

.ae-hero-modern > .container {
  padding-top: 0px;
  padding-bottom: 2rem;
}

.ae-hero-title { color: var(--ae-navy); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.ae-hero-media { position: relative; height: 100%; }
.ae-hero-media__img,
.ae-hero-media img {
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(21,41,69,.18);
  height: 565px;
  object-fit: cover;
  display: block;
}

.ae-hero-content--spread {
  display: flex;
  flex-direction: column;
  justify-content: space-;
  min-height: auto;
  padding: 0 0;
  gap: 3rem;
}

@media (max-width: 991.98px) {
  .ae-hero-media__img,
  .ae-hero-media img {
    height: 320px;
  }

  .ae-hero-content--spread {
    min-height: auto;
    gap: 2rem;
    padding: 1.25rem 0 0;
  }
}

.ae-float-card {
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(21,41,69,.10);
  padding: 1rem 1.15rem;
}
.ae-float-card .ae-num { color: var(--ae-navy); font-weight: 800; font-size: 1.5rem; line-height: 1; }

.ae-stat-chip {
  border: 1px solid #e9ecef; border-radius: 12px; background: #fff; padding: 1rem 1.25rem;
}
.ae-stat-chip .ae-num { color: var(--ae-navy); font-weight: 800; font-size: 1.6rem; }

.ae-section-title { color: var(--ae-navy); font-weight: 800; letter-spacing: -.01em; }

.ae-feature-card,
.ae-step-card,
.ae-adv-card {
  background: #fff;
  border: 1px solid #eef1f5;
  border-radius: 14px;
  padding: 1.5rem;
  height: 100%;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ae-feature-card:hover,
.ae-step-card:hover,
.ae-adv-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(21,41,69,.10);
}

.ae-step-card {
  padding: 0;
  overflow: hidden;
}

.ae-step-card .card-img-top {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #eef1f5;
}

.ae-step-card__body {
  padding: 1.5rem;
}

.ae-adv-card--horizontal {
  padding: 0;
  overflow: hidden;
}

.ae-adv-card--horizontal .row > .col-md-4 {
  display: flex;
}

.ae-adv-card__media {
  flex: 1;
  width: 100%;
  min-height: 140px;
  overflow: hidden;
  background: #f8f9fb;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ae-adv-card__media img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.ae-adv-card__body {
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

@media (max-width: 767.98px) {
  .ae-adv-card__media,
  .ae-adv-card__media img {
    min-height: 160px;
  }

  .ae-adv-card__body {
    padding: 1rem 1.15rem;
  }
}

.ae-icon-square {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(21,41,69,.06); color: var(--ae-navy); font-size: 1.15rem;
}
.ae-icon-square.ae-red { background: rgba(226,9,23,.08); color: var(--ae-red); }

.ae-step-index {
  font-size: 2.2rem; font-weight: 800; color: rgba(21,41,69,.14); line-height: 1;
}

.ae-cta-band {
  background: linear-gradient(120deg, var(--ae-navy) 0%, #0f2138 100%);
  border-radius: 20px; color: #fff;
}

.ae-btn-lg { padding: .7rem 1.5rem; }

/* ===== Error pages ===== */
.ae-error-body {
  min-height: 100vh;
  margin: 0;
  background: #ffffff;
  color: var(--ae-navy);
}

.ae-error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
}

.ae-error-page__logo {
  height: 64px;
  width: auto;
  margin-bottom: 2rem;
}

.ae-error-page__card {
  width: 100%;
  max-width: 460px;
  background: #ffffff;
  border: 1px solid rgba(21, 41, 69, 0.1);
  border-radius: 16px;
  padding: 2rem 1.75rem;
  box-shadow: 0 10px 36px rgba(21, 41, 69, 0.08);
}

.ae-error-page__code {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--ae-navy);
}

.ae-error-page__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  color: var(--ae-navy);
}

.ae-error-page__message {
  font-size: 0.95rem;
  color: var(--ae-gray-text);
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.ae-error-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
}

.ae-error-page__actions .btn {
  min-width: 170px;
  border-radius: 10px;
  font-weight: 600;
  padding: 0.55rem 1rem;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
  border: 1px solid transparent;
  font-size: 0.95rem;
}

.btn-ae-outline-navy {
  background: #ffffff;
  border-color: rgba(21, 41, 69, 0.18);
  color: var(--ae-navy);
}

.btn-ae-outline-navy:hover {
  background: rgba(21, 41, 69, 0.04);
  color: var(--ae-navy);
  text-decoration: none;
}

@media (max-width: 575.98px) {
  .ae-error-page__code {
    font-size: 2.75rem;
  }

  .ae-error-page__card {
    padding: 1.5rem 1.25rem;
  }
}
