/**
 * EasyCM — Header & footer (bleu / blanc, glass, premium)
 * Chargé après easycm-header.css pour rétablir le corps clair sur les pages `ecm-body`.
 */

body.ecm-body {
  font-family: var(--ecm-font-body);
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 40%, #ffffff 100%);
  color: #0f172a;
  line-height: 1.6;
  min-height: 100vh;
}

/* ——— Header ——— */
.ecm-header.site-header {
  font-family: var(--ecm-font-body);
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(37, 99, 235, 0.12);
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.08), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
  z-index: 2000;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.ecm-header.site-header::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #1d4ed8, #3b82f6, #60a5fa, #2563eb);
  pointer-events: none;
}

/* Fixed toasts / alerts : sous la barre du header (fixed-top z-index 2000), visibles au chargement */
.ecm-toast-host {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 4.75rem);
  right: 0.75rem;
  left: 0.75rem;
  z-index: 2105;
  max-width: 22rem;
  margin-left: auto;
  pointer-events: none;
}
.ecm-toast-host > * {
  pointer-events: auto;
}
@media (min-width: 576px) {
  .ecm-toast-host {
    left: auto;
    width: auto;
  }
}

.ecm-brand-tag {
  font-size: 0.65rem !important;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b !important;
}

.ecm-header .ecm-brand-title {
  font-family: var(--ecm-font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: #0f172a !important;
  letter-spacing: -0.02em;
}

.ecm-header .logo-img {
  border: 2px solid rgba(37, 99, 235, 0.15) !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.ecm-header .logo-img:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.2);
}

/* Recherche */
.ecm-header-search {
  flex: 1 1 auto;
  max-width: 280px;
}

.ecm-header-search .input-group {
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.15);
  background: #f8fafc;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.ecm-header-search .input-group:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: #fff;
}

.ecm-header-search .input-group-text {
  background: transparent !important;
}

.ecm-header-search .form-control {
  background: transparent !important;
  font-size: 0.875rem;
}

/* Nav liens */
.ecm-header .nav-link {
  color: #334155 !important;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem !important;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.ecm-header .nav-link:hover,
.ecm-header .dropdown-toggle.show {
  color: #1d4ed8 !important;
  background: rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.ecm-header .dropdown-toggle::after {
  margin-left: 0.35em;
  vertical-align: 0.12em;
}

/* Boutons header */
.btn-ecm-lang {
  border-radius: 999px !important;
  padding: 0.35rem 0.75rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  border: 1px solid rgba(37, 99, 235, 0.35) !important;
  color: #1d4ed8 !important;
  background: rgba(239, 246, 255, 0.9) !important;
  transition: all 0.25s ease !important;
}

.btn-ecm-lang:hover {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #2563eb !important;
}

.btn-ecm-ghost {
  border-radius: 999px !important;
  border: 2px solid rgba(37, 99, 235, 0.35) !important;
  color: #1d4ed8 !important;
  background: transparent !important;
  font-weight: 600 !important;
  transition: all 0.25s ease !important;
}

.btn-ecm-ghost:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: #2563eb !important;
  color: #1e40af !important;
}

.btn-ecm-primary-solid {
  border-radius: 999px !important;
  border: none !important;
  font-weight: 700 !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.btn-ecm-primary-solid:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.45);
  color: #fff !important;
}

.ecm-header .dropdown-toggle.text-white {
  color: #334155 !important;
}

