/* configurateur-da.css — Configurateur Design Aesthetic BDEASY */

/* ── Navbar ────────────────────────────────────────────────── */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid #E5E5E0;
  height: 60px;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 19px;
  color: #141412;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.cfg-back {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #6B6B64;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}

.cfg-back:hover {
  color: #141412;
}

.cfg-nav-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #6D28D9;
  background: #EDE9FE;
  padding: 3px 10px;
  border-radius: 40px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Layout principal ─────────────────────────────────────── */
.cfg-wrap {
  display: flex;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.cfg-sidebar {
  width: 360px;
  min-width: 300px;
  flex-shrink: 0;
  overflow-y: auto;
  border-right: 1px solid #E5E5E0;
  padding: 28px 24px 40px;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cfg-sidebar-header {
  margin-bottom: 28px;
}

.cfg-sidebar-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #141412;
  line-height: 1.25;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.cfg-sidebar-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: #6B6B64;
  line-height: 1.55;
}

/* Live indicator */
.cfg-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #16A34A;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  padding: 3px 8px 3px 6px;
  border-radius: 40px;
  margin-top: 10px;
}

.cfg-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16A34A;
  animation: cfg-pulse 2s ease-in-out infinite;
}

@keyframes cfg-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

/* ── Sections sidebar ─────────────────────────────────────── */
.cfg-section {
  padding: 20px 0;
  border-bottom: 1px solid #F0F0EC;
}

.cfg-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cfg-label {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #6B6B64;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 10px;
}

.cfg-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cfg-label-row .cfg-label {
  margin-bottom: 0;
}

.cfg-color-hex {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #6B6B64;
  background: #F3F3F0;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.cfg-hint {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #A8A89E;
  margin-top: 10px;
  line-height: 1.5;
}

/* ── Input texte ──────────────────────────────────────────── */
.cfg-input {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #141412;
  background: #FAFAF8;
  border: 1px solid #E5E5E0;
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.cfg-input::placeholder {
  color: #C4C4BE;
}

.cfg-input:focus {
  border-color: #8B5CF6;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.08);
}

/* ── Color picker ─────────────────────────────────────────── */
.cfg-color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cfg-color-native {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.cfg-color-native::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
}

.cfg-color-native::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

.cfg-color-native::-moz-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

/* ── Presets couleur ──────────────────────────────────────── */
.cfg-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
}

.cfg-preset {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--c, #7C3AED);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  outline: none;
  flex-shrink: 0;
}

.cfg-preset:hover {
  transform: scale(1.15);
}

.cfg-preset.is-active {
  box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #6D28D9;
}

/* ── CTA section ──────────────────────────────────────────── */
.cfg-section-cta {
  background: linear-gradient(135deg, #1A0A3C 0%, #0D0520 100%);
  border-radius: 16px;
  padding: 20px !important;
  border: none !important;
  margin-top: 8px;
  text-align: center;
}

.cfg-cta-label {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: #F5F5FF;
  margin-bottom: 14px;
  line-height: 1.3;
}

.cfg-btn-primary {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #FFFFFF;
  background: #6D28D9;
  padding: 11px 20px;
  border-radius: 40px;
  text-decoration: none;
  transition: background 0.15s, transform 0.12s;
  width: 100%;
  text-align: center;
  margin-bottom: 10px;
}

.cfg-btn-primary:hover {
  background: #7C3AED;
  transform: translateY(-1px);
}

.cfg-cta-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  color: #9999BB;
  line-height: 1.6;
}

/* ── Stage (zone téléphone) ───────────────────────────────── */
.cfg-stage {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* Fond: motif pointillés subtil sur gris chaud */
  background-color: #EAEAE6;
  background-image: radial-gradient(circle, rgba(109, 40, 217, 0.10) 1px, transparent 1px);
  background-size: 22px 22px;
  overflow: auto;
  padding: 48px 40px 60px;
}

