#!/usr/bin/env python3
"""Gera os HTMLs v2 para as 7 copies restantes (2, 4, 5, 6, 7, 8, 9).

- Copy 6 recebe REMONTE: adiciona icone de nuvem cortada
- Copies 2, 4, 5, 7, 8, 9: re-renderizacao com headline v4 atualizada

Reaproveita todos os backgrounds v1 existentes.
"""
from pathlib import Path

BASE = Path('/opt/mia/workspace/clientes/px3lab/lancamento_photorf2/criativos')
BGS = BASE / 'bgs'
LOGO = '/opt/mia/workspace/clientes/px3lab/px3lab_logo.png'

COMMON_CSS = """
  @font-face { font-family: 'Inter'; src: url('file:///home/mia/.fonts/px3lab/Inter-Regular.ttf') format('truetype'); font-weight: 400; }
  @font-face { font-family: 'Inter'; src: url('file:///home/mia/.fonts/px3lab/Inter-Bold.ttf') format('truetype'); font-weight: 700; }
  @font-face { font-family: 'Inter'; src: url('file:///home/mia/.fonts/px3lab/Inter-Black.ttf') format('truetype'); font-weight: 900; }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { margin: 0; padding: 0; overflow: hidden; background: #12160C; font-family: 'Inter', sans-serif; color: #FFFFFF; -webkit-font-smoothing: antialiased; }

  .canvas { position: relative; overflow: hidden; background: #12160C; }
  .photo { position: absolute; top: 0; left: 0; background-size: cover; background-position: center; }
  .scanlines { position: absolute; top: 0; left: 0; background: repeating-linear-gradient(to bottom, rgba(150, 194, 0, 0) 0px, rgba(150, 194, 0, 0) 3px, rgba(150, 194, 0, 0.025) 3px, rgba(150, 194, 0, 0.025) 4px); pointer-events: none; z-index: 2; }

  .face-box { position: absolute; border: 3px solid #96C200; box-shadow: 0 0 24px rgba(150, 194, 0, 0.45), inset 0 0 12px rgba(150, 194, 0, 0.12); z-index: 3; }
  .face-box::before, .face-box::after { content: ''; position: absolute; width: 22px; height: 22px; border: 4px solid #C9E866; }
  .face-box::before { top: -6px; left: -6px; border-right: none; border-bottom: none; }
  .face-box::after { bottom: -6px; right: -6px; border-left: none; border-top: none; }

  .label { position: absolute; background: #96C200; color: #12160C; font-family: 'Inter', sans-serif; font-weight: 900; font-size: 26px; letter-spacing: 3px; padding: 10px 18px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
  .conf { position: absolute; color: #96C200; font-family: 'Inter', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: 1.5px; z-index: 4; background: rgba(18,22,12,0.85); padding: 4px 8px; border-left: 2px solid #96C200; }

  .headline-wrap { position: absolute; z-index: 5; }
  .badge-topo { font-family: 'Inter', sans-serif; font-weight: 700; letter-spacing: 3px; color: #96C200; text-transform: uppercase; display: flex; align-items: center; gap: 14px; }
  .badge-topo::before { content: ''; width: 42px; height: 3px; background: #96C200; display: inline-block; }
  .headline { font-family: 'Inter', sans-serif; font-weight: 900; color: #FFFFFF; letter-spacing: -1px; }
  .headline .accent { color: #96C200; }

  .footer { position: absolute; display: flex; align-items: center; justify-content: space-between; z-index: 6; }
  .logo { width: auto; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
  .lancamento { font-family: 'Inter', sans-serif; font-weight: 700; color: #FFFFFF; letter-spacing: 2px; text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
  .lancamento .dot { width: 8px; height: 8px; background: #96C200; border-radius: 50%; box-shadow: 0 0 12px #96C200; }
  .lancamento .data { color: #96C200; font-weight: 900; }
"""


