/* =============================================
   SERVICES MEGA — CSS GLOBAL (LIGHT PROFESSIONAL)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── Variables ─────────────────────────────── */
:root {
  --color-bg:            #FFFFFF;
  --color-bg-soft:       #F8FAFC;
  --color-bg-section:    #F1F5F9;

  --color-primary:       #4F46E5;
  --color-primary-hover: #4338CA;
  --color-primary-light: #EEF2FF;

  --color-secondary:     #7C3AED;

  --color-cta:           #F59E0B;
  --color-cta-hover:     #D97706;
  --color-cta-light:     #FFFBEB;

  --color-text-dark:     #0F172A;
  --color-text-body:     #334155;
  --color-text-muted:    #64748B;
  --color-text-light:    #94A3B8;

  --color-border:        #E2E8F0;
  --color-border-soft:   #F1F5F9;

  --color-success:       #10B981;
  --color-error:         #EF4444;

  --gradient-title:      linear-gradient(135deg, #4F46E5, #7C3AED);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 25px rgba(79,70,229,0.12);
  --shadow-xl:  0 20px 40px rgba(0,0,0,0.1);

  --font:       'Poppins', sans-serif;
  --radius:     12px;
  --radius-sm:  8px;
  --transition: 0.2s ease;

  /* ── Aliases de compatibilité (anciens noms) ── */
  --dark:         #0F172A;
  --dark-2:       #F8FAFC;
  --dark-3:       #64748B;
  --gray:         #64748B;
  --white:        #0F172A;   /* texte "blanc" ancien thème → texte foncé thème clair */
  --glass-bg:     #F8FAFC;
  --glass-border: #E2E8F0;
  --gradient:     linear-gradient(135deg, #4F46E5, #7C3AED);
  --blue:         #4F46E5;
  --purple:       #7C3AED;
  --pink:         #EC4899;
  --shadow:       0 4px 12px rgba(0,0,0,0.08);
  --shadow-glow:  0 8px 25px rgba(79,70,229,0.12);

  /* Hauteur totale des éléments fixes (topbar + header + nav)        */
  /* Mise à jour dynamiquement par updateSiteTop() dans main.js       */
  --topbar-h:  36px;
  --header-h:  66px;
  --nav-h:     48px;
  --site-top:  150px; /* 36 + 66 + 48 */
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text-body);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }
button, input, select, textarea { font-family: var(--font); font-size: 1rem; }

/* ── Typographie ────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-dark);
}
h1 { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.05rem, 2vw, 1.375rem); font-weight: 600; }
@media (max-width: 640px) {
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.05rem; }
}
h4 { font-size: 1rem; font-weight: 600; }
p  { color: var(--color-text-body); line-height: 1.75; }

.text-gradient {
  background: var(--gradient-title);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-dark    { color: var(--color-text-dark)  !important; }
.text-muted   { color: var(--color-text-muted) !important; }
.text-primary { color: var(--color-primary)    !important; }
.text-white   { color: #fff !important; }
.text-center  { text-align: center; }
.text-gray    { color: var(--color-text-muted) !important; }

/* ── Layout ─────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
.section    { padding: 88px 0; }
.section-sm { padding: 60px 0; }
.section-alt { background: var(--color-bg-soft); }

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 5px 14px;
  border-radius: 50px;
  margin-bottom: 14px;
}
.section-title    { margin-bottom: 12px; }
.section-subtitle {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 580px;
  margin: 0 auto 48px;
  line-height: 1.75;
}

/* ── Boutons ────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.93rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79,70,229,0.35);
}
.btn-cta {
  background: var(--color-cta);
  color: var(--color-text-dark);
  border-color: var(--color-cta);
  font-weight: 700;
}
.btn-cta:hover {
  background: var(--color-cta-hover);
  border-color: var(--color-cta-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245,158,11,0.4);
}
.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-secondary:hover {
  background: var(--color-primary-light);
  transform: translateY(-1px);
}
.btn-outline-white {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
.btn-outline-white:hover { background: rgba(255,255,255,0.1); }

.btn-sm  { padding: 8px 18px; font-size: 0.82rem; }
.btn-lg  { padding: 15px 36px; font-size: 1rem; }
.btn-group { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Cards ──────────────────────────────────── */
.card, .glass-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.card:hover, .glass-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: rgba(79,70,229,0.2);
}

