/**
 * EasyCM — bleu & blanc (accueil clair), mobile fluide, champs formulaires animés
 * Polices Google : chargées par partials/ecm-global-fonts.blade.php (réglage admin).
 */

:root {
  --ecm-black: #05080d;
  --ecm-ink: #0a0f1a;
  --ecm-slate: #111827;
  --ecm-blue: #2563eb;
  --ecm-blue-bright: #3b82f6;
  --ecm-blue-deep: #1d4ed8;
  --ecm-blue-soft: #dbeafe;
  --ecm-blue-pale: #eff6ff;
  --ecm-white: #ffffff;
  --ecm-frost: rgba(255, 255, 255, 0.06);
  --ecm-border: rgba(255, 255, 255, 0.12);
  --ecm-text: #e8edf7;
  --ecm-muted: #94a3b8;
  --ecm-radius: 16px;
  --ecm-radius-sm: 12px;
  --ecm-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  --ecm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  body.ecm-theme-font-diamond main h1,
  body.ecm-theme-font-diamond main .h1,
  body.ecm-theme-font-diamond main h2,
  body.ecm-theme-font-diamond main .h2 {
    background: none !important;
    background-clip: unset !important;
    -webkit-background-clip: unset !important;
    -webkit-text-fill-color: unset !important;
    color: #1e3a8a !important;
  }
}

body.ecm-body {
  font-family: var(--ecm-font-body, Inter, system-ui, sans-serif);
  background: radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(59, 130, 246, 0.12), transparent 50%),
    linear-gradient(180deg, var(--ecm-black) 0%, var(--ecm-ink) 40%, #0c1222 100%);
  color: var(--ecm-text);
  -webkit-font-smoothing: antialiased;
}