/* ── Frame iPhone (image PNG) ─────────────────────────────── */
.cfg-phone-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* Le mockup utilise une image PNG d'iPhone (1080×1920). L'iframe est
   positionnée en absolute au-dessus de la zone "écran blanc" de l'image
   via les variables --screen-* (insets en pourcentage de l'image).
   Si tu remplaces l'image par un autre frame, ajuste les % ci-dessous. */
.cfg-phone {
  --phone-w: 380px;
  /* Insets calculés pixel-perfect depuis assets/iphone-mockup.png (1080×1920).
     Si l'image change, recalculer avec l'analyse PIL. */
  /* Insets pixel-perfect mesurés sur le PNG (pas de marge en plus). */
  --screen-top: 1.85%;
  --screen-bottom: 1.85%;
  --screen-left: 10.6%;
  --screen-right: 10.6%;
  /* Radius gonflé pour que l'iframe rentre franchement sous la courbure
     du frame PNG (3.5% / 1.6% au pixel-perfect). Le contenu Flutter aux
     4 coins est légèrement clipped — négligeable car ce sont des zones
     vides (statusbar coins en haut, marges autour de la nav en bas). */
  --screen-radius-h: 7%;
  --screen-radius-v: 3.2%;

  position: relative;
  width: var(--phone-w);
  aspect-ratio: 1080 / 1920;
  flex-shrink: 0;
  /* Drop-shadow CSS sur l'alpha du PNG overlay pour donner du relief */
  filter:
    drop-shadow(0 24px 50px rgba(0, 0, 0, 0.32))
    drop-shadow(0 0 60px rgba(109, 40, 217, 0.06));
}

/* Overlay du frame PNG, par-dessus l'iframe.
   Indispensable pour que les zones opaques du PNG (frame extérieur,
   dynamic island en haut centre) restent visibles devant l'iframe. */
.cfg-phone-frame-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 30;
  user-select: none;
}

/* Anciens éléments décoratifs (notch, home indicator HTML, boutons latéraux)
   désormais inclus dans le PNG ou redessinés via ::after → masqués pour
   ne pas se superposer. */
.cfg-phone-notch,
.cfg-phone-home,
.cfg-phone::before {
  display: none;
}

/* Home indicator iPhone — barre horizontale en bas de l'écran, par-dessus
   l'iframe pour compenser l'absence dans le PNG du frame. */
.cfg-phone::after {
  content: '';
  position: absolute;
  bottom: 1.05%;
  left: 50%;
  transform: translateX(-50%);
  width: 33%;
  height: 0.3%;
  min-height: 4px;
  background: #141412;
  border-radius: 99px;
  z-index: 50;
  pointer-events: none;
}

.cfg-phone-screen {
  position: absolute;
  top: var(--screen-top);
  bottom: var(--screen-bottom);
  left: var(--screen-left);
  right: var(--screen-right);
  overflow: hidden;
  /* Border-radius elliptique pour matcher la courbure de l'écran iPhone */
  border-radius: var(--screen-radius-h) / var(--screen-radius-v);
  background: #fff;
}

.cfg-phone-screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}

/* ── Loading overlay (thème clair) ────────────────────────── */
.cfg-loading {
  /* Aligné sur la même zone que .cfg-phone-screen (variables héritées). */
  position: absolute;
  top: var(--screen-top, 1.85%);
  bottom: var(--screen-bottom, 1.85%);
  left: var(--screen-left, 10.6%);
  right: var(--screen-right, 10.6%);
  background:
    radial-gradient(120% 80% at 50% 10%, #FAFAF8 0%, #F3F3F0 100%);
  border-radius: var(--screen-radius-h, 3.5%) / var(--screen-radius-v, 1.6%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
  overflow: hidden;
}

.cfg-loading::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(109, 40, 217, 0.10) 0%, transparent 70%);
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: cfg-glow 3s ease-in-out infinite;
}

@keyframes cfg-glow {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.9); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
}

.cfg-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.cfg-loading-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  z-index: 1;
}

/* Logo monogramme animé */
.cfg-loading-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  box-shadow:
    0 8px 24px rgba(109, 40, 217, 0.30),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
  animation: cfg-logo-pulse 2.4s ease-in-out infinite;
}