/* ── Grilles ────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 24px; }

/* ══════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════ */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 36px;
  background: #0F172A;
  z-index: 1002;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}
.top-bar .container {
  height: 100%;                /* le container occupe toute la hauteur du top-bar */
  display: flex;
  align-items: center;
}
.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 100%;
}
.top-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.top-bar-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(255,255,255,0.72);
  transition: color 0.18s;
  white-space: nowrap;
}
.top-bar-link:hover { color: #fff; }
.top-bar-sep {
  color: rgba(255,255,255,0.2);
  font-size: 0.85rem;
}
.top-bar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #34D399;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
}
.top-bar-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #34D399;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   HEADER PRINCIPAL — toujours visible (sticky)
   ══════════════════════════════════════════════ */
.header {
  position: fixed;
  top: var(--topbar-h, 36px);
  left: 0; right: 0;
  height: var(--header-h, 66px);
  z-index: 1001;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.header.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,0.09); }
.header .container { height: 100%; display: flex; align-items: center; }
.header-inner {
  display: flex;
  align-items: center;
  width: 100%;
  height: 100%;
  gap: 12px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text-dark);
  flex-shrink: 0;
}
.logo-icon { width: 36px; height: 36px; }
.logo-text span { display: block; }
.logo-name { font-size: 0.88rem; font-weight: 700; color: var(--color-text-dark); letter-spacing: 0.2px; white-space: nowrap; }
.logo-sub  { font-size: 0.58rem; font-weight: 400; color: var(--color-text-muted); letter-spacing: 0.5px; white-space: nowrap; }

/* ── Barre de recherche ── */
.hdr-search {
  flex: 1;
  max-width: 560px;
  position: relative;
  margin: 0 8px;
}
.hdr-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.hdr-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
  flex-shrink: 0;
}
.hdr-search-input {
  width: 100%;
  padding: 9px 36px 9px 38px;
  border: 1.5px solid var(--color-border);
  border-radius: 50px;
  font-size: 0.875rem;
  font-family: var(--font);
  background: var(--color-bg-section);
  color: var(--color-text-dark);
  transition: all 0.2s;
  outline: none;
}
.hdr-search-input:focus {
  border-color: var(--color-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.hdr-search-input::placeholder { color: var(--color-text-light); font-size: 0.82rem; }
.hdr-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  line-height: 1;
}
.hdr-search-clear:hover { background: var(--color-bg-section); color: var(--color-text-dark); }
.hdr-search-clear.visible { display: flex; }

/* Dropdown résultats */
.hdr-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  z-index: 9999;
  overflow: hidden;
  display: none;
  max-height: 420px;
  overflow-y: auto;
}
.hdr-search-dropdown.open { display: block; }
.hdr-search-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  padding: 10px 14px 5px;
  background: var(--color-bg-soft);
  border-bottom: 1px solid var(--color-border-soft);
  position: sticky;
  top: 0;
}
.hdr-search-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-soft);
  transition: background 0.12s;
}
.hdr-search-item:last-child { border-bottom: none; }
.hdr-search-item:hover { background: var(--color-primary-light); }
.hdr-search-item-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }
.hdr-search-item-title { font-size: 0.85rem; font-weight: 600; color: var(--color-text-dark); line-height: 1.3; }
.hdr-search-item-sub   { font-size: 0.72rem; color: var(--color-text-muted); margin-top: 1px; }
.hdr-search-empty {
  padding: 24px 14px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.82rem;
}
.hdr-search-loading { padding: 16px 14px; text-align: center; color: var(--color-text-muted); font-size: 0.82rem; }

/* Actions header droite */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Bouton panier */
.hdr-cart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  color: var(--color-text-body);
  background: var(--color-bg-section);
  border: 1.5px solid var(--color-border);
  transition: all 0.18s;
  flex-shrink: 0;
}
.hdr-cart:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: rgba(79,70,229,0.3);
  transform: translateY(-1px);
}
.hdr-cart-badge {
  position: absolute;
  top: -7px; right: -7px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  padding: 0 4px;
  line-height: 1;
}

/* Bouton Devis */
.hdr-devis {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #065F46;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #6EE7B7;
  background: #F0FDF4;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.hdr-devis:hover {
  background: #D1FAE5;
  border-color: #34D399;
  color: #064E3B;
  transform: translateY(-1px);
}

