/* SendgateEmailBuilder — palette de blocs → canvas email (porté du composant React en vanilla).
   Tokens scopés sur .sgeb ; piloté par assets/sg-builder.js (boucle rAF).
   Vit dans une carte .demo de la home → fond transparent, pas de padding propre. */

.sgeb {
  --sg-navy: #263B6A; --sg-navy-dark: #1B2C52; --sg-blue-gray: #6984A9;
  --sg-green: #A0D585; --sg-green-dark: #82BD63; --sg-lime: #EEFABD;
  --sg-ink: #22293B; --sg-muted: #6E7790; --sg-line: #E7E9F0;
  --sg-bg: #FCFCF8; --sg-section: #F4F6EC; --sg-card: #FFFFFF;
  --sg-serif: var(--sg-heading, 'Lexend Deca', Georgia, sans-serif);
  --sg-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-family: var(--sg-sans); color: var(--sg-ink);
  display: flex; justify-content: center;
}
.sgeb-stage { width: 460px; max-width: 100%; display: flex; flex-direction: column; }

/* Workspace : palette + canvas */
.sgeb-workspace { display: flex; gap: 18px; position: relative; }

/* Palette */
.sgeb-palette {
  width: 124px; flex-shrink: 0;
  background: var(--sg-card); border: 1.5px solid var(--sg-line); border-radius: 13px;
  padding: 13px 11px; display: flex; flex-direction: column; gap: 7px;
  box-shadow: 0 6px 18px rgba(38,59,106,0.06); align-self: flex-start; z-index: 3;
}
.sgeb-palette-label { font-size: 11px; font-weight: 600; color: var(--sg-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px; padding-left: 2px; }
.sgeb-pal-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  background: var(--sg-bg); border: 1.5px solid var(--sg-line); border-radius: 9px;
  font-size: 12.5px; font-weight: 500; color: var(--sg-navy);
  transition: opacity .2s ease, border-color .2s ease, background .2s ease;
}
.sgeb-pal-item svg { color: var(--sg-blue-gray); flex-shrink: 0; }
.sgeb-pal-item.is-grabbed { opacity: 0.35; border-style: dashed; background: transparent; }

/* Canvas */
.sgeb-canvas {
  flex: 1; position: relative;
  background: var(--sg-section); border: 1.5px solid var(--sg-line); border-radius: 13px;
  padding: 18px; min-height: 340px;
  display: flex; justify-content: center; align-items: flex-start;
}
.sgeb-email {
  width: 240px; max-width: 100%; background: var(--sg-card); border-radius: 10px;
  box-shadow: 0 8px 26px rgba(38,59,106,0.1); padding: 14px;
  display: flex; flex-direction: column; gap: 10px; align-self: flex-start;
}

/* Blocs dans l'email */
.sgeb-blk { width: 100%; }
.sgeb-pop { animation: sgeb-pop .4s cubic-bezier(.34,1.56,.64,1); }

.sgeb-c-logo { display: flex; justify-content: center; padding: 4px 0; }
.sgeb-c-logo-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--sg-navy); }
.sgeb-c-title { display: flex; flex-direction: column; gap: 7px; align-items: center; padding: 2px 0; }
.sgeb-c-bar { height: 11px; border-radius: 4px; background: var(--sg-navy); }
.sgeb-c-bar.w70 { width: 70%; }
.sgeb-c-bar.w45 { width: 45%; opacity: 0.55; }
.sgeb-c-image { height: 84px; border-radius: 8px; background: linear-gradient(135deg, var(--sg-section), #E7ECDA); display: flex; align-items: center; justify-content: center; color: var(--sg-blue-gray); }
.sgeb-c-text { display: flex; flex-direction: column; gap: 6px; }
.sgeb-c-line { height: 7px; border-radius: 4px; background: var(--sg-line); }
.sgeb-c-line.w90 { width: 90%; } .sgeb-c-line.w80 { width: 80%; } .sgeb-c-line.w60 { width: 60%; }
.sgeb-c-button { display: flex; justify-content: center; padding: 4px 0 2px; }
.sgeb-c-btn { width: 110px; height: 32px; border-radius: 8px; background: var(--sg-green); box-shadow: 0 3px 10px rgba(130,189,99,0.4); }

/* Zone de dépôt */
.sgeb-drop {
  border: 1.5px dashed var(--sg-line); border-radius: 8px; padding: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; color: var(--sg-muted);
  transition: border-color .25s ease, background .25s ease, color .25s ease;
}
.sgeb-drop.is-active { border-color: var(--sg-green-dark); background: rgba(160,213,133,0.1); color: var(--sg-green-dark); }

/* Bloc en vol */
.sgeb-fly {
  position: absolute; display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px;
  background: var(--sg-card); border: 1.5px solid var(--sg-navy); border-radius: 9px;
  font-size: 12.5px; font-weight: 600; color: var(--sg-navy); white-space: nowrap;
  box-shadow: 0 12px 28px rgba(38,59,106,0.24); z-index: 10; pointer-events: none;
}
.sgeb-fly svg { color: var(--sg-blue-gray); }

@keyframes sgeb-pop {
  0% { opacity: 0; transform: scale(0.85) translateY(-4px); }
  60% { transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}

@media (max-width: 520px) {
  .sgeb-stage { width: 100%; }
  .sgeb-palette { width: 96px; }
  .sgeb-email { width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .sgeb-fly { display: none; }
  .sgeb-pop { animation: none; }
  .sgeb-pal-item.is-grabbed { opacity: 1; border-style: solid; }
}