@keyframes cfg-logo-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 24px rgba(109, 40, 217, 0.30), 0 0 0 1px rgba(255, 255, 255, 0.4) inset; }
  50%      { transform: scale(1.04); box-shadow: 0 12px 32px rgba(109, 40, 217, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.5) inset; }
}

/* Trois points qui rebondissent */
.cfg-loading-dots {
  display: flex;
  gap: 6px;
}

.cfg-loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6D28D9;
  animation: cfg-dot-bounce 1.4s ease-in-out infinite;
}

.cfg-loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.cfg-loading-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes cfg-dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-8px); opacity: 1; }
}

.cfg-loading-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  color: #141412;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.cfg-loading-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #6B6B64;
  margin-top: -8px;
}

/* ── Responsive mobile < 900px ───────────────────────────── */
@media (max-width: 900px) {
  .cfg-wrap {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }

  .cfg-sidebar {
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid #E5E5E0;
    padding: 24px 20px 32px;
  }

  .cfg-stage {
    min-height: 560px;
    padding: 32px 16px 48px;
    align-items: flex-start;
  }
}

@media (max-width: 440px) {
  .cfg-phone-wrap {
    transform: scale(0.78);
    transform-origin: top center;
  }
  .cfg-stage {
    min-height: 650px;
  }
}

/* ── Scrollbar sidebar (webkit) ───────────────────────────── */
.cfg-sidebar::-webkit-scrollbar {
  width: 3px;
}
.cfg-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.cfg-sidebar::-webkit-scrollbar-thumb {
  background: #E5E5E0;
  border-radius: 2px;
}

/* ── MODE TOGGLE (light/dark) ─────────────────────────────── */
.cfg-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #F3F3F0;
  border: 1px solid #E5E5E0;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 8px;
}
.cfg-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #6B6B64;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.cfg-mode-btn:hover { color: #141412; }
.cfg-mode-btn.is-active {
  background: #fff;
  color: #141412;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 20, 18, 0.08);
}
.cfg-mode-ico {
  font-size: 16px;
  line-height: 1;
}

/* ── BACKGROUND ROW ───────────────────────────────────────── */
.cfg-bg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.cfg-bg-row .cfg-color-native {
  width: 56px;
  height: 40px;
  border: 1px solid #E5E5E0;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  background: transparent;
}
.cfg-bg-reset {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #6B6B64;
  background: transparent;
  border: 1px solid #E5E5E0;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.cfg-bg-reset:hover {
  background: #F3F3F0;
  color: #141412;
}

/* ── MODULES TOGGLES ──────────────────────────────────────── */
.cfg-modules {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.cfg-module {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #E5E5E0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.cfg-module:hover { border-color: #C8C8C0; }
.cfg-module input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #7C3AED;
  cursor: pointer;
  flex-shrink: 0;
}
.cfg-module-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #141412;
  user-select: none;
}
.cfg-module:has(input:not(:checked)) {
  background: #FAFAF8;
  opacity: 0.65;
}
.cfg-module:has(input:not(:checked)) .cfg-module-name {
  text-decoration: line-through;
  color: #6B6B64;
}

