#!/usr/bin/env python3
"""Gera 9 templates HTML - um por copy - baseados no piloto copy1.html aprovado.

Estrutura base identica: fundo #12160C + foto cinematografica dark + accent #96C200 +
badge Cloud PhotoRF 2.0 + rodape logo/lancamento 07/10. So varia:
- foto de fundo
- headline (2 linhas)
- overlays tematicos (caixas de reconhecimento, barras de fila, checkmarks, escudo)
- dimensoes (1:1, 9:16, 4:5)

Sem numero especifico em lugar nenhum. Acentuacao PT-BR correta.
"""
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'

# CSS base compartilhado (fontes, cores, badge/rodape padrao)
COMMON_CSS = """
  @font-face { font-family: 'Bebas Neue'; src: url('file:///home/mia/.fonts/px3lab/BebasNeue-Regular.ttf') format('truetype'); font-weight: 400; }
  @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; }

  /* Caixas de reconhecimento facial */
  .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 */
  .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; }

  /* Rodape */
  .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):
    """Wrapper HTML padrao."""
    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):
    """Rodape padrao logo + lancamento."""
    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
# Overlay: 3 barras de progresso empilhadas em #96C200
# =============================================================================
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; }

      /* Painel de fila de eventos — direita da foto */
      .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">Evento A</span><span class="queue-status done">OK</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">Evento B</span><span class="queue-status">Em curso</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">Evento C</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">Você nem precisa estar aqui.</span>
        </div>
      </div>
      {footer_html(w, 48, 48, 20)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 3 — Feed 1:1 — Triagem tripla | mulher parda jovem formanda
# Overlay: caixa de reconhecimento com 3 checkmarks concentricos
# =============================================================================
def copy3():
    w, h = 1080, 1080
    bg = f"file://{BGS}/bg_copy3_triagem.png"
    extra = """
      .photo { width: 1080px; height: 720px; background-image: url('""" + bg + """'); background-position: center 40%; }
      .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; }

      /* Caixa central sobre o rosto */
      .box-formanda { top: 130px; left: 380px; width: 320px; height: 380px; }

      /* 3 checkmarks laterais - camadas de verificacao */
      .check-panel { position: absolute; right: 60px; top: 180px; z-index: 4; display: flex; flex-direction: column; gap: 18px; }
      .check-item { display: flex; align-items: center; gap: 14px; background: rgba(18,22,12,0.85); border-left: 3px solid #96C200; padding: 12px 18px; }
      .check-num { font-family: 'Inter', sans-serif; font-weight: 900; font-size: 26px; color: #96C200; line-height: 1; }
      .check-icon { width: 36px; height: 36px; border: 3px solid #96C200; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 12px rgba(150,194,0,0.5); }
      .check-icon svg { width: 20px; height: 20px; }
      .check-lbl { font-family: 'Inter', sans-serif; font-weight: 700; font-size: 14px; letter-spacing: 2px; color: #FFFFFF; text-transform: uppercase; }

      .conf-formanda { top: 133px; left: 380px; }
      .label-formanda { position: absolute; top: 535px; left: 380px; background: #96C200; color: #12160C; font-family: 'Inter'; 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); }
    """
    body = f"""
      <div class="photo"></div>
      <div class="scanlines"></div>

      <div class="face-box box-formanda"></div>
      <div class="conf conf-formanda">MATCH</div>
      <div class="label-formanda">Formanda</div>

      <div class="check-panel">
        <div class="check-item">
          <span class="check-num">1</span>
          <div class="check-icon"><svg viewBox="0 0 24 24" fill="none" stroke="#96C200" stroke-width="3"><polyline points="4,12 10,18 20,6"/></svg></div>
          <span class="check-lbl">Camada 1</span>
        </div>
        <div class="check-item">
          <span class="check-num">2</span>
          <div class="check-icon"><svg viewBox="0 0 24 24" fill="none" stroke="#96C200" stroke-width="3"><polyline points="4,12 10,18 20,6"/></svg></div>
          <span class="check-lbl">Camada 2</span>
        </div>
        <div class="check-item">
          <span class="check-num">3</span>
          <div class="check-icon"><svg viewBox="0 0 24 24" fill="none" stroke="#96C200" stroke-width="3"><polyline points="4,12 10,18 20,6"/></svg></div>
          <span class="check-lbl">Camada 3</span>
        </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;">
          A IA não assume.<br>
          <span class="accent">Ela confirma três vezes.</span>
        </div>
      </div>
      {footer_html(w, 48, 48, 20)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 4 — Feed 1:1 — Vizinhanca | formando negro de costas
# Overlay: caixa de reconhecimento mesmo sem rosto + label "alocado por vizinhanca"
# =============================================================================
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; }

      /* Caixa sobre o formando de costas */
      .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); }

      /* Icone de posicao/coordenadas ao lado */
      .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 | familia asiatico-BR
# Overlay: 2 caixas de reconhecimento (formando + mae) em close abracados
# =============================================================================
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; }

      /* Formando - esquerda/centro */
      .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); }

      /* Mae - direita */
      .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 | fotografo branco jovem no PC