/* Accueil : fond clair bleu & blanc (plus de noir dominant) */
body.ecm-body:has(.ecm-page-home) {
  background:
    radial-gradient(1000px 480px at 15% 0%, rgba(59, 130, 246, 0.2), transparent 55%),
    radial-gradient(800px 400px at 95% 20%, rgba(147, 197, 253, 0.45), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 25%, #eff6ff 55%, #dbeafe 100%);
  color: #0f172a;
}

body.ecm-body main {
  overflow-x: clip;
}

/* Sections claires (EasySale, etc.) : texte foncé lisible */
body.ecm-body main .bg-light,
body.ecm-body main .bg-white {
  color: #0f172a;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--ecm-font-display, Inter, system-ui, sans-serif);
  letter-spacing: -0.02em;
}

/* Préréglage admin « Diamant premium » : titres principaux en dégradé animé (or & bleu) */
@media (prefers-reduced-motion: no-preference) {
  body.ecm-theme-font-diamond main h1,
  body.ecm-theme-font-diamond main .h1,
  body.ecm-theme-font-diamond main h2,
  body.ecm-theme-font-diamond main .h2 {
    background: linear-gradient(
      105deg,
      #1e3a8a 0%,
      #2563eb 22%,
      #ca8a04 48%,
      #eab308 52%,
      #2563eb 78%,
      #1e40af 100%
    );
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: ecm-diamond-shine 10s ease-in-out infinite;
  }
}

@keyframes ecm-diamond-shine {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

/* ——— Page accueil : bleu & blanc ——— */
.ecm-page-home .stats-section {
  background: linear-gradient(165deg, #ffffff 0%, #eff6ff 28%, #bfdbfe 62%, #93c5fd 100%) !important;
}

.ecm-page-home .stats-bg .particle {
  background: rgba(37, 99, 235, 0.2) !important;
}

.ecm-page-home .stat-card {
  background: #ffffff !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(37, 99, 235, 0.12) !important;
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.08) !important;
  color: #0f172a;
}

.ecm-page-home .stat-label {
  color: #1e3a8a !important;
}

.ecm-page-home .stats-title {
  color: #1e40af !important;
  text-shadow: none !important;
}

.ecm-page-home .stats-subtitle {
  color: #475569 !important;
}

.ecm-page-home .stat-desc {
  color: #64748b !important;
}

.ecm-page-home .growth-title {
  color: #1e40af !important;
}

.ecm-page-home .growth-desc {
  color: #475569 !important;
}

.ecm-page-home .growth-chart-section {
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid rgba(37, 99, 235, 0.15) !important;
}

.ecm-page-home .growth-label {
  color: #64748b !important;
}

.ecm-page-home .growth-number {
  color: #2563eb !important;
}

.ecm-page-home .stat-number {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.ecm-page-home .stat-unit {
  color: #2563eb !important;
}

.ecm-page-home .stat-icon {
  background: linear-gradient(135deg, var(--ecm-blue), var(--ecm-blue-deep)) !important;
}

.ecm-page-home .graph-bar {
  background: linear-gradient(to top, var(--ecm-blue-deep), var(--ecm-blue-bright)) !important;
}

.ecm-page-home .clock-face {
  background: linear-gradient(135deg, var(--ecm-blue), var(--ecm-blue-deep)) !important;
}

.ecm-page-home .services-section {
  background: transparent;
}

.ecm-page-home .services-section h2.fw-bold {
  color: #1d4ed8 !important;
}

.ecm-page-home .services-section .lead.text-muted {
  color: #64748b !important;
}

.ecm-page-home .testimonials-section {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 45%, #e0f2fe 100%) !important;
}

.ecm-page-home .testimonial-card {
  background: #ffffff !important;
  border: 1px solid rgba(37, 99, 235, 0.12) !important;
  box-shadow: 0 16px 48px rgba(37, 99, 235, 0.08) !important;
  color: #0f172a;
}

.ecm-page-home .testimonial-text {
  color: #475569 !important;
}

.ecm-page-home .author-name {
  color: #0f172a !important;
}

.ecm-page-home .author-role {
  color: #64748b !important;
}

.ecm-page-home .testimonial-nav {
  background: #2563eb !important;
}

.ecm-page-home .dot.active {
  background: #2563eb !important;
}

.ecm-page-home .cta-section {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 40%, #60a5fa 85%, #bfdbfe 100%) !important;
}

.ecm-page-home .btn-outline-success {
  border-color: rgba(37, 99, 235, 0.45) !important;
  color: #1d4ed8 !important;
}

.ecm-page-home .btn-outline-success:hover {
  background: rgba(37, 99, 235, 0.08) !important;
  border-color: #2563eb !important;
  color: #1e3a8a !important;
}

/* ——— Formulaires premium (site + admin) ——— */
.ecm-form-premium .form-control,
.ecm-input-group .form-control {
  border-radius: var(--ecm-radius-sm);
  transition: border-color 0.35s var(--ecm-ease), box-shadow 0.35s var(--ecm-ease), transform 0.35s var(--ecm-ease), background 0.35s var(--ecm-ease);
}

.ecm-form-premium .form-control:not(:placeholder-shown),
.ecm-form-premium .form-control:focus {
  transform: translateY(-1px);
}

.ecm-form-premium .form-control:focus {
  border-color: var(--ecm-blue-bright);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.22);
  outline: none;
}

.ecm-form-premium .form-label {
  transition: color 0.25s ease, transform 0.25s ease;
}

.ecm-form-premium .mb-3:focus-within .form-label,
.ecm-form-premium .form-group:focus-within label {
  color: var(--ecm-blue-bright);
}

/* Boutons primaires sur la page d'accueil */
.ecm-page-home .btn-primary {
  background: linear-gradient(135deg, var(--ecm-blue), var(--ecm-blue-deep));
  border: none;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.35);
  transition: transform 0.25s var(--ecm-ease), box-shadow 0.25s ease;
}

.ecm-page-home .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(37, 99, 235, 0.45);
}

/* Mobile : zones tactiles confortables */
@media (max-width: 767.98px) {
  .ecm-page-home .btn {
    min-height: 44px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .ecm-page-home .form-control {
    min-height: 48px;
    font-size: 1rem; /* évite zoom iOS */
  }

  .ecm-page-home .carousel {
    border-radius: var(--ecm-radius-sm) !important;
    -webkit-tap-highlight-color: transparent;
  }

  .ecm-page-home .stat-card {
    min-height: auto !important;
  }
}

/* Admin home page background */
.ecm-admin-home {
  min-height: 100vh;
  margin: -1rem -0.75rem;
  padding: 1rem 0.75rem 3rem;
  background: linear-gradient(180deg, #020617, #0f172a);
}

/* ========== Accueil : sections redesign ========== */

.home-section-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1d4ed8;
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(239, 246, 255, 0.9));
  border: 1px solid rgba(37, 99, 235, 0.2);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

/* --- Hero --- */
.home-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #2563eb;
  margin-bottom: 0.35rem;
}