/* Bouton Espace Client */
.hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  background: var(--color-cta);
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
  letter-spacing: .01em;
}
.hdr-btn:hover {
  background: var(--color-cta-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217,119,6,.3);
}
.hdr-btn-admin {
  background: var(--color-primary);
}
.hdr-btn-admin:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}

/* Bouton Mon Espace (connecté) */
.hdr-myspace {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400E;
  padding: 5px 13px 5px 5px;
  border-radius: 50px;
  background: #FEF3C7;
  border: 1.5px solid #FCD34D;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
}
.hdr-myspace:hover { background: #FDE68A; border-color: #F59E0B; transform: translateY(-1px); }
.hdr-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg,#F59E0B,#EF4444);
  color: #fff; font-size: .62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
}
.menu-toggle span {
  display: block;
  width: 20px; height: 2px;
  background: var(--color-text-dark);
  border-radius: 1px;
  transition: var(--transition);
}

/* ══════════════════════════════════════════════
   BARRE DE NAVIGATION
   ══════════════════════════════════════════════ */
.site-nav {
  position: fixed;
  top: calc(var(--topbar-h, 36px) + var(--header-h, 66px));
  left: 0; right: 0;
  height: var(--nav-h, 48px);
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: top 0.25s ease;
}
.site-nav .container {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}
.site-nav-list {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  list-style: none;
}
.site-nav-list li { height: 100%; display: flex; align-items: stretch; }
.site-nav-list > li + li::before {
  content: '';
  display: block;
  width: 1px;
  height: 14px;
  background: rgba(100,116,139,0.2);
  align-self: center;
  flex-shrink: 0;
}
.site-nav-list li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 15px;
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--color-text-body);
  position: relative;
  transition: all 0.18s;
  white-space: nowrap;
}
.site-nav-list li a:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
.site-nav-list li a.active { color: var(--color-primary); font-weight: 600; }

/* Badge panier nav */
.nav-cart-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  border-radius: 50px;
  line-height: 1;
}

/* Éléments visibles seulement sur mobile (cachés sur desktop) */
.hdr-mobile-only  { display: none; }
/* Logo carré mobile — caché sur desktop, visible sur mobile */
.logo-mobile-only { display: none; }

/* Droite de la nav : Espace Client + Panier */
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav-right-sep {
  width: 1px;
  height: 20px;
  background: var(--color-border);
  margin: 0 8px;
  flex-shrink: 0;
}
.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--color-text-body);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.18s;
  white-space: nowrap;
  text-decoration: none;
}
.nav-user-btn:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
.nav-user-admin { color: var(--color-primary); font-weight: 600; }
.nav-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* CTAs droite nav (Devis + Support) */
.nav-cta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.nav-support-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  border: 1.5px solid transparent;
  text-decoration: none;
  transition: all 0.18s;
  white-space: nowrap;
  cursor: pointer;
}
.nav-support-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(79,70,229,.35);
  color: #fff;
}

/* Ombre progressive sur le header au scroll */
html.scrolled .header { box-shadow: 0 2px 16px rgba(0,0,0,0.09); }

/* ── Mobile menu footer — caché sur desktop ── */
.mobile-menu-footer { display: none; }