# Overlay: escudo/cadeado + label "seus arquivos, seu HD"
# =============================================================================
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 grande centralizado */
      .shield-wrap { position: absolute; top: 420px; right: 80px; z-index: 4; }
      .shield { width: 240px; height: 280px; 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; }

      /* Barra "seu HD" */
      .hd-badge { position: absolute; top: 740px; right: 80px; 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">100%<br>Local</div>
        </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<br>
          não saem do seu<br>
          <span class="accent">computador.</span>
        </div>
      </div>
      {footer_html(w, 80, 56, 22)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 7 — Story 9:16 — Vizinhanca | formanda branca de perfil
# Overlay: caixa de reconhecimento sobre perfil + label vizinhanca
# =============================================================================
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; }

      /* Caixa sobre a formanda de perfil */
      .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); }

      /* Icone de vizinhanca (pontos ao redor) - lateral direita */
      .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: 92px; line-height: 1.1;">
          Sem rosto na foto.<br>
          <span class="accent">Alocada certa<br>mesmo assim.</span>
        </div>
      </div>
      {footer_html(w, 80, 56, 22)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 8 — Reels caption 4:5 (1080x1350) — Familiares | familia mista 4 pessoas
# Overlay: 4 caixas de reconhecimento
# =============================================================================
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; }

      /* 4 caixas de reconhecimento - pai, formando, mae, irma */
      .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: 82px; line-height: 1.1;">
          Família toda separada.<br>
          <span class="accent">Sem garimpo.</span>
        </div>
      </div>
      {footer_html(w, 55, 50, 20)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 9 — Reels caption 4:5 — Fila desatendida | fotografa negra jovem
# Overlay: barras de fila menores + label "sistema segue"
# =============================================================================
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); }

      /* Badge "sistema segue" abaixo da queue */
      .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">Evento A</span><span class="queue-status done">OK</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">Evento B</span><span class="queue-status">Rodando</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">Evento C</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: 82px; line-height: 1.1;">
          Você sai.<br>
          <span class="accent">O sistema segue<br>trabalhando.</span>
        </div>
      </div>
      {footer_html(w, 55, 50, 20)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# COPY 10 — Reels caption 4:5 — Triagem | formando branco jovem
# Overlay: caixa de reconhecimento + 3 checkmarks verticais
# =============================================================================
def copy10():
    w, h = 1080, 1350
    bg = f"file://{BGS}/bg_copy10_triagem_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; }

      /* Caixa central */
      .box-formando { top: 130px; left: 340px; width: 340px; height: 400px; }
      .conf-formando { top: 133px; left: 340px; }
      .label-formando { position: absolute; top: 555px; left: 340px; background: #96C200; color: #12160C; font-family: 'Inter'; font-weight: 900; font-size: 22px; letter-spacing: 3px; padding: 10px 18px; text-transform: uppercase; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }

      /* 3 checkmarks laterais */
      .check-side { position: absolute; right: 55px; top: 180px; display: flex; flex-direction: column; gap: 20px; z-index: 4; }
      .check-round { width: 68px; height: 68px; border: 3px solid #96C200; border-radius: 50%; background: rgba(18,22,12,0.85); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 18px rgba(150,194,0,0.5); position: relative; }
      .check-round svg { width: 32px; height: 32px; }
      .check-round .step { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; background: #96C200; color: #12160C; border-radius: 50%; font-family: 'Inter'; font-weight: 900; font-size: 15px; display: flex; align-items: center; justify-content: center; }
    """
    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">Confirmado</div>

      <div class="check-side">
        <div class="check-round"><svg viewBox="0 0 24 24" fill="none" stroke="#96C200" stroke-width="3"><polyline points="4,12 10,18 20,6"/></svg><div class="step">1</div></div>
        <div class="check-round"><svg viewBox="0 0 24 24" fill="none" stroke="#96C200" stroke-width="3"><polyline points="4,12 10,18 20,6"/></svg><div class="step">2</div></div>
        <div class="check-round"><svg viewBox="0 0 24 24" fill="none" stroke="#96C200" stroke-width="3"><polyline points="4,12 10,18 20,6"/></svg><div class="step">3</div></div>
      </div>

      <div class="headline-wrap" style="left: 80px; right: 80px; top: 870px;">
        <div class="badge-topo" style="font-size: 20px; margin-bottom: 16px;">Cloud PhotoRF 2.0</div>
        <div class="headline" style="font-size: 84px; line-height: 1.1;">
          Sem foto na<br>
          <span class="accent">pasta errada.</span>
        </div>
      </div>
      {footer_html(w, 55, 50, 20)}
    """
    return html_shell(w, h, extra, body)


# =============================================================================
# MAIN — grava os 9 HTMLs
# =============================================================================
HTMLS = [
    ('copy2.html',  copy2()),
    ('copy3.html',  copy3()),
    ('copy4.html',  copy4()),
    ('copy5.html',  copy5()),
    ('copy6.html',  copy6()),
    ('copy7.html',  copy7()),
    ('copy8.html',  copy8()),
    ('copy9.html',  copy9()),
    ('copy10.html', copy10()),
]

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)')