.home-hero-lead {
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.ecm-page-home .home-hero-carousel,
.ecm-page-home .home-hero .carousel {
  border-radius: 22px !important;
  box-shadow: 0 20px 50px rgba(37, 99, 235, 0.18), 0 4px 20px rgba(15, 23, 42, 0.06) !important;
}

.ecm-page-home .home-hero-overlay {
  background: linear-gradient(125deg, rgba(30, 64, 175, 0.72) 0%, rgba(59, 130, 246, 0.35) 45%, rgba(255, 255, 255, 0.08) 100%) !important;
}

.ecm-page-home .home-hero .carousel-content h2 {
  font-size: clamp(1.35rem, 4.5vw, 2.5rem);
  line-height: 1.15;
  font-weight: 800;
}

.ecm-page-home .home-hero .carousel-content p.lead {
  font-size: clamp(0.88rem, 2.2vw, 1.15rem);
  opacity: 0.95;
}

.ecm-page-home .home-hero .indicator.active {
  background: #fff !important;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
  transform: scale(1.15);
}

/* --- Stats : grille 2×2 mobile, 4 desktop --- */
.ecm-page-home .stats-container {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 0.75rem !important;
  padding: 0 0.25rem !important;
}

@media (min-width: 992px) {
  .ecm-page-home .stats-container {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1.1rem !important;
  }
}

.ecm-page-home .home-stats .stat-card {
  border-radius: 20px !important;
  border-top: 3px solid #3b82f6 !important;
}

.ecm-page-home .home-stats .growth-chart-section {
  border-radius: 24px !important;
}

/* --- Services : grille 4 colonnes sur mobile --- */
.ecm-page-home .home-services {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 40%, #eff6ff 100%);
  color: #0f172a;
  overflow-x: clip;
  padding-top: 2.5rem !important;
  padding-bottom: 2.5rem !important;
}

.ecm-page-home .home-services-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  letter-spacing: -0.02em;
}

.ecm-page-home .home-services-intro {
  max-width: 40rem;
}

.ecm-page-home .home-services-grid,
.ecm-page-home .services-row.home-services-grid {
  display: grid !important;
  width: 100% !important;
  max-width: 1280px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
  /* Mobile first : 4 colonnes */
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 0.45rem !important;
  align-items: stretch !important;
  justify-items: stretch !important;
}

@media (min-width: 576px) {
  .ecm-page-home .home-services-grid {
    gap: 0.65rem !important;
  }
}

@media (min-width: 768px) {
  .ecm-page-home .home-services-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.85rem !important;
  }
}

@media (min-width: 1100px) {
  .ecm-page-home .home-services-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 1rem !important;
  }
}

@media (min-width: 1400px) {
  .ecm-page-home .home-services-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  }
}

.ecm-page-home .home-services .service-wrap {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

.ecm-page-home .home-services .service-card {
  height: 100%;
  background: #ffffff !important;
  border: 1px solid rgba(37, 99, 235, 0.12) !important;
  border-radius: 14px !important;
  padding: 0.5rem 0.35rem 0.45rem !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.07) !important;
  gap: 0.25rem !important;
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, opacity 0.35s ease, border-color 0.25s ease;
}

.ecm-page-home .home-services .service-card.visible {
  transform: translateY(0);
  opacity: 1;
}

.ecm-page-home .home-services .service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(37, 99, 235, 0.14) !important;
  border-color: rgba(37, 99, 235, 0.28) !important;
}