/* ── Footer ─────────────────────────────────── */
.footer {
  background: var(--color-text-dark);
  border-top: 3px solid var(--color-primary);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer-brand p {
  margin: 14px 0 22px;
  font-size: 0.88rem;
  max-width: 280px;
  line-height: 1.75;
  color: var(--color-text-light);
}
.footer-social { display: flex; gap: 10px; }
.social-link {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-light);
  transition: all var(--transition);
}
.social-link:hover { border-color: var(--color-primary); color: #fff; background: rgba(79,70,229,0.2); }
.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  margin-bottom: 16px;
}
.footer-col ul li + li { margin-top: 9px; }
.footer-col ul a { color: var(--color-text-light); font-size: 0.87rem; transition: color var(--transition); }
.footer-col ul a:hover { color: var(--color-primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom p, .footer-bottom a { font-size: 0.78rem; color: rgba(255,255,255,0.3); }
.footer-bottom a:hover { color: var(--color-primary); }

/* ── Badges ─────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-primary, .badge-blue { background: var(--color-primary-light); color: var(--color-primary); }
.badge-purple  { background: #F5F3FF; color: var(--color-secondary); }
.badge-green   { background: #ECFDF5; color: #065F46; }
.badge-red     { background: #FEF2F2; color: #991B1B; }
.badge-amber   { background: var(--color-cta-light); color: #92400E; }
.badge-gray    { background: var(--color-bg-section); color: var(--color-text-muted); }
.badge-pink    { background: #FDF2F8; color: #9D174D; }

/* ── Formulaires ────────────────────────────── */
.form-group   { margin-bottom: 18px; }
.form-label   { display: block; font-size: 0.84rem; font-weight: 600; color: var(--color-text-dark); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 11px 16px;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-dark);
  font-size: 0.92rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.form-control::placeholder { color: var(--color-text-light); }
textarea.form-control { resize: vertical; min-height: 110px; }
.form-error { color: var(--color-error); font-size: 0.78rem; margin-top: 5px; }
select.form-control { cursor: pointer; }

/* ── Flash messages ─────────────────────────── */
.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 0.88rem; font-weight: 500; }
.flash-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.flash-error   { background: #FEF2F2; border: 1px solid #FCA5A5; color: #7F1D1D; }
.flash-info    { background: var(--color-primary-light); border: 1px solid rgba(79,70,229,0.3); color: var(--color-primary); }

/* ── Auth pages (login / register) ─────────── */
.auth-page-wrap {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 56px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}
.auth-page-left { padding: 8px 0; }
.auth-page-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.auth-page-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.auth-feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  color: var(--color-text-body);
}
.auth-feature-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}
@media (max-width: 860px) {
  .auth-page-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
    max-width: 480px;
  }
  .auth-page-left { display: none; }
}

/* ── Page hero intérieure ───────────────────── */
.page-hero {
  padding-top: calc(var(--site-top) + 40px);
  padding-bottom: 72px;
  background: var(--color-bg-soft);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Pagination ─────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 48px; }
.pagination a, .pagination span {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--transition);
}
.pagination a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pagination .active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ── Modal ──────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { color: var(--color-text-dark); font-size: 1.1rem; }
.modal-close {
  background: none; border: none;
  color: var(--color-text-muted);
  font-size: 1.4rem; cursor: pointer;
  line-height: 1; padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover { color: var(--color-text-dark); background: var(--color-bg-soft); }
.modal-body { padding: 24px; }

/* ── Scrollbar ──────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--color-bg-soft); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

/* ── Utilitaires ────────────────────────────── */
.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:8px!important}.mb-2{margin-bottom:16px!important}
.mb-3{margin-bottom:24px!important}.mb-4{margin-bottom:32px!important}.mb-5{margin-bottom:48px!important}
.mt-auto{margin-top:auto}.d-flex{display:flex}.align-center{align-items:center}
.justify-between{justify-content:space-between}.gap-1{gap:8px}.gap-2{gap:16px}.gap-3{gap:24px}
.hidden{display:none!important}.w-full{width:100%!important}

/* ══════════════════════════════════════════════
   ADMIN — Overrides dark (sidebar + panel)
   ══════════════════════════════════════════════ */
