/* ===================================
   CNMSS - Styles Globaux Redesignés
   Design institutionnel tunisien
   =================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&family=Playfair+Display:wght@700;900&display=swap');

:root {
  /* Palette institutionnelle raffinée */
  --navy:        #014F8C;
  --navy-deep:   #012E4A;
  --blue:        #014F8C;
  --blue-mid:    #1a6faa;
  --gold:        #F5A800;
  --gold-light:  #F5D060;
  --gold-shine:  #FFE599;
  --cream:       #FAF8F3;
  --ivory:       #F5F2EA;
  --white:       #FFFFFF;
  --text:        #131C2E;
  --text-soft:   #4A5568;
  --text-muted:  #7A8699;
  --border:      rgba(1,84,134,0.10);
  --border-gold: rgba(245,168,0,0.30);

  /* Shadows */
  --shadow-xs:   0 1px 4px rgba(1,84,134,0.06);
  --shadow-sm:   0 2px 12px rgba(1,84,134,0.08);
  --shadow-md:   0 6px 28px rgba(1,84,134,0.12);
  --shadow-lg:   0 16px 56px rgba(1,84,134,0.16);

  /* Geometry */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  --transition:  all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text);
  background: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', 'Playfair Display', serif;
  letter-spacing: -0.01em;
}

/* ===================================
   TOPBAR
   =================================== */
.topbar {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.70);
  padding: 7px 0;
  font-size: 0.76rem;
  border-bottom: 1px solid rgba(245,168,0,0.22);
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.01em;
}

.topbar i {
  color: var(--gold-light);
  margin-right: 5px;
  font-size: 0.72rem;
}

.topbar a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.2s;
}

.topbar a:hover { color: var(--gold-light); }

.topbar-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}

/* ===================================
   NAVBAR
   =================================== */
.main-navbar {
  background: var(--white);
  box-shadow: 0 1px 0 var(--border), var(--shadow-sm);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.main-navbar .navbar-brand img {
  height: 52px;
  object-fit: contain;
}

/* Logo wordmark beside image */
.navbar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.navbar-brand-text .brand-main {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
}
.navbar-brand-text .brand-sub {
  font-size: 0.60rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.main-navbar .nav-link {
  color: var(--text) !important;
  font-weight: 500;
  font-size: 0.82rem;
  padding: 8px 12px !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  letter-spacing: 0.01em;
  font-family: 'DM Sans', sans-serif;
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
  color: var(--blue) !important;
  background: rgba(26,79,138,0.06);
}

.main-navbar .dropdown-menu {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  border-top: 2px solid var(--gold);
  min-width: 220px;
  padding: 6px;
}

.main-navbar .dropdown-item {
  padding: 9px 14px;
  font-size: 0.84rem;
  color: var(--text);
  transition: var(--transition);
  border-radius: var(--radius-sm);
  font-weight: 400;
}

.main-navbar .dropdown-item:hover {
  background: var(--ivory);
  color: var(--blue);
  padding-left: 18px;
}

/* RDV Button — accent doré institutionnel */
.btn-rdv {
  background: var(--gold) !important;
  color: white !important;
  border: none !important;
  border-radius: var(--radius-sm) !important;
  padding: 9px 22px !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.04em !important;
  transition: var(--transition) !important;
  font-family: 'DM Sans', sans-serif !important;
  text-transform: uppercase !important;
  box-shadow: 0 2px 8px rgba(245,168,0,0.30) !important;
}

.btn-rdv:hover {
  background: var(--gold-light) !important;
  box-shadow: 0 4px 16px rgba(245,168,0,0.40) !important;
  transform: translateY(-1px) !important;
  color: white !important;
}

/* ===================================
   HERO SECTION
   =================================== */
.hero-section {
  position: relative;
  min-height: 620px;
  background: var(--navy);
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Texture institutionnelle : grille fine */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245,168,0,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,168,0,0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* Trait doré vertical décoratif */
.hero-section::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  opacity: 0.6;
}

.hero-waves {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
}

.hero-content {
  position: relative;
  z-index: 1;
  color: white;
}

.hero-content h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 1.4rem;
  letter-spacing: -0.02em;
}

.hero-content h1 em {
  color: var(--gold-light);
  font-style: normal;
}

.hero-content p {
  font-size: 1rem;
  opacity: 0.82;
  max-width: 520px;
  line-height: 1.75;
  margin-bottom: 2rem;
  font-weight: 300;
  font-family: 'DM Sans', sans-serif;
}

/* Badge institutionnel */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,168,0,0.14);
  border: 1px solid rgba(245,168,0,0.35);
  color: var(--gold-shine);
  font-size: 0.70rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 2px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
  font-family: 'DM Sans', sans-serif;
}

.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold-light);
  flex-shrink: 0;
}

/* Stats hero */
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.hero-stat { text-align: left; }

