:root {
  --detail: #FB0001;
  --bg: #000000;
  --panel: #141414;
  --panel2: #1d1d1d;
  --text: #ffffff;
  --muted: #b8b8b8;
  --border: rgba(255,255,255,0.14);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, Segoe UI, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--detail); }
header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); background: #000000; }
.logo-wrap { background: #000000; padding: 6px 10px; border-radius: 12px; display: inline-block; line-height: 0; }
.logo-img { height: 44px; width: auto; max-width: 220px; display: block; }
.badge { display: inline-block; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--detail); color: var(--detail); font-size: 13px; font-weight: 700; }
main { max-width: 1080px; margin: 0 auto; padding: 22px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.card.glass { background: rgba(255,255,255,0.08); backdrop-filter: blur(16px); }
h2 { margin-top: 0; }
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input, textarea, select { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(0,0,0,0.35); color: var(--text); font-size: 15px; }
input[type="checkbox"] { width: auto; }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-top: 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }

/* Botão principal do app oficial Agora Lead, paleta oficial preto, branco e vermelho.
   Formato herdado do protótipo, cor oficial vermelha, nunca dourada, verde, laranja ou preta.
   Nunca usa a cor curada. Texto branco em caixa alta, pill, brilho e sombra vermelha. */
.btn-main {
  display: inline-block; width: 100%; text-align: center; cursor: pointer;
  background: linear-gradient(90deg, #a80000, #FB0001, #ff3333);
  color: #ffffff; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px;
  font-size: 16px; padding: 17px 24px; border-radius: 999px; border: 0;
  box-shadow: 0 10px 30px rgba(251,0,1,0.45), 0 0 0 1px rgba(255,255,255,0.25);
  position: relative; overflow: hidden; text-decoration: none;
}
.btn-main::before {
  content: ""; position: absolute; top: 0; left: -80px; width: 60px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-18deg); animation: btn-shine 3.2s ease-in-out infinite;
}
@keyframes btn-shine { 0% { left: -80px; } 55% { left: 110%; } 100% { left: 110%; } }
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 16px 40px rgba(251,0,1,0.6); }
.btn-main.small { width: auto; padding: 12px 22px; font-size: 14px; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 11px 18px; cursor: pointer; font-weight: 700; }
/* Botão PUBLICAR A AULA: ação real do formulário, propositalmente diferente
   dos botões da prévia e do botão da oferta. Fundo branco, texto preto,
   borda vermelha grossa, sem brilho, maior e em bloco próprio, para o
   produtor nunca confundir publicar com assistir ou com a oferta. */