/* ── LOGO UPLOAD ──────────────────────────────────────────── */
.cfg-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.cfg-logo-preview {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #E5E5E0;
}
.cfg-logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cfg-logo-placeholder {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
}
.cfg-logo-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.cfg-logo-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #7C3AED;
  background: rgba(124, 58, 237, 0.08);
  border: 1px dashed rgba(124, 58, 237, 0.4);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
  text-align: center;
}
.cfg-logo-upload:hover {
  background: rgba(124, 58, 237, 0.14);
  border-color: rgba(124, 58, 237, 0.7);
}
.cfg-logo-reset {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #6B6B64;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  align-self: center;
}
.cfg-logo-reset:hover { color: #DC2626; }

/* ── WORDING ──────────────────────────────────────────────── */
.cfg-wording {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.cfg-wording-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cfg-wording-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #6B6B64;
  min-width: 100px;
}
.cfg-wording-select {
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #141412;
  background: #fff;
  border: 1px solid #E5E5E0;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.cfg-wording-select:focus {
  outline: none;
  border-color: #7C3AED;
}

/* ── TOOLTIP TRIGGERS (?) ─────────────────────────────────── */
.cfg-tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #6B6B64;
  background: #E5E5E0;
  border: 0;
  border-radius: 50%;
  cursor: help;
  transition: background 0.18s ease, color 0.18s ease;
  vertical-align: middle;
  line-height: 1;
  padding: 0;
}
.cfg-tooltip-trigger:hover {
  background: #7C3AED;
  color: #fff;
}
.cfg-tooltip-bubble {
  position: absolute;
  z-index: 9999;
  max-width: 320px;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #fff;
  background: #141412;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(20, 20, 18, 0.18);
  animation: cfgTooltipIn 0.18s ease-out;
}
.cfg-tooltip-bubble::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 14px;
  width: 10px;
  height: 10px;
  background: #141412;
  transform: rotate(45deg);
  border-radius: 2px 0 0 0;
}
@keyframes cfgTooltipIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cfg-wording-label {
  display: inline-flex;
  align-items: center;
}