.ecm-page-home .home-services .service-icon {
  width: 36px !important;
  height: 36px !important;
  margin-bottom: 0.25rem !important;
  border-radius: 12px !important;
  background: linear-gradient(145deg, #eff6ff, #dbeafe) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 4px 12px rgba(37, 99, 235, 0.12) !important;
}

.ecm-page-home .home-services .service-icon::after {
  display: none;
}

.ecm-page-home .home-services .service-icon i,
.ecm-page-home .home-services .service-icon svg {
  width: 18px !important;
  height: 18px !important;
  color: #1d4ed8 !important;
}

.ecm-page-home .home-services .service-title {
  font-size: 0.62rem !important;
  line-height: 1.2 !important;
  color: #1e3a8a !important;
  margin: 0 !important;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ecm-page-home .home-services .service-desc {
  display: none !important;
}

@media (min-width: 768px) {
  .ecm-page-home .home-services .service-icon {
    width: 48px !important;
    height: 48px !important;
  }
  .ecm-page-home .home-services .service-icon i,
  .ecm-page-home .home-services .service-icon svg {
    width: 22px !important;
    height: 22px !important;
  }
  .ecm-page-home .home-services .service-title {
    font-size: 0.78rem !important;
  }
  .ecm-page-home .home-services .service-desc {
    display: -webkit-box !important;
    font-size: 0.65rem !important;
    -webkit-line-clamp: 2;
    color: #64748b !important;
  }
  .ecm-page-home .home-services .service-card {
    padding: 0.85rem 0.65rem !important;
    border-radius: 16px !important;
  }
}

.ecm-page-home .home-services .service-cta {
  margin-top: 0.2rem !important;
  width: 100%;
}

.ecm-page-home .home-services .service-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.25rem !important;
  width: 100% !important;
  min-height: 0 !important;
  padding: 0.22rem 0.3rem !important;
  font-size: 0.52rem !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  line-height: 1.2 !important;
}

.ecm-page-home .home-services .service-btn-ico {
  font-size: 0.55rem;
}

@media (min-width: 768px) {
  .ecm-page-home .home-services .service-btn {
    padding: 0.32rem 0.5rem !important;
    font-size: 0.68rem !important;
    border-radius: 999px !important;
  }
  .ecm-page-home .home-services .service-btn-ico {
    font-size: 0.7rem;
  }
}

@media (max-width: 767.98px) {
  .ecm-page-home .home-services .service-btn-txt {
    display: none;
  }
  .ecm-page-home .home-services .service-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 10px !important;
  }
  .ecm-page-home .home-services .service-btn-ico {
    margin: 0 !important;
    font-size: 0.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ecm-page-home .home-services .service-card {
    transition: none !important;
  }
}

/* --- Témoignages --- */
.ecm-page-home .home-testimonials {
  position: relative;
  padding-top: 3.5rem !important;
  padding-bottom: 3.5rem !important;
}

.ecm-page-home .home-testimonials::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.25), transparent);
}

.ecm-page-home .home-testimonials .testimonial-card {
  border-radius: 20px !important;
  position: relative;
  overflow: hidden;
}

.ecm-page-home .home-testimonials .testimonial-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
}

.ecm-page-home .home-testimonials-title {
  font-size: clamp(1.4rem, 3.8vw, 2rem);
}

/* --- CTA --- */
.ecm-page-home .home-cta {
  padding-top: 3.5rem !important;
  padding-bottom: 3.5rem !important;
}

.ecm-page-home .home-cta .cta-card {
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12) !important;
  border-radius: 24px !important;
}

.ecm-page-home .home-cta .cta-title {
  background: linear-gradient(135deg, #1e40af, #2563eb) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

.ecm-page-home .home-cta .cta-text {
  color: #475569 !important;
  opacity: 1 !important;
}

.ecm-page-home .home-cta .feature-item {
  color: #334155 !important;
}

.ecm-page-home .home-cta .newsletter-signup h5 {
  color: #1e3a8a !important;
}

.ecm-page-home .home-cta .newsletter-signup .form-control {
  background: #f8fafc !important;
  border-color: rgba(37, 99, 235, 0.2) !important;
  color: #0f172a !important;
}

.ecm-page-home .home-cta .newsletter-signup .form-control::placeholder {
  color: #94a3b8 !important;
}

/* Boutons page d’accueil : ne pas imposer 44px sur mini-boutons services */
@media (max-width: 767.98px) {
  .ecm-page-home .home-services .btn {
    min-height: unset;
  }
}