.publish-action { margin-top: 20px; padding-top: 18px; border-top: 2px solid var(--detail); }
/* Seção final de compartilhamento, só após publicar com sucesso. */
.share-box { border: 2px solid var(--detail); background: rgba(251,0,1,0.08); }
.share-box h3 { margin-top: 0; }
.share-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share-link-btn { text-decoration: none; display: inline-block; }
.share-actions .btn-main.small { width: auto; }
.publish-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--detail); margin: 0 0 10px; }
.btn-publish { display: block; width: 100%; text-align: center; cursor: pointer; background: #ffffff; color: #000000; font-weight: 900; text-transform: uppercase; letter-spacing: 0.6px; font-size: 18px; padding: 20px 24px; border-radius: 14px; border: 3px solid var(--detail); box-shadow: none; }
/* Botões da prévia: só visualização, nunca ação real. Sem clique, sem
   elevação no hover, sem brilho. O de assistir é sólido; o da oferta é
   só contorno, para nunca parecerem dois botões principais iguais. */
.preview-label { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.preview-mock { cursor: default; }
.preview-mock::before { display: none; }
.preview-mock:hover { transform: none; box-shadow: 0 10px 30px rgba(251,0,1,0.45), 0 0 0 1px rgba(255,255,255,0.25); }
.btn-outline-preview { display: block; width: 100%; text-align: center; cursor: default; background: transparent; color: var(--detail); font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; font-size: 16px; padding: 15px 24px; border-radius: 999px; border: 2px solid var(--detail); }

/* Temas prontos, todos na paleta oficial: fundo preto, texto branco, vermelho de destaque.
   O tema Claro do protótipo foi adaptado para fundo preto, para não quebrar a paleta oficial.
   As variações são só de painel, vidro e tipografia, nunca de cor de destaque. */
.theme-preto-vidro { --bg: #000000; --panel: rgba(255,255,255,0.08); --panel2: rgba(255,255,255,0.12); }
.theme-claro { --bg: #000000; --panel: #1a1a1a; --panel2: #262626; --text: #ffffff; --muted: #b8b8b8; --border: rgba(255,255,255,0.14); }
.theme-vidro { --bg: #000000; --panel: rgba(255,255,255,0.07); --panel2: rgba(255,255,255,0.11); }
.theme-moderno { --bg: #000000; --panel: #171717; --panel2: #222222; }
.theme-moderno .card { border-radius: 12px; }
.theme-moderno h2 { text-transform: uppercase; font-weight: 900; }

/* Etapas do painel: indicador clicável, sem apagar o que foi digitado.
   Trocar de fase só mostra ou esconde seções, os campos ficam no DOM. */
.steps-nav { margin-bottom: 20px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 800px) { .steps-list { grid-template-columns: 1fr; } }
.step-btn { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; color: var(--text); cursor: pointer; font-weight: 700; font-size: 14px; }
.step-btn .step-num { display: inline-block; width: 32px; height: 32px; line-height: 32px; text-align: center; border-radius: 50%; background: var(--panel2); border: 1px solid var(--border); color: var(--text); font-weight: 900; flex-shrink: 0; }
.step-btn.step-current { border: 2px solid var(--detail); }
.step-btn.step-current .step-num { background: var(--detail); color: #ffffff; border-color: var(--detail); }
.step-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.step-actions .btn-main { width: auto; flex: 1 1 220px; }

.theme-picker, .color-picker, .offer-picker { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.theme-picker button, .color-picker button, .offer-picker button { border: 1px solid var(--border); background: var(--panel2); color: var(--text); padding: 10px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; }
.theme-picker button[aria-pressed="true"], .color-picker button[aria-pressed="true"], .offer-picker button[aria-pressed="true"] { border-color: var(--detail); box-shadow: 0 0 0 2px var(--detail); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.preview-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: #222; display: block; }
/* Capa sem imagem: painel preto 16:9 com título e subtítulo, como capa
   intencional, nunca imagem quebrada e nunca texto interno de aviso
   dentro da área que o visitante vai ver. Fica preto em todos os temas. */
.title-cover { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: #000000; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px; overflow: hidden; }
.title-cover h2, .title-cover h3 { margin: 0; color: #ffffff; font-size: clamp(20px, 3vw, 32px); line-height: 1.2; }
.title-cover p { margin: 0; color: #d0d0d0; font-size: 15px; line-height: 1.4; }
body.theme-claro .preview-card .title-cover h3, body.theme-claro .preview-card .title-cover p { color: #ffffff; }
body.theme-claro .preview-card .title-cover p { color: #d0d0d0; }
/* Placeholder da capinha quando não há capinha válida: nunca mostra imagem quebrada.
   Painel preto, logo Agora Lead e texto em cinza neutro, na paleta preto, branco e vermelho. */
.cover-placeholder { width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; background: #000000; border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 14px; }
.cover-placeholder .logo-img { height: 56px; max-width: 240px; }
.funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 800px) { .funnel { grid-template-columns: 1fr 1fr; } }
.metric { background: var(--panel2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.metric b { display: block; font-size: 28px; }
.metric span { color: var(--muted); font-size: 13px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.empty { color: var(--muted); padding: 16px 0; }
.video-wrap { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.video-wrap iframe { width: 100%; height: 100%; border: 0; }
.video-wrap video { width: 100%; height: 100%; display: block; background: #000; }
/* Captura pré aula em popup flutuante centralizado, com fundo escurecido.
   Sem botão de fechar: o conteúdo da aula fica bloqueado até a captura concluir. */
.capture-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.88); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; overflow: auto; }
.capture-overlay .card { width: 100%; max-width: 520px; margin: 0; max-height: 90vh; overflow: auto; }
body.capture-locked { overflow: hidden; }
.custom-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.custom-controls label { margin: 0; font-weight: 700; }
.custom-controls select { width: auto; }
.progress-bar { height: 8px; background: var(--panel2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress-fill { height: 100%; width: 0%; background: var(--detail); }
/* Prévia ao vivo: reflete de verdade o tema e a cor de detalhe escolhidos.
   O botão principal sólido continua sempre vermelho; a cor de detalhe
   aparece na borda do card da prévia, no selo e no botão da oferta em contorno. */
.preview-card { border: 2px solid var(--detail); }
.preview-card .preview-seal { border-color: var(--detail); color: var(--detail); }
body.theme-preto-vidro .preview-card { background: rgba(255,255,255,0.08); backdrop-filter: blur(16px); border-radius: 16px; }
body.theme-claro .preview-card { background: #ffffff; color: #000000; border-radius: 16px; }
body.theme-claro .preview-card h3, body.theme-claro .preview-card p { color: #000000; }
body.theme-claro .preview-card .note, body.theme-claro .preview-card .preview-label { color: #444444; }
body.theme-vidro .preview-card { background: rgba(255,255,255,0.03); backdrop-filter: blur(24px); border-radius: 20px; }
body.theme-moderno .preview-card { border-radius: 4px; }
body.theme-moderno .preview-card h3 { text-transform: uppercase; font-weight: 900; letter-spacing: 0.5px; }
/* Indicador de etapas do painel: 3 fases, sem formulário único longo.
   A fase ativa fica marcada com borda vermelha, como tema e cor. */
.step-indicator { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.step-indicator button { flex: 1; min-width: 150px; border: 1px solid var(--border); background: var(--panel2); color: var(--text); padding: 12px 14px; border-radius: 12px; cursor: pointer; font-weight: 800; text-align: left; }
.step-indicator button span { font-weight: 400; color: var(--muted); }
.step-indicator button[aria-pressed="true"] { border-color: var(--detail); box-shadow: 0 0 0 2px var(--detail); }
/* Layout do painel no PC: formulário das fases e prévia lado a lado.
   Ponto de quebra: a partir de 901 px de largura, duas colunas,
   formulário flexível e prévia de 400 px, fixa no topo da coluna
   enquanto a pessoa rola o formulário. Até 900 px, empilhado,
   formulário primeiro e prévia abaixo, como já era, pois não cabe
   lado a lado. Conta do produtor e relatório ficam fora deste
   layout, em largura total, antes e depois dele. */
.panel-layout { display: block; }
.panel-form { min-width: 0; }
.panel-preview-col { min-width: 0; }
@media (min-width: 901px) {
  main:has(.panel-layout) { max-width: 1240px; }
  .panel-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
  .panel-layout:has(#previewSection.hidden) { grid-template-columns: minmax(0, 1fr); }
  .panel-preview-col { align-self: stretch; }
  .panel-preview-col .preview-card { position: sticky; top: 20px; }
}
.hidden { display: none !important; }
.note { color: var(--muted); font-size: 14px; }