.hero-stat .number {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--gold-shine);
  display: block;
  font-family: 'Cormorant Garamond', serif;
  line-height: 1;
}

.hero-stat .label {
  font-size: 0.72rem;
  opacity: 0.65;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-top: 3px;
  display: block;
}

/* ===================================
   SECTION STYLES
   =================================== */
.section-padding { padding: 84px 0; }

.bg-cream  { background: var(--cream); }
.bg-ivory  { background: var(--ivory); }
.bg-white  { background: var(--white); }
.bg-navy   { background: var(--navy); color: white; }

/* Séparateur de section */
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-family: 'DM Sans', sans-serif;
}

.section-eyebrow::before {
  content: '';
  width: 28px; height: 2px;
  background: var(--gold);
  flex-shrink: 0;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  color: var(--navy);
  font-weight: 700;
  position: relative;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.section-title.on-dark { color: white; }

.section-subtitle {
  color: var(--text-soft);
  font-size: 0.97rem;
  max-width: 580px;
  margin: 0 auto 3rem;
  line-height: 1.75;
  font-weight: 300;
}

.section-divider {
  width: 44px;
  height: 3px;
  background: var(--gold);
  border-radius: 0;
  margin: 0.8rem auto 1rem;
}

.section-divider.left { margin: 0.8rem 0 1rem; }

/* ===================================
   DEPARTMENT CARDS
   =================================== */
.dept-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  transition: var(--transition);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  border-left: 3px solid var(--navy);
}

.dept-card:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
  border-left-color: var(--gold);
  color: var(--navy);
}

.dept-card-icon {
  width: 56px;
  min-height: 56px;
  background: var(--ivory);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
}

.dept-card-body {
  padding: 14px 16px;
  flex: 1;
}

.dept-card h6 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}

.dept-card small {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

/* ===================================
   SERVICE CARDS (Grandes cartes)
   =================================== */
.service-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem 1.6rem;
  text-align: center;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  transition: var(--transition);
  height: 100%;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(26,79,138,0.20);
}

.service-card:hover::after {
  transform: scaleX(1);
}

.service-icon {
  width: 68px;
  height: 68px;
  background: var(--ivory);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.2rem;
  font-size: 1.8rem;
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background: var(--navy);
  border-color: var(--navy);
}

.service-card h5 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--navy);
  font-weight: 700;
  margin-bottom: 0.8rem;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.service-card p {
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.65;
}

/* ===================================
   NEWS CARDS
   =================================== */
.news-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  transition: var(--transition);
  height: 100%;
}

.news-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.news-card-img {
  height: 200px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: rgba(255,255,255,0.20);
  overflow: hidden;
  position: relative;
}

.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-img img {
  transform: scale(1.05);
}

.news-card-body { padding: 1.4rem; }

.news-category {
  display: inline-block;
  background: var(--ivory);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--border-gold);
}

.news-card h5 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--navy);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.news-card p {
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.65;
}

.news-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ===================================
   STATS / CHIFFRES CLÉS
   =================================== */
.stats-section {
  background: var(--navy);
  padding: 72px 0;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245,168,0,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,168,0,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

.stat-card {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom: 2px solid var(--gold);
  transition: var(--transition);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.6s ease both;
}

.stat-card:hover {
  background: rgba(255,255,255,0.07);
  transform: translateY(-4px);
}

.stat-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold-shine);
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-suffix { font-size: 2rem; color: var(--gold-light); }

.stat-label {
  font-size: 0.80rem;
  color: rgba(255,255,255,0.55);
  margin-top: 10px;
  font-weight: 400;
  line-height: 1.45;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===================================
   RDV SECTION
   =================================== */
.rdv-section {
  background: var(--cream);
  padding: 80px 0;
  position: relative;
}

.rdv-card {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 52px;
  color: white;
  position: relative;
  overflow: hidden;
}

.rdv-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 1px solid rgba(245,168,0,0.18);
}

.rdv-card::after {
  content: '';
  position: absolute;
  bottom: -60px; left: -20px;
  width: 150px; height: 150px;
  border-radius: 50%;
  border: 1px solid rgba(245,168,0,0.12);
}

.rdv-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.2rem;
  color: white;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.rdv-card h2 span { color: var(--gold-shine); }

.rdv-card p {
  color: rgba(255,255,255,0.72);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 28px;
  max-width: 400px;
}

.btn-rdv-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: white !important;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  box-shadow: 0 4px 16px rgba(245,168,0,0.35);
}

.btn-rdv-main:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245,168,0,0.45);
  color: white !important;
}

