@import url('../assets/fonts/fonts.css');

:root {
  --esp:    #18100A;
  --teal:   #265C58;
  --rouge:  #9E1F35;
  --creme:  #F5E6C8;
  --sable:  #EDE0CC;
  --ivoire: #FAF5EE;
  --n400:   #A69B8B;
  --n500:   #5F554B;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #C8C4BE;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 60px;
  font-family: 'Montreal', sans-serif;
  gap: 24px;
  min-height: 100vh;
}
.back-link {
  width: 100%; max-width: 480px;
  display: inline-flex; align-items: center; gap: 8px; align-self: center;
  color: var(--esp); background: rgba(255,255,255,.82);
  border: 1px solid var(--sable); border-radius: 8px;
  padding: 10px 14px; text-decoration: none;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  transition: border-color .2s, color .2s, transform .2s;
}
.back-link:hover {
  color: var(--teal); border-color: var(--teal); transform: translateY(-1px);
}

/* ─── Contrôles ─── */
.controls {
  width: 100%; max-width: 480px;
  background: white; border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 2px 16px rgba(0,0,0,.1);
  border: 1px solid var(--sable);
}
.ctrl-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
  border-bottom: 1.5px solid var(--sable);
  padding-bottom: 14px;
}
.ctrl-header h2 { font-family: 'Autumn Cartoon', Georgia, serif; font-size: 17px; color: var(--esp); }
.ctrl-header .tag {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: white;
  background: var(--teal); padding: 3px 9px; border-radius: 4px; margin-left: auto;
}
.field { margin-bottom: 10px; }
.field label {
  display: block; font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 4px;
}
.field input, .field select {
  width: 100%; border: 1.5px solid var(--sable); border-radius: 7px;
  padding: 8px 11px; font-family: 'Montreal', sans-serif;
  font-size: 13px; color: var(--esp); outline: none;
  background: var(--ivoire); transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--teal); }
.field-hint { font-size: 10px; color: var(--n400); margin-top: 3px; font-style: italic; }
.upload-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; border: 2px dashed var(--sable); border-radius: 8px;
  padding: 14px; cursor: pointer; background: var(--ivoire); transition: border-color .2s;
}
.upload-label:hover { border-color: var(--teal); }
.upload-label input { display: none; }
.upload-label span { font-size: 11px; color: var(--n400); text-align: center; line-height: 1.5; }

.btn-exp {
  width: 100%; padding: 12px; background: var(--teal); color: white;
  border: none; border-radius: 8px; font-family: 'Montreal', sans-serif;
  font-size: 13px; font-weight: 700; letter-spacing: .07em; cursor: pointer;
  margin-top: 8px; transition: background .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-exp:hover { background: #1B403E; }
.btn-exp.loading { background: #4A8A86; cursor: wait; }
.btn-exp .spinner {
  width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.3);
  border-top-color: white; border-radius: 50%;
  animation: spin .7s linear infinite; display: none;
}
.btn-exp.loading .spinner { display: block; }
.btn-exp.loading .lbl::before { content: 'Génération…'; }
.btn-exp:not(.loading) .lbl::before { content: '📥  Exporter PNG 1080 × 1080'; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { font-size: 11px; color: var(--n400); text-align: center; margin-top: 6px; }

/* ─── Aperçu ─── */
.preview-section { width: 100%; max-width: 480px; }
.preview-label {
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(0,0,0,.3);
  text-align: center; margin-bottom: 8px;
}
.canvas-wrap {
  width: 100%; aspect-ratio: 1/1;
  overflow: hidden; border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  position: relative;
}
.slide-scaler {
  position: absolute; top: 0; left: 0;
  width: 1080px; height: 1080px;
  transform-origin: top left;
}

/* ═══════════════════════════════
   POST 1080 × 1080
   ═══════════════════════════════ */
.post {
  width: 1080px; height: 1080px;
  position: relative; overflow: hidden;
  font-family: 'Montreal', sans-serif;
  background: var(--ivoire);
}

/* Photo plein cadre */
.photo-zone {
  position: absolute; inset: 0; overflow: hidden;
}
.photo-zone img.real { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph {
  width: 100%; height: 100%;
  background: linear-gradient(145deg, #EDE4D6 0%, #CEC5B7 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
.ph svg { opacity: .15; }
.ph span {
  font-size: 24px; font-weight: 400; color: var(--esp);
  opacity: .25; letter-spacing: .14em; text-transform: uppercase;
}

/* Barre teal haut */
.teal-topbar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 8px; background: var(--teal); z-index: 20;
}

/* Badge technique — haut gauche */
.technique-badge {
  position: absolute; top: 30px; left: 46px; z-index: 30;
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--esp); padding: 10px 22px;
  border-radius: 999px;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.badge-label {
  font-size: 18px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(245,230,200,.7);
}

/* Logo — haut droit */
.logo-wrap {
  position: absolute; top: 26px; right: 46px; z-index: 30;
}
.logo-wrap img { height: 70px; }

/* Bandeau bas — Espresso solide, même structure que post-produit-45 */
.info-band {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 420px;
  background: var(--esp);
  padding: 0 58px;
  z-index: 20;
  display: flex; flex-direction: column;
}

/* En-tête bande : liseret teal + logo */
.band-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 34px; margin-bottom: 24px;
}
.teal-rule { width: 72px; height: 3px; background: var(--teal); border-radius: 2px; }
.logo-h { height: 62px; }

/* Ligne déco teal — supprimée (remplacée par band-header) */
.teal-accent { display: none; }

/* Nom du détail — Montreal 500, même taille que pname 4:5 */
.detail-name {
  font-family: 'Montreal', sans-serif;
  font-weight: 500; font-size: 78px;
  line-height: 1.0; letter-spacing: -.02em;
  color: var(--ivoire);
  margin-bottom: 10px;
}

/* Description courte — même style que psub 4:5 */
.detail-desc {
  font-weight: 300; font-size: 26px;
  color: rgba(245,230,200,.38);
  letter-spacing: .06em; line-height: 1.4;
  flex: 1;
}

/* Pied : matière + CTA — même structure que band-footer 4:5 */
.band-footer {
  display: flex; align-items: flex-end; justify-content: space-between;
  padding-bottom: 44px;
}
.matiere {
  display: flex; align-items: center; gap: 10px;
}
.matiere-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--rouge); flex-shrink: 0; }
.matiere-text {
  font-size: 18px; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: rgba(255,255,255,.4);
}
.cta-pill {
  background: var(--rouge); color: white;
  font-weight: 700; font-size: 23px;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 22px 46px; border-radius: 999px;
}

/* Numéro de série — watermark discret */
.series-tag {
  position: absolute; right: 54px; bottom: 48px;
  font-size: 17px; font-weight: 400;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(245,230,200,.18);
  z-index: 25;
}