.admin-layout {
  background: #0F172A;
  color: #94A3B8;
  min-height: 100vh;
  display: flex;
}
.admin-layout h1,.admin-layout h2,.admin-layout h3,.admin-layout h4 { color: #F8FAFC; }
.admin-layout p { color: #94A3B8; }
.admin-layout .form-control {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #F8FAFC;
}
.admin-layout .form-control:focus { border-color: var(--color-primary); }
.admin-layout .form-control::placeholder { color: #334155; }
.admin-layout .form-label { color: #F8FAFC; }
.admin-layout .modal { background: #1E293B; border-color: rgba(255,255,255,0.1); }
.admin-layout .modal-header { border-color: rgba(255,255,255,0.08); }
.admin-layout .modal-close { color: #64748B; }
.admin-layout .modal-close:hover { color: #F8FAFC; background: rgba(255,255,255,0.06); }
.admin-layout select.form-control option { background: #1E293B; }
.admin-layout .flash-success { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: #34D399; }
.admin-layout .flash-error   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: #F87171; }
.admin-layout .flash-info    { background: rgba(79,70,229,0.1);  border-color: rgba(79,70,229,0.3);  color: #818CF8; }
.admin-layout .btn-secondary { border-color: rgba(255,255,255,0.2); color: #94A3B8; }
.admin-layout .btn-secondary:hover { background: rgba(255,255,255,0.06); }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hdr-devis { display: none; }
}
@media (max-width: 900px) {
  /* Éléments desktop uniquement */
  .hdr-desktop-only { display: none !important; }

  /* Éléments mobile uniquement */
  .hdr-mobile-only  { display: flex !important; }
  .logo-mobile-only { display: block !important; }

  /* Séparateur nav caché en colonne */
  .site-nav-list > li + li::before { display: none; }

  /* Recherche — pleine largeur sur mobile */
  .hdr-search { max-width: none; margin: 0 6px; }
  .hdr-search-input::placeholder { font-size: 0.78rem; }

  /* Navigation mobile — dropdown depuis hamburger */
  .site-nav {
    top: calc(var(--topbar-h, 36px) + var(--header-h, 66px));
    height: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.38s ease, top 0.25s ease, box-shadow 0.2s;
    border-bottom: none;
    box-shadow: none;
  }
  .site-nav.open {
    max-height: 600px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  }
  .site-nav .container { flex-direction: column; height: auto; justify-content: flex-start; }
  .site-nav-inner { flex-direction: column; height: auto; width: 100%; align-items: stretch; }
  .site-nav-list {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 8px 0 0;
  }
  .site-nav-list li { height: auto; display: block; }
  .site-nav-list li a {
    height: 48px;
    padding: 0 24px;
    border-bottom: 1px solid var(--color-border-soft);
    border-radius: 0;
    font-size: 0.9rem;
  }
  .site-nav-list li a.active::after { display: none; }
  .site-nav-list li a.active {
    background: var(--color-primary-light);
    border-left: 3px solid var(--color-primary);
    padding-left: 21px;
  }
  .site-nav-list li:last-child a { border-bottom: none; }
  .menu-toggle { display: flex; }
  :root { --nav-h: 0px; --site-top: calc(var(--topbar-h) + var(--header-h)); }
  .page-hero { padding-top: calc(var(--site-top) + 32px); }
  .hero       { padding-top: calc(var(--site-top) + 24px); }

  /* Menu mobile footer */
  .mobile-menu-footer {
    display: block;
    padding: 14px 24px 20px;
    border-top: 1px solid var(--color-border-soft);
    background: var(--color-bg-soft);
  }
  .mobile-menu-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
  }
  .mobile-contact-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    padding: 4px 0;
    transition: color 0.18s;
  }
  .mobile-contact-link:hover { color: var(--color-primary); }
  .mobile-menu-actions { display: flex; gap: 8px; flex-wrap: wrap; }
}
@media (max-width: 768px) {
  .section { padding: 60px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  /* Top bar mobile : masque email/téléphone, centre uniquement le badge vert */
  .top-bar-left  { display: none; }
  .top-bar-inner { justify-content: center; }
  .top-bar-badge { font-size: 0.65rem; gap: 5px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .footer-copy { display: flex; flex-direction: column; gap: 3px; align-items: center; }
  .footer-copy-sep { display: none; }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { justify-content: center; }
  .top-bar { display: none; }
  .header  { top: 0; }
  .site-nav { top: var(--header-h); }
  :root { --topbar-h: 0px; --nav-h: 0px; --site-top: var(--header-h); }
  /* Recherche compacte */
  .hdr-search-input { font-size: 0.8rem; padding: 8px 32px 8px 34px; }
  .hdr-search-dropdown { left: -10px; right: -10px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Cookie Banner — CNIL / RGPD compliant
   ═══════════════════════════════════════════════════════════════════ */
#cb-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 99999;
  background: #fff;
  border-top: 3px solid var(--color-primary);
  box-shadow: 0 -8px 40px rgba(15,23,42,.14);
  transform: translateY(0);
  transition: transform .45s cubic-bezier(.4,0,.2,1);
}
#cb-banner.cb-out { transform: translateY(110%); }

/* Simple view */
.cb-wrap    { max-width: 1280px; margin: 0 auto; padding: 22px 32px; }
.cb-row     { display: flex; align-items: center; gap: 24px; }
.cb-emoji   { font-size: 2.1rem; flex-shrink: 0; }
.cb-body    { flex: 1; min-width: 0; }
.cb-title   { font-size: .95rem; font-weight: 700; color: var(--color-text-dark); margin-bottom: 4px; }
.cb-desc    { font-size: .8rem; color: var(--color-text-muted); line-height: 1.55; margin: 0; }
.cb-desc a  { color: var(--color-primary); text-decoration: underline; }
.cb-btns    { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.cb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: 8px;
  font-size: .83rem; font-weight: 600; cursor: pointer;
  border: none; white-space: nowrap;
  transition: background .18s, color .18s, box-shadow .18s;
}
.cb-btn-refuse {
  background: #f1f5f9; color: var(--color-text-body);
}
.cb-btn-refuse:hover { background: #e2e8f0; }
.cb-btn-customize {
  background: transparent; color: var(--color-primary);
  border: 1.5px solid var(--color-primary);
}
.cb-btn-customize:hover { background: var(--color-primary-light); }
.cb-btn-accept {
  background: var(--color-primary); color: #fff;
  box-shadow: 0 2px 12px rgba(79,70,229,.25);
}
.cb-btn-accept:hover { background: var(--color-primary-hover); box-shadow: 0 4px 18px rgba(79,70,229,.35); }

/* Personalization panel */
.cb-detail      { display: none; }
.cb-detail.open { display: block; }
.cb-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 16px; border-bottom: 1px solid var(--color-border); margin-bottom: 16px;
}
.cb-detail-head strong { font-size: .95rem; font-weight: 700; color: var(--color-text-dark); }
.cb-back-btn {
  background: none; border: none; font-size: .8rem;
  color: var(--color-primary); cursor: pointer; font-weight: 600;
  display: flex; align-items: center; gap: 5px;
}
.cb-categories { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.cb-cat {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 18px; background: var(--color-bg-soft);
  border: 1px solid var(--color-border); border-radius: 10px;
}
.cb-cat-name   { font-size: .85rem; font-weight: 600; color: var(--color-text-dark); margin-bottom: 3px; }
.cb-cat-desc   { font-size: .75rem; color: var(--color-text-muted); margin: 0; line-height: 1.5; }
.cb-always-on  {
  font-size: .73rem; font-weight: 700; color: var(--color-success);
  background: rgba(16,185,129,.1); padding: 4px 10px; border-radius: 99px;
  white-space: nowrap; flex-shrink: 0;
}
/* Cookie toggle switch */
.cb-switch       { position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0; }
.cb-switch input { opacity: 0; width: 0; height: 0; }
.cb-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cbd5e1; border-radius: 50px; transition: .25s;
}
.cb-slider::before {
  content: ''; position: absolute;
  height: 20px; width: 20px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: .25s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.cb-switch input:checked + .cb-slider { background: var(--color-primary); }
.cb-switch input:checked + .cb-slider::before { transform: translateX(20px); }

.cb-detail-btns { display: flex; gap: 10px; justify-content: flex-end; }

/* Floating re-open pill */
#cb-pill {
  position: fixed; bottom: 20px; left: 20px; z-index: 99998;
  display: none;
  align-items: center; gap: 8px;
  padding: 8px 16px 8px 12px;
  background: #fff; border: 1.5px solid var(--color-border);
  border-radius: 99px; box-shadow: 0 4px 18px rgba(0,0,0,.12);
  cursor: pointer; font-size: .78rem; font-weight: 600;
  color: var(--color-text-body);
  transition: box-shadow .2s, transform .2s;
}
#cb-pill:hover { box-shadow: 0 6px 24px rgba(0,0,0,.16); transform: translateY(-2px); }
#cb-pill span  { font-size: 1.1rem; }

/* Mobile */
@media (max-width: 768px) {
  .cb-wrap  { padding: 18px 20px; }
  .cb-row   { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cb-btns  { width: 100%; flex-wrap: wrap; }
  .cb-btn   { flex: 1; min-width: 120px; }
  .cb-cat   { flex-direction: column; align-items: flex-start; gap: 10px; }
  .cb-detail-btns { flex-direction: column; }
  .cb-detail-btns .cb-btn { text-align: center; }
}