/* Badges RDV */
.rdv-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.rdv-pill {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 2px;
  padding: 5px 12px;
  font-size: 0.76rem;
  color: rgba(255,255,255,0.80);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===================================
   CONTACT INFO SECTION
   =================================== */
.contact-info-bar {
  background: var(--ivory);
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.contact-item {
  text-align: center;
  padding: 1.2rem;
}

.contact-item-icon {
  width: 52px;
  height: 52px;
  background: white;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.1rem;
  color: var(--gold);
  box-shadow: var(--shadow-xs);
}

.contact-item h6 {
  font-family: 'DM Sans', sans-serif;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 5px;
}

.contact-item p,
.contact-item a {
  color: var(--text-soft);
  font-size: 0.86rem;
  text-decoration: none;
  line-height: 1.55;
  transition: color 0.2s;
}

.contact-item a:hover { color: var(--gold); }

/* ===================================
   PAGE BANNER
   =================================== */
.page-banner {
  background: var(--navy);
  color: white;
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}

.page-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245,168,0,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,168,0,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Trait doré gauche */
.page-banner::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, transparent, var(--gold) 50%, transparent);
}

.page-banner h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.page-banner .breadcrumb {
  background: none;
  justify-content: center;
  margin: 0;
  position: relative;
  z-index: 1;
}

.page-banner .breadcrumb-item,
.page-banner .breadcrumb-item a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.84rem;
}

.page-banner .breadcrumb-item.active { color: var(--gold-light); }

/* ===================================
   FOOTER
   =================================== */
.main-footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,0.68);
  padding: 64px 0 0;
}

.footer-brand h5 {
  font-family: 'Cormorant Garamond', serif;
  color: white;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.footer-brand p {
  font-size: 0.83rem;
  line-height: 1.75;
  opacity: 0.65;
  font-weight: 300;
}

.footer-title {
  color: var(--gold-light);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(245,168,0,0.22);
  display: block;
}

.footer-bottom {
  background: rgba(0,0,0,0.30);
  padding: 16px 0;
  margin-top: 0;
  font-size: 0.76rem;
  text-align: center;
  color: rgba(255,255,255,0.30);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li { margin-bottom: 8px; }

.footer-links a {
  color: rgba(255,255,255,0.60);
  text-decoration: none;
  font-size: 0.84rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
}

.footer-links a::before {
  content: '';
  width: 12px; height: 1px;
  background: var(--gold);
  flex-shrink: 0;
  transition: width 0.2s;
}

.footer-links a:hover {
  color: var(--gold-shine);
  padding-left: 3px;
}

.footer-links a:hover::before { width: 18px; }

/* Réseaux sociaux footer */
.social-btn {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.60) !important;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: var(--transition);
}

.social-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: white !important;
  transform: translateY(-2px);
}

/* ===================================
   CHATBOT
   =================================== */
.chatbot-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: var(--navy);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(1,84,134,0.35), inset 0 0 0 1px rgba(212,160,23,0.30);
  z-index: 9999;
  border: none;
  transition: var(--transition);
}

.chatbot-trigger:hover {
  transform: scale(1.06) translateY(-2px);
  box-shadow: 0 8px 28px rgba(1,84,134,0.45), inset 0 0 0 1px rgba(212,160,23,0.50);
}

@keyframes pulse-chat {
  0%, 100% { box-shadow: 0 4px 20px rgba(1,84,134,0.35), inset 0 0 0 1px rgba(212,160,23,0.30); }
  50%       { box-shadow: 0 4px 32px rgba(1,84,134,0.50), inset 0 0 0 1px rgba(212,160,23,0.60); }
}

.chatbot-trigger { animation: pulse-chat 3s ease-in-out infinite; }

.chatbot-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 356px;
  height: 476px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  border: 1px solid var(--border);
  animation: slideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chatbot-header {
  background: var(--navy);
  color: white;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 2px solid var(--gold);
}

.chatbot-avatar {
  width: 36px; height: 36px;
  background: rgba(245,168,0,0.22);
  border: 1px solid rgba(245,168,0,0.40);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  max-width: 82%;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  line-height: 1.55;
}

.chat-msg.bot {
  background: white;
  color: var(--text);
  border-bottom-left-radius: 2px;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  align-self: flex-start;
}

.chat-msg.user {
  background: var(--navy);
  color: white;
  border-bottom-right-radius: 2px;
  align-self: flex-end;
}

.chatbot-input {
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  background: white;
}

.chatbot-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.84rem;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  transition: border-color 0.2s;
}

.chatbot-input input:focus { border-color: var(--blue); }

