@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(--rouge); 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 × 1920'; }
@keyframes spin { to { transform: rotate(360deg); } }
.hint { font-size: 11px; color: var(--n400); text-align: center; margin-top: 6px; }

/* ─── Aperçu 9:16 ─── */
.preview-section { width: 100%; max-width: 300px; }
.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: 9/16;
  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: 1920px;
  transform-origin: top left;
}

/* ═══════════════════════════════
   COVER REEL 1080 × 1920 (9:16)
   ═══════════════════════════════ */
.post {
  width: 1080px; height: 1920px;
  position: relative; overflow: hidden;
  font-family: 'Montreal', sans-serif;
  background: var(--esp);
}

/* 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(160deg, #2A2018 0%, #18100A 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px;
}
.ph svg { opacity: .12; }
.ph span {
  font-size: 26px; font-weight: 400; color: white;
  opacity: .2; letter-spacing: .14em; text-transform: uppercase;
}

/* Dégradé haut → opacifier pour lisibilité logo */
.top-fade {
  position: absolute; top: 0; left: 0; right: 0; height: 350px;
  background: linear-gradient(to bottom, rgba(24,16,10,.55) 0%, transparent 100%);
  pointer-events: none; z-index: 5;
}

/* Dégradé bas → bande texte */
.bottom-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 620px;
  background: linear-gradient(to top, rgba(24,16,10,.92) 0%, rgba(24,16,10,.65) 45%, transparent 100%);
  pointer-events: none; z-index: 5;
}

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

/* Logo haut gauche */
.logo-wrap {
  position: absolute; top: 36px; left: 52px; z-index: 20;
}
.logo-wrap img { height: 80px; }

/* Badge "Making of" haut droit */
.making-badge {
  position: absolute; top: 50px; right: 52px; z-index: 20;
  display: inline-flex; align-items: center; gap: 10px;
  border: 1.5px solid rgba(38,92,88,.6);
  background: rgba(38,92,88,.15);
  padding: 10px 22px; border-radius: 999px;
}
.badge-rec {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--rouge);
  box-shadow: 0 0 0 3px rgba(158,31,53,.25);
}
.badge-label {
  font-size: 20px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: rgba(245,230,200,.65);
}

/* Zone texte bas */
.text-zone {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 0 68px 90px;
  z-index: 20;
  display: flex; flex-direction: column; gap: 0;
}

/* Ligne teal */
.teal-rule { width: 54px; height: 3px; background: var(--teal); border-radius: 2px; margin-bottom: 32px; }

/* Épisode / contexte */
.episode-tag {
  font-size: 20px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: rgba(38,92,88,.85); margin-bottom: 18px;
  display: flex; align-items: center; gap: 12px;
}
.episode-tag::before {
  content: ''; width: 6px; height: 6px;
  border-radius: 50%; background: var(--rouge); flex-shrink: 0;
}

/* Titre principal */
.reel-title {
  font-family: 'Montreal', sans-serif;
  font-weight: 500; font-size: 88px;
  line-height: 1.0; letter-spacing: -.02em;
  color: var(--ivoire); margin-bottom: 18px;
}

/* Sous-titre */
.reel-sub {
  font-weight: 300; font-size: 34px;
  color: rgba(245,230,200,.45);
  letter-spacing: .05em; line-height: 1.4;
  margin-bottom: 52px;
}

/* Durée + URL */
.reel-meta {
  display: flex; align-items: center; gap: 28px;
}
.reel-duration {
  display: inline-flex; align-items: center; gap: 10px;
  background: rgba(38,92,88,.25);
  border: 1px solid rgba(38,92,88,.4);
  padding: 10px 20px; border-radius: 999px;
  font-size: 20px; font-weight: 600;
  letter-spacing: .1em; color: rgba(38,92,88,.9);
}
.reel-url {
  font-family: 'Montreal', sans-serif;
  font-weight: 300; font-size: 22px;
  letter-spacing: .12em; text-transform: uppercase;
  color: rgba(245,230,200,.25);
}

/* Numéro watermark */
.ep-number {
  position: absolute; bottom: 88px; right: 68px;
  font-size: 160px; font-weight: 700;
  letter-spacing: -.05em;
  color: rgba(38,92,88,.08);
  line-height: 1; z-index: 6;
}