/* ── BANNIÈRE FEED ────────────────────────────────────────── */
.cfg-banner-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.cfg-banner-preview {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 12px;
  background: repeating-linear-gradient(
    45deg,
    #F3F3F0 0 8px,
    #FAFAF8 8px 16px
  );
  border: 1px solid #E5E5E0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cfg-banner-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cfg-banner-placeholder {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: #A8A89E;
  letter-spacing: 0.04em;
}
.cfg-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cfg-banner-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #7C3AED;
  background: rgba(124, 58, 237, 0.08);
  border: 1px dashed rgba(124, 58, 237, 0.4);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.cfg-banner-upload:hover {
  background: rgba(124, 58, 237, 0.14);
  border-color: rgba(124, 58, 237, 0.7);
}
.cfg-banner-reset {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #6B6B64;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cfg-banner-reset:hover { color: #DC2626; }

/* ── RENOMMAGE DES ONGLETS ────────────────────────────────── */
.cfg-tab-labels {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.cfg-tab-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  align-items: center;
  gap: 10px;
}
.cfg-tab-default {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #6B6B64;
}
.cfg-tab-input {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #141412;
  background: #fff;
  border: 1px solid #E5E5E0;
  border-radius: 8px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.18s ease;
}
.cfg-tab-input:focus { border-color: #7C3AED; }
.cfg-tab-input::placeholder { color: #A8A89E; }

/* ── STYLE DES COINS ──────────────────────────────────────── */
.cfg-corner-toggle {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: #F3F3F0;
  border: 1px solid #E5E5E0;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 8px;
}
.cfg-corner-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #6B6B64;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 8px 4px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.cfg-corner-btn:hover { color: #141412; }
.cfg-corner-btn.is-active {
  background: #fff;
  color: #141412;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(20, 20, 18, 0.08);
}

/* ── POLICE D'ÉCRITURE ────────────────────────────────────── */
.cfg-font-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.cfg-font-btn {
  font-size: 14px;
  color: #141412;
  background: #fff;
  border: 1px solid #E5E5E0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.cfg-font-btn:hover { border-color: #C8C8C0; }
.cfg-font-btn.is-active {
  border-color: #7C3AED;
  background: rgba(124, 58, 237, 0.06);
  font-weight: 600;
  color: #7C3AED;
}

/* ═══════════════════════════════════════════════════════════════════
   CONFIGURATEUR — Optimisations mobile (2026-05-13)
   Layout vertical avec mockup sticky en bas pour voir le résultat
   sans re-scroller à chaque modification.
   ═══════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  body { overflow-x: hidden; }

  .cfg-wrap {
    padding-bottom: 220px; /* espace pour la preview sticky */
  }

  /* Sidebar : padding plus serré, scroll fluide */
  .cfg-sidebar {
    padding: 18px 16px 24px !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Titres section plus compacts */
  .cfg-section-title,
  .cfg-section-label {
    font-size: 11px !important;
    letter-spacing: 0.1em;
    margin-top: 18px;
    margin-bottom: 8px !important;
  }

  /* Color swatches : grid 6 cols + tailles tap-friendly */
  .cfg-color-grid,
  .cfg-swatches {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 8px !important;
  }
  .cfg-swatch {
    width: 100% !important;
    aspect-ratio: 1 !important;
    height: auto !important;
    min-height: 36px;
    border-radius: 8px !important;
    border: 2px solid transparent;
    transition: transform 0.12s ease, border-color 0.15s ease;
  }
  .cfg-swatch.is-active,
  .cfg-swatch[aria-pressed="true"] {
    border-color: var(--text, #141412);
    transform: scale(1.08);
  }

  /* Modules : pills compactes en wrap */
  .cfg-modules,
  .cfg-modules-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .cfg-module-pill,
  .cfg-module-btn {
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-radius: 10px !important;
    min-height: 38px;
  }

  /* Inputs (logo, nom) : taille tactile */
  .cfg-input,
  .cfg-text-input,
  .cfg-sidebar input[type="text"],
  .cfg-sidebar input[type="file"] {
    font-size: 16px !important; /* évite le zoom auto iOS */
    padding: 12px 14px !important;
    min-height: 44px;
    border-radius: 10px !important;
  }

  /* Toggles / switches */
  .cfg-toggle,
  .cfg-switch-row {
    min-height: 48px;
    padding: 6px 0;
  }
  .cfg-toggle-label,
  .cfg-switch-label {
    font-size: 14px !important;
  }

  /* Stage / preview : sticky en bas sur mobile pour voir le mockup en live */
  .cfg-stage {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #FAFAF8 30%);
    padding: 16px 8px 12px !important;
    min-height: auto !important;
    max-height: 220px;
    z-index: 50;
    pointer-events: none; /* on laisse tap-through sauf sur le phone */
    align-items: flex-end !important;
    justify-content: center;
    border-top: 1px solid var(--border, #E5E5E0);
    box-shadow: 0 -8px 24px rgba(20, 20, 18, 0.05);
  }
  .cfg-stage .cfg-phone-wrap {
    pointer-events: auto;
    transform: scale(0.42) !important; /* mini-mockup en bas */
    transform-origin: bottom center;
    margin-bottom: -120px;
  }

  /* Bouton "Voir en grand" pour le mockup */
  .cfg-preview-expand {
    position: fixed;
    bottom: 188px;
    right: 14px;
    z-index: 60;
    background: var(--text, #141412);
    color: #fff;
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: 0 6px 16px rgba(20, 20, 18, 0.25);
    cursor: pointer;
    display: none; /* affiché via JS si présent */
  }

  /* CTA bar du configurateur (export, save, etc.) : sticky en bas */
  .cfg-actions,
  .cfg-cta-row {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(250, 250, 248, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border, #E5E5E0);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    display: flex !important;
    gap: 8px;
    z-index: 70;
  }
  .cfg-actions .cfg-btn,
  .cfg-cta-row button {
    flex: 1;
    min-height: 48px;
    border-radius: 12px !important;
    font-size: 14px !important;
  }

  /* Si fond clair mobile / preview light/dark mode toggle */
  .cfg-mode-toggle {
    grid-template-columns: 1fr 1fr;
    gap: 4px !important;
  }
  .cfg-mode-btn {
    padding: 10px !important;
    font-size: 13px !important;
    min-height: 44px;
  }
}

/* Petits écrans : encore plus compact */
@media (max-width: 380px) {
  .cfg-color-grid,
  .cfg-swatches {
    grid-template-columns: repeat(5, 1fr) !important;
  }
  .cfg-sidebar {
    padding: 14px 12px 20px !important;
  }
  .cfg-stage .cfg-phone-wrap {
    transform: scale(0.36) !important;
    margin-bottom: -140px;
  }
}