.chatbot-input button {
  width: 38px; height: 38px;
  background: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.chatbot-input button:hover { background: var(--gold); }

/* ===================================
   DASHBOARD
   =================================== */
.dashboard-sidebar {
  background: var(--navy-deep);
  min-height: 100vh;
  width: 256px;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.dashboard-sidebar .sidebar-logo {
  padding: 1.4rem 1.4rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-nav { padding: 0.8rem 0; flex: 1; }

.sidebar-nav .nav-section-title {
  color: rgba(255,255,255,0.30);
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 1rem 1.4rem 0.4rem;
  font-family: 'DM Sans', sans-serif;
}

.sidebar-nav .nav-item a,
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 1.4rem;
  color: rgba(255,255,255,0.62);
  text-decoration: none;
  font-size: 0.84rem;
  border-left: 2px solid transparent;
  transition: var(--transition);
  font-weight: 400;
}

.sidebar-nav .nav-item a:hover,
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-item a.active,
.sidebar-nav .nav-link.active {
  color: white;
  background: rgba(255,255,255,0.05);
  border-left-color: var(--gold);
}

.sidebar-nav .nav-item a .bi,
.sidebar-nav .nav-link .bi {
  font-size: 1rem;
  width: 18px;
  opacity: 0.80;
}

.dashboard-main {
  margin-left: 256px;
  min-height: 100vh;
  background: var(--ivory);
}

.dashboard-topbar {
  background: white;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-xs);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 99;
}

.dashboard-content { padding: 2rem; }

/* Stat cards dashboard */
.stat-card-dash {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
  transition: var(--transition);
  border-top: 3px solid var(--gold);
}

.stat-card-dash:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.stat-number-dash {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
  font-family: 'Cormorant Garamond', serif;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label-dash {
  color: var(--text-muted);
  font-size: 0.80rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===================================
   AUTH PAGES
   =================================== */
.auth-page {
  min-height: 100vh;
  background: var(--ivory);
  display: flex;
  align-items: center;
  padding: 2rem 0;
}

.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

.auth-side {
  background: var(--navy);
  color: white;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-side::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245,168,0,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,168,0,0.06) 1px, transparent 1px);
  background-size: 36px 36px;
}

/* Trait doré */
.auth-side::after {
  content: '';
  position: absolute;
  top: 0; inset-inline-start: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, transparent, var(--gold) 50%, transparent);
}

.auth-form { padding: 3rem 2.5rem; }

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,79,138,0.10);
}

.btn-primary-cnmss {
  background: var(--navy);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: var(--transition);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-primary-cnmss:hover {
  background: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245,168,0,0.30);
}

/* ===================================
   UTILITIES
   =================================== */
.bg-light-blue { background: var(--cream); }
.text-cnmss    { color: var(--blue); }
.text-gold     { color: var(--gold); }
.text-navy     { color: var(--navy); }

.btn-outline-cnmss {
  border: 1.5px solid var(--blue);
  color: var(--blue);
  border-radius: var(--radius-sm);
  padding: 8px 22px;
  font-weight: 600;
  font-size: 0.84rem;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.btn-outline-cnmss:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: white;
}

.rounded-cnmss { border-radius: var(--radius-sm) !important; }

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
  .hero-section { min-height: 480px; text-align: center; }
  .hero-stats   { justify-content: center; }
  .topbar       { display: none; }

  .dashboard-sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  .dashboard-sidebar.open { transform: translateX(0); }
  .dashboard-main { margin-left: 0; }

  .chatbot-window {
    width: calc(100vw - 32px);
    right: 16px;
  }

  .rdv-card { padding: 32px 24px; }
}
/* ===================================
   Version arabe (RTL)
   =================================== */
/* Police arabe partout, y compris sur les styles inline des pages ; les
   icônes Bootstrap utilisent leur propre police sur ::before. */
html[lang="ar"] body,
html[lang="ar"] body *:not(.bi):not(svg):not(svg *) {
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif !important;
  letter-spacing: normal !important;
}

/* Les numéros de téléphone, e-mails et liens restent lisibles de gauche à droite. */
html[dir="rtl"] .ltr,
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"] {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Flèches directionnelles : retournées en RTL. */
html[dir="rtl"] .bi-arrow-right,
html[dir="rtl"] .bi-arrow-left,
html[dir="rtl"] .bi-chevron-right,
html[dir="rtl"] .bi-chevron-left,
html[dir="rtl"] .bi-arrow-right-short,
html[dir="rtl"] .bi-arrow-left-short,
html[dir="rtl"] .bi-arrow-right-circle,
html[dir="rtl"] .bi-arrow-left-circle,
html[dir="rtl"] .bi-box-arrow-right,
html[dir="rtl"] .bi-caret-right-fill,
html[dir="rtl"] .bi-caret-left-fill,
html[dir="rtl"] .flip-rtl {
  display: inline-block;
  transform: scaleX(-1);
}

/* Bouton de langue */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(245, 208, 96, 0.55);
  background: transparent;
  color: inherit;
  border-radius: 20px;
  padding: 2px 12px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.6;
  transition: background .2s, color .2s;
}
.lang-switcher:hover { background: #F5D060; color: #014F8C; }
.lang-switcher .bi { margin: 0 !important; }