/* Mega menu */
.ecm-header .megamenu {
  border-radius: 20px !important;
  border: 1px solid rgba(37, 99, 235, 0.1) !important;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.8) inset !important;
  margin-top: 0.5rem !important;
  animation: ecmMegaIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ecmMegaIn {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.ecm-header .mega-tile {
  border-radius: 14px !important;
  border: 1px solid rgba(37, 99, 235, 0.08) !important;
  background: linear-gradient(165deg, #ffffff, #f8fafc) !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06) !important;
  opacity: 1 !important;
  transform: none !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease !important;
}

.ecm-header .mega-tile:hover {
  transform: translateY(-6px) !important;
  border-color: rgba(37, 99, 235, 0.25) !important;
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.12) !important;
}

.ecm-header .mega-tile i.text-primary {
  color: #2563eb !important;
}

.ecm-header .mega-tile:hover i {
  color: #1d4ed8 !important;
  transform: scale(1.08);
}

.ecm-header .mega-tile:hover .fw-bold {
  color: #1e40af !important;
}

/* Profil dropdown */
.ecm-header .dropdown-menu {
  border-radius: 14px !important;
  border: 1px solid rgba(37, 99, 235, 0.1) !important;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.1) !important;
  padding: 0.5rem !important;
}

.ecm-header .dropdown-item {
  border-radius: 10px;
  padding: 0.45rem 0.75rem !important;
  font-size: 0.9rem;
}

.ecm-header .dropdown-item:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #1e40af;
}