def html_shell(w, h, extra_css, body):
    return f"""<!DOCTYPE html>
<html lang="pt-BR"><head><meta charset="UTF-8"><style>
{COMMON_CSS}
  html, body {{ width: {w}px; height: {h}px; }}
  .canvas {{ width: {w}px; height: {h}px; }}
{extra_css}
</style></head><body><div class="canvas">{body}</div></body></html>"""


def footer_html(w, bottom, logo_h, text_size):
    return f"""
    <div class="footer" style="left: 80px; right: 80px; bottom: {bottom}px;">
      <img class="logo" src="file://{LOGO}" style="height: {logo_h}px;">
      <div class="lancamento" style="font-size: {text_size}px;">
        <span class="dot"></span>
        Lançamento <span class="data">07/10</span>
      </div>
    </div>"""


# =============================================================================
# COPY 2 — Feed 1:1 — Fila desatendida (headline v4)
# =============================================================================
def copy2():
    w, h = 1080, 1080
    bg = f"file://{BGS}/bg_copy2_fila.png"
    extra = """
      .photo { width: 1080px; height: 720px; background-image: url('""" + bg + """'); background-position: center 45%; }
      .photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 40%, rgba(18,22,12,0) 40%, rgba(18,22,12,0.55) 100%), linear-gradient(to bottom, rgba(18,22,12,0) 55%, rgba(18,22,12,1) 100%); }
      .scanlines { width: 1080px; height: 720px; }

      .queue-panel { position: absolute; top: 160px; right: 60px; width: 340px; background: rgba(18,22,12,0.85); border: 2px solid #96C200; padding: 22px 24px; z-index: 4; box-shadow: 0 0 30px rgba(150,194,0,0.35); }
      .queue-title { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 3px; color: #96C200; text-transform: uppercase; margin-bottom: 16px; }
      .queue-item { display: flex; flex-direction: column; margin-bottom: 14px; }
      .queue-item:last-child { margin-bottom: 0; }
      .queue-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
      .queue-name { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 17px; color: #FFFFFF; letter-spacing: 0.5px; }
      .queue-status { font-family: 'Inter', sans-serif; font-weight: 900; font-size: 12px; letter-spacing: 2px; color: #96C200; text-transform: uppercase; }
      .queue-status.done { color: #C9E866; }
      .bar { height: 6px; background: rgba(150,194,0,0.15); position: relative; }
      .bar-fill { position: absolute; top: 0; left: 0; height: 100%; background: #96C200; box-shadow: 0 0 8px rgba(150,194,0,0.6); }
    """
    body = f"""
      <div class="photo"></div>
      <div class="scanlines"></div>

      <div class="queue-panel">
        <div class="queue-title">Fila de processamento</div>
        <div class="queue-item">
          <div class="queue-row"><span class="queue-name">Casamento</span><span class="queue-status done">Pronto</span></div>
          <div class="bar"><div class="bar-fill" style="width: 100%;"></div></div>
        </div>
        <div class="queue-item">
          <div class="queue-row"><span class="queue-name">Formatura</span><span class="queue-status">Em carga</span></div>
          <div class="bar"><div class="bar-fill" style="width: 62%;"></div></div>
        </div>
        <div class="queue-item">
          <div class="queue-row"><span class="queue-name">Empresa</span><span class="queue-status">Fila</span></div>
          <div class="bar"><div class="bar-fill" style="width: 18%;"></div></div>
        </div>
      </div>

      <div class="headline-wrap" style="left: 80px; right: 80px; top: 620px;">
        <div class="badge-topo" style="font-size: 20px; margin-bottom: 14px;">Cloud PhotoRF 2.0</div>
        <div class="headline" style="font-size: 72px; line-height: 1.15;">
          Vários eventos na fila.<br>
          <span class="accent">Deixa a máquina trabalhando.</span>
        </div>
      </div>
      {footer_html(w, 48, 48, 20)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 4 — Feed 1:1 — Vizinhanca (headline v4: outorga/beijinho)
# =============================================================================
def copy4():
    w, h = 1080, 1080
    bg = f"file://{BGS}/bg_copy4_vizinhanca.png"
    extra = """
      .photo { width: 1080px; height: 720px; background-image: url('""" + bg + """'); background-position: center 35%; }
      .photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 40%, rgba(18,22,12,0) 40%, rgba(18,22,12,0.55) 100%), linear-gradient(to bottom, rgba(18,22,12,0) 55%, rgba(18,22,12,1) 100%); }
      .scanlines { width: 1080px; height: 720px; }

      .box-costas { top: 90px; left: 340px; width: 320px; height: 430px; }
      .conf-costas { top: 93px; left: 340px; }
      .label-costas { position: absolute; top: 545px; left: 340px; background: #96C200; color: #12160C; font-family: 'Inter'; font-weight: 900; font-size: 20px; letter-spacing: 2.5px; padding: 10px 18px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }

      .position-panel { position: absolute; right: 55px; top: 180px; background: rgba(18,22,12,0.85); border-left: 3px solid #96C200; padding: 18px 22px; z-index: 4; }
      .position-title { font-family: 'Inter'; font-weight: 700; font-size: 12px; letter-spacing: 3px; color: #96C200; text-transform: uppercase; margin-bottom: 10px; }
      .position-icon { width: 60px; height: 60px; margin: 0 auto 8px; position: relative; }
      .position-icon::before, .position-icon::after { content: ''; position: absolute; background: #96C200; }
      .position-icon::before { top: 50%; left: 0; right: 0; height: 2px; }
      .position-icon::after { left: 50%; top: 0; bottom: 0; width: 2px; }
      .position-dot { width: 14px; height: 14px; background: #96C200; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 14px #96C200; }
      .position-lbl { font-family: 'Inter'; font-weight: 700; font-size: 13px; color: #FFFFFF; text-align: center; letter-spacing: 1px; }
    """
    body = f"""
      <div class="photo"></div>
      <div class="scanlines"></div>

      <div class="face-box box-costas"></div>
      <div class="conf conf-costas">MATCH</div>
      <div class="label-costas">Por vizinhança</div>

      <div class="position-panel">
        <div class="position-title">Posição na cena</div>
        <div class="position-icon"><div class="position-dot"></div></div>
        <div class="position-lbl">alocado</div>
      </div>

      <div class="headline-wrap" style="left: 80px; right: 80px; top: 620px;">
        <div class="badge-topo" style="font-size: 20px; margin-bottom: 14px;">Cloud PhotoRF 2.0</div>
        <div class="headline" style="font-size: 68px; line-height: 1.15;">
          De costas na outorga.<br>
          <span class="accent">O sistema ainda reconhece.</span>
        </div>
      </div>
      {footer_html(w, 48, 48, 20)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 5 — Story 9:16 — Familiares emocional (headline v4)
# =============================================================================
def copy5():
    w, h = 1080, 1920
    bg = f"file://{BGS}/bg_copy5_familiares_story.png"
    extra = """
      .photo { width: 1080px; height: 1250px; background-image: url('""" + bg + """'); background-position: center 30%; }
      .photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 40%, rgba(18,22,12,0) 40%, rgba(18,22,12,0.5) 100%), linear-gradient(to bottom, rgba(18,22,12,0) 65%, rgba(18,22,12,1) 100%); }
      .scanlines { width: 1080px; height: 1250px; }

      .box-formando { top: 340px; left: 220px; width: 300px; height: 360px; }
      .conf-formando { top: 343px; left: 220px; }
      .label-formando { position: absolute; top: 725px; left: 220px; background: #96C200; color: #12160C; font-family: 'Inter'; font-weight: 900; font-size: 24px; letter-spacing: 3px; padding: 10px 18px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }

      .box-mae { top: 400px; left: 560px; width: 300px; height: 340px; }
      .conf-mae { top: 403px; left: 560px; }
      .label-mae { position: absolute; top: 765px; left: 560px; background: #96C200; color: #12160C; font-family: 'Inter'; font-weight: 900; font-size: 24px; letter-spacing: 3px; padding: 10px 18px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
    """
    body = f"""
      <div class="photo"></div>
      <div class="scanlines"></div>

      <div class="face-box box-formando"></div>
      <div class="conf conf-formando">MATCH</div>
      <div class="label-formando">Formando</div>

      <div class="face-box box-mae"></div>
      <div class="conf conf-mae">MATCH</div>
      <div class="label-mae">Mãe</div>

      <div class="headline-wrap" style="left: 80px; right: 80px; top: 1200px;">
        <div class="badge-topo" style="font-size: 22px; margin-bottom: 18px;">Cloud PhotoRF 2.0</div>
        <div class="headline" style="font-size: 96px; line-height: 1.1;">
          "Cadê a foto<br>
          com minha mãe?"<br>
          <span class="accent">Já está separada.</span>
        </div>
      </div>
      {footer_html(w, 80, 56, 22)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 6 — Story 9:16 — Privacidade + NUVEM CORTADA (remonte)
# =============================================================================
def copy6():
    w, h = 1080, 1920
    bg = f"file://{BGS}/bg_copy6_privacidade.png"
    extra = """
      .photo { width: 1080px; height: 1250px; background-image: url('""" + bg + """'); background-position: center 30%; }
      .photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 40%, rgba(18,22,12,0) 40%, rgba(18,22,12,0.5) 100%), linear-gradient(to bottom, rgba(18,22,12,0) 65%, rgba(18,22,12,1) 100%); }
      .scanlines { width: 1080px; height: 1250px; }

      /* Escudo/cadeado + nuvem cortada, agora lado a lado */
      .shield-wrap { position: absolute; top: 380px; right: 60px; z-index: 4; }
      .shield { width: 240px; height: 260px; background: rgba(18,22,12,0.9); border: 3px solid #96C200; box-shadow: 0 0 40px rgba(150,194,0,0.5); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; position: relative; }
      .shield::before, .shield::after { content: ''; position: absolute; width: 26px; height: 26px; border: 4px solid #C9E866; }
      .shield::before { top: -6px; left: -6px; border-right: none; border-bottom: none; }
      .shield::after { bottom: -6px; right: -6px; border-left: none; border-top: none; }
      .lock-svg { width: 90px; height: 90px; margin-bottom: 14px; }
      .shield-lbl { font-family: 'Inter'; font-weight: 900; font-size: 18px; color: #96C200; letter-spacing: 3px; text-transform: uppercase; text-align: center; line-height: 1.2; }

      /* Icone nuvem cortada abaixo do escudo */
      .cloud-cut { position: absolute; top: 665px; right: 60px; width: 240px; padding: 14px; background: rgba(18,22,12,0.85); border-left: 3px solid #96C200; z-index: 4; display: flex; align-items: center; gap: 12px; }
      .cloud-svg { width: 56px; height: 56px; flex-shrink: 0; }
      .cloud-txt { font-family: 'Inter'; font-weight: 700; font-size: 14px; color: #FFFFFF; letter-spacing: 2px; text-transform: uppercase; line-height: 1.2; }
      .cloud-txt .highlight { color: #96C200; }

      /* Badge "no seu HD" */
      .hd-badge { position: absolute; top: 780px; right: 60px; background: #96C200; color: #12160C; font-family: 'Inter'; font-weight: 900; font-size: 20px; letter-spacing: 2px; padding: 12px 20px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
    """
    body = f"""
      <div class="photo"></div>
      <div class="scanlines"></div>

      <div class="shield-wrap">
        <div class="shield">
          <svg class="lock-svg" viewBox="0 0 24 24" fill="none" stroke="#96C200" stroke-width="2">
            <rect x="4" y="10" width="16" height="11" rx="2" fill="rgba(150,194,0,0.15)"/>
            <path d="M8 10V7a4 4 0 0 1 8 0v3"/>
            <circle cx="12" cy="15" r="1.5" fill="#96C200"/>
            <line x1="12" y1="16" x2="12" y2="18" stroke-width="2"/>
          </svg>
          <div class="shield-lbl">Modo<br>Local</div>
        </div>
      </div>

      <div class="cloud-cut">
        <svg class="cloud-svg" viewBox="0 0 64 64" fill="none" stroke="#96C200" stroke-width="2.5" stroke-linecap="round">
          <path d="M18 40a10 10 0 0 1 1-19 12 12 0 0 1 23 3 8 8 0 0 1 4 15z" fill="rgba(150,194,0,0.1)"/>
          <line x1="12" y1="12" x2="52" y2="52" stroke-width="4"/>
        </svg>
        <div class="cloud-txt">Sem envio<br><span class="highlight">pra nuvem</span></div>
      </div>

      <div class="hd-badge">No seu HD</div>

      <div class="headline-wrap" style="left: 80px; right: 80px; top: 1250px;">
        <div class="badge-topo" style="font-size: 22px; margin-bottom: 18px;">Cloud PhotoRF 2.0</div>
        <div class="headline" style="font-size: 92px; line-height: 1.1;">
          Suas fotos ficam<br>
          <span class="accent">no seu computador.</span>
        </div>
      </div>
      {footer_html(w, 80, 56, 22)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 7 — Story 9:16 — Vizinhanca sem rosto (headline v4)
# =============================================================================
def copy7():
    w, h = 1080, 1920
    bg = f"file://{BGS}/bg_copy7_vizinhanca_story.png"
    extra = """
      .photo { width: 1080px; height: 1250px; background-image: url('""" + bg + """'); background-position: center 30%; }
      .photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 40%, rgba(18,22,12,0) 40%, rgba(18,22,12,0.5) 100%), linear-gradient(to bottom, rgba(18,22,12,0) 65%, rgba(18,22,12,1) 100%); }
      .scanlines { width: 1080px; height: 1250px; }

      .box-perfil { top: 260px; left: 340px; width: 380px; height: 440px; }
      .conf-perfil { top: 263px; left: 340px; }
      .label-perfil { position: absolute; top: 720px; left: 340px; background: #96C200; color: #12160C; font-family: 'Inter'; font-weight: 900; font-size: 22px; letter-spacing: 2.5px; padding: 10px 18px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }

      .neighbor-panel { position: absolute; right: 60px; top: 300px; background: rgba(18,22,12,0.85); border-left: 3px solid #96C200; padding: 22px; z-index: 4; }
      .neighbor-title { font-family: 'Inter'; font-weight: 700; font-size: 13px; letter-spacing: 3px; color: #96C200; text-transform: uppercase; margin-bottom: 14px; text-align: center; }
      .neighbor-grid { width: 120px; height: 120px; position: relative; margin: 0 auto; }
      .neighbor-dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; }
      .neighbor-dot.center { top: 50%; left: 50%; transform: translate(-50%, -50%); background: #96C200; box-shadow: 0 0 16px #96C200; width: 22px; height: 22px; }
      .neighbor-dot.n1 { top: 5px; left: 5px; background: rgba(150,194,0,0.4); }
      .neighbor-dot.n2 { top: 5px; right: 5px; background: rgba(150,194,0,0.4); }
      .neighbor-dot.n3 { bottom: 5px; left: 5px; background: rgba(150,194,0,0.4); }
      .neighbor-dot.n4 { bottom: 5px; right: 5px; background: rgba(150,194,0,0.4); }
      .neighbor-lbl { font-family: 'Inter'; font-weight: 700; font-size: 12px; color: #FFFFFF; text-align: center; letter-spacing: 2px; margin-top: 10px; text-transform: uppercase; }
    """
    body = f"""
      <div class="photo"></div>
      <div class="scanlines"></div>

      <div class="face-box box-perfil"></div>
      <div class="conf conf-perfil">MATCH</div>
      <div class="label-perfil">Por vizinhança</div>

      <div class="neighbor-panel">
        <div class="neighbor-title">Contexto</div>
        <div class="neighbor-grid">
          <div class="neighbor-dot n1"></div>
          <div class="neighbor-dot n2"></div>
          <div class="neighbor-dot center"></div>
          <div class="neighbor-dot n3"></div>
          <div class="neighbor-dot n4"></div>
        </div>
        <div class="neighbor-lbl">alocado</div>
      </div>

      <div class="headline-wrap" style="left: 80px; right: 80px; top: 1250px;">
        <div class="badge-topo" style="font-size: 22px; margin-bottom: 18px;">Cloud PhotoRF 2.0</div>
        <div class="headline" style="font-size: 88px; line-height: 1.1;">
          Sem rosto visível.<br>
          <span class="accent">E alocou certo<br>assim mesmo.</span>
        </div>
      </div>
      {footer_html(w, 80, 56, 22)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 8 — Reels 4:5 — Familia (headline v4)
# =============================================================================
def copy8():
    w, h = 1080, 1350
    bg = f"file://{BGS}/bg_copy8_familiares_reels.png"
    extra = """
      .photo { width: 1080px; height: 850px; background-image: url('""" + bg + """'); background-position: center 30%; }
      .photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 40%, rgba(18,22,12,0) 40%, rgba(18,22,12,0.5) 100%), linear-gradient(to bottom, rgba(18,22,12,0) 60%, rgba(18,22,12,1) 100%); }
      .scanlines { width: 1080px; height: 850px; }

      .box-pai      { top: 180px; left: 110px; width: 210px; height: 240px; }
      .box-formando { top: 150px; left: 380px; width: 220px; height: 270px; }
      .box-mae      { top: 190px; left: 660px; width: 200px; height: 230px; }
      .box-irma     { top: 400px; left: 690px; width: 180px; height: 200px; }

      .conf-pai      { top: 183px; left: 110px; }
      .conf-formando { top: 153px; left: 380px; }
      .conf-mae      { top: 193px; left: 660px; }
      .conf-irma     { top: 403px; left: 690px; }

      .lbl { position: absolute; background: #96C200; color: #12160C; font-family: 'Inter'; font-weight: 900; font-size: 18px; letter-spacing: 2px; padding: 7px 12px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
      .lbl-pai      { top: 440px; left: 110px; }
      .lbl-formando { top: 440px; left: 380px; }
      .lbl-mae      { top: 440px; left: 660px; }
      .lbl-irma     { top: 620px; left: 690px; }
    """
    body = f"""
      <div class="photo"></div>
      <div class="scanlines"></div>

      <div class="face-box box-pai"></div>      <div class="conf conf-pai">MATCH</div>      <div class="lbl lbl-pai">Pai</div>
      <div class="face-box box-formando"></div> <div class="conf conf-formando">MATCH</div> <div class="lbl lbl-formando">Formando</div>
      <div class="face-box box-mae"></div>      <div class="conf conf-mae">MATCH</div>      <div class="lbl lbl-mae">Mãe</div>
      <div class="face-box box-irma"></div>     <div class="conf conf-irma">MATCH</div>     <div class="lbl lbl-irma">Irmã</div>

      <div class="headline-wrap" style="left: 80px; right: 80px; top: 830px;">
        <div class="badge-topo" style="font-size: 20px; margin-bottom: 16px;">Cloud PhotoRF 2.0</div>
        <div class="headline" style="font-size: 78px; line-height: 1.1;">
          Família toda separada.<br>
          <span class="accent">Sistema sugere.<br>Você confirma.</span>
        </div>
      </div>
      {footer_html(w, 55, 50, 20)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 9 — Reels 4:5 — Fila reels (headline v4: "deixa a maquina trabalhando")
# =============================================================================
def copy9():
    w, h = 1080, 1350
    bg = f"file://{BGS}/bg_copy9_fila_reels.png"
    extra = """
      .photo { width: 1080px; height: 850px; background-image: url('""" + bg + """'); background-position: center 35%; }
      .photo::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at center 40%, rgba(18,22,12,0) 40%, rgba(18,22,12,0.5) 100%), linear-gradient(to bottom, rgba(18,22,12,0) 60%, rgba(18,22,12,1) 100%); }
      .scanlines { width: 1080px; height: 850px; }

      .queue-panel { position: absolute; top: 130px; right: 55px; width: 320px; background: rgba(18,22,12,0.88); border: 2px solid #96C200; padding: 22px 24px; z-index: 4; box-shadow: 0 0 30px rgba(150,194,0,0.35); }
      .queue-title { font-family: 'Inter'; font-weight: 700; font-size: 13px; letter-spacing: 3px; color: #96C200; text-transform: uppercase; margin-bottom: 16px; }
      .queue-item { display: flex; flex-direction: column; margin-bottom: 14px; }
      .queue-item:last-child { margin-bottom: 0; }
      .queue-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
      .queue-name { font-family: 'Inter'; font-weight: 700; font-size: 16px; color: #FFFFFF; letter-spacing: 0.5px; }
      .queue-status { font-family: 'Inter'; font-weight: 900; font-size: 11px; letter-spacing: 2px; color: #96C200; text-transform: uppercase; }
      .queue-status.done { color: #C9E866; }
      .bar { height: 6px; background: rgba(150,194,0,0.15); position: relative; }
      .bar-fill { position: absolute; top: 0; left: 0; height: 100%; background: #96C200; box-shadow: 0 0 8px rgba(150,194,0,0.6); }

      .active-badge { position: absolute; top: 500px; right: 55px; background: #96C200; color: #12160C; font-family: 'Inter'; font-weight: 900; font-size: 16px; letter-spacing: 2px; padding: 10px 18px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,0.5); display: flex; align-items: center; gap: 10px; }
      .active-badge::before { content: ''; width: 10px; height: 10px; background: #12160C; border-radius: 50%; box-shadow: 0 0 8px #12160C; }
    """
    body = f"""
      <div class="photo"></div>
      <div class="scanlines"></div>

      <div class="queue-panel">
        <div class="queue-title">Sistema ativo</div>
        <div class="queue-item">
          <div class="queue-row"><span class="queue-name">Casamento</span><span class="queue-status done">Pronto</span></div>
          <div class="bar"><div class="bar-fill" style="width: 100%;"></div></div>
        </div>
        <div class="queue-item">
          <div class="queue-row"><span class="queue-name">Formatura</span><span class="queue-status">Em carga</span></div>
          <div class="bar"><div class="bar-fill" style="width: 55%;"></div></div>
        </div>
        <div class="queue-item">
          <div class="queue-row"><span class="queue-name">Empresa</span><span class="queue-status">Fila</span></div>
          <div class="bar"><div class="bar-fill" style="width: 12%;"></div></div>
        </div>
      </div>
      <div class="active-badge">Trabalhando</div>

      <div class="headline-wrap" style="left: 80px; right: 80px; top: 850px;">
        <div class="badge-topo" style="font-size: 20px; margin-bottom: 16px;">Cloud PhotoRF 2.0</div>
        <div class="headline" style="font-size: 78px; line-height: 1.1;">
          Processando<br>
          <span class="accent">enquanto você<br>não está aqui.</span>
        </div>
      </div>
      {footer_html(w, 55, 50, 20)}
    """
    return html_shell(w, h, extra, body)


HTMLS = [
    ('copy2_v2.html',  copy2()),
    ('copy4_v2.html',  copy4()),
    ('copy5_v2.html',  copy5()),
    ('copy6_v2.html',  copy6()),
    ('copy7_v2.html',  copy7()),
    ('copy8_v2.html',  copy8()),
    ('copy9_v2.html',  copy9()),
]

if __name__ == '__main__':
    for fname, content in HTMLS:
        out = BASE / fname
        out.write_text(content, encoding='utf-8')
        print(f'OK: {out} ({len(content)} chars)')