/* Toggle mobile */
.ecm-mobile-toggle {
  width: 46px !important;
  height: 46px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  background: linear-gradient(145deg, #eff6ff, #ffffff) !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  text-decoration: none !important;
}

.ecm-mobile-toggle:hover {
  border-color: #3b82f6 !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18) !important;
}

.ecm-mobile-toggle .hamburger-line {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 20px;
  height: 2px;
  background: linear-gradient(90deg, #1e40af, #3b82f6);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.ecm-mobile-toggle .hamburger-line:nth-child(1) { top: 6px; }
.ecm-mobile-toggle .hamburger-line:nth-child(2) { top: 11px; width: 16px; margin-right: 0; margin-left: auto; }
.ecm-mobile-toggle .hamburger-line:nth-child(3) { top: 16px; width: 12px; margin-right: 0; margin-left: auto; }

.ecm-mobile-toggle .hamburger {
  position: relative;
  width: 20px;
  height: 22px;
}

.ecm-mobile-toggle.active .hamburger-line:nth-child(1) {
  top: 11px;
  transform: rotate(45deg);
  width: 20px;
}
.ecm-mobile-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.ecm-mobile-toggle.active .hamburger-line:nth-child(3) {
  top: 11px;
  width: 20px;
  transform: rotate(-45deg);
}

/* Panneau mobile */
.ecm-mobile-panel.mobile-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 50%, #eff6ff 100%) !important;
  border: 1px solid rgba(37, 99, 235, 0.12) !important;
  box-shadow: 0 -12px 48px rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
}

.ecm-mobile-panel .mobile-panel-handle {
  background: linear-gradient(90deg, transparent, #93c5fd, transparent) !important;
}

.ecm-mobile-panel .border-bottom {
  border-color: rgba(37, 99, 235, 0.12) !important;
}

.ecm-mobile-panel .ecm-brand-title,
.ecm-mobile-panel .text-dark {
  color: #0f172a !important;
}

.ecm-mobile-link {
  border-radius: 12px !important;
  padding: 12px 14px !important;
  margin-bottom: 6px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(37, 99, 235, 0.1) !important;
  color: #1e293b !important;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
}

.ecm-mobile-link:hover {
  border-color: rgba(37, 99, 235, 0.28) !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
  transform: translateX(4px);
  color: #1d4ed8 !important;
}

.ecm-mobile-link i.text-primary {
  color: #2563eb !important;
}

.ecm-mobile-panel .btn-outline-light {
  border-color: rgba(37, 99, 235, 0.3) !important;
  color: #1d4ed8 !important;
  background: #fff !important;
}

.ecm-mobile-panel .btn-outline-light:hover {
  background: rgba(37, 99, 235, 0.08) !important;
}

.ecm-mobile-panel .btn-success {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border: none !important;
}

.mobile-panel-overlay {
  background: rgba(15, 23, 42, 0.35) !important;
  backdrop-filter: blur(6px);
}

/* Animations panneau (conservées) */
.mobile-panel {
  will-change: transform, opacity;
  height: 88vh;
  border-radius: 22px 22px 0 0;
  z-index: 3000;
  display: none;
  transform: translate3d(0, 120%, 0) !important;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.mobile-panel.open {
  display: block;
  transform: translate3d(0, 0, 0) !important;
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  animation: sheetIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.mobile-panel.closing {
  animation: sheetOut 0.4s cubic-bezier(0.45, 0, 0.3, 1) both;
}

@keyframes sheetIn {
  0% { transform: translate3d(0, 110%, 0); opacity: 0; }
  100% { transform: translate3d(0, 0, 0); opacity: 1; }
}

@keyframes sheetOut {
  0% { transform: translate3d(0, 0, 0); opacity: 1; }
  100% { transform: translate3d(0, 115%, 0); opacity: 0; }
}

.mobile-panel-overlay {
  z-index: 2999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
  pointer-events: none;
}

.mobile-panel-overlay.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s ease;
  pointer-events: auto;
}

body.no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
  touch-action: none;
}

@media (min-width: 768px) {
  .mobile-panel,
  .mobile-panel-overlay,
  .ecm-mobile-toggle {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecm-header .mega-tile,
  .mobile-panel,
  .megamenu {
    animation: none !important;
    transition: none !important;
  }
}

/* ——— Footer ——— */
.ecm-footer-wave {
  display: block;
  width: 100%;
  height: 72px;
}

.ecm-footer-wave path {
  fill: #dbeafe;
}

.ecm-footer.site-footer {
  background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 35%, #e0f2fe 100%);
  color: #334155;
  padding-bottom: 3rem !important;
  border-top: 1px solid rgba(37, 99, 235, 0.08);
}

.ecm-footer .footer-brand-name {
  font-family: var(--ecm-font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #1e40af, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: block;
  line-height: 1.2;
}

.ecm-footer .footer-brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #64748b;
}

.ecm-footer a {
  color: #475569;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.ecm-footer a:hover {
  color: #2563eb;
}

.ecm-footer .ecm-footer-heading {
  font-family: var(--ecm-font-display);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #1e40af;
  margin-bottom: 1rem;
}

.ecm-footer .footer-small {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.6;
}

.ecm-footer .ecm-footer-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ecm-footer .ecm-footer-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.38);
  color: #fff !important;
}

.ecm-footer .ecm-social-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #2563eb;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.ecm-footer .ecm-social-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.15);
  color: #1d4ed8;
}

.ecm-footer .ecm-newsletter-box {
  background: #fff;
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.06);
}

.ecm-footer .newsletter-input {
  border-radius: 999px !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  padding: 0.65rem 1rem !important;
  padding-right: 7rem !important;
  background: #f8fafc;
}

.ecm-footer .ecm-newsletter-box form.position-relative {
  min-height: 3rem;
}

.ecm-footer .newsletter-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px !important;
  padding: 0.4rem 1rem !important;
  font-weight: 700 !important;
  font-size: 0.8rem !important;
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border: none !important;
  color: #fff !important;
}

.ecm-footer .ecm-footer-bottom {
  border-top: 1px solid rgba(37, 99, 235, 0.1);
  padding-top: 1.5rem;
  margin-top: 1rem;
}

.ecm-back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: none;
}

.ecm-back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.5);
  color: #fff;
}

/* Au-dessus du dock mobile : ne recouvre pas la barre du bas */
@media (max-width: 991.98px) {
  body.ecm-has-mobile-dock .ecm-back-to-top {
    bottom: calc(5.15rem + env(safe-area-inset-bottom, 0px));
    right: 14px;
    z-index: 1034;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28);
  }
}

@media (max-width: 767.98px) {
  .ecm-footer .newsletter-input {
    padding-right: 5.5rem !important;
  }
}
