/* ================================================================
   checkout.css — Checkout Alves Converte
   Tema: fundo claro, paleta azul/roxo/teal da marca
   ================================================================ */

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #F5F7FA;
  --card:        #FFFFFF;
  --border:      #E8ECF0;
  --text:        #1A1A2E;
  --text-muted:  #64748B;
  --text-light:  #94A3B8;
  --shadow:      0 2px 16px rgba(0,0,0,0.07);
  --shadow-md:   0 4px 24px rgba(0,0,0,0.10);
  --radius:      16px;
  --radius-sm:   10px;
  --radius-btn:  10px;
  --transition:  0.2s ease;

  /* Cores dos planos — sobrescritas via CSS var inline por produto */
  --cor:          #2F6FFF;
  --cor-clara:    #EEF3FF;
  /* aliases tráfego pago */
  --bg-card:      #FFFFFF;
  --text-primary: #1A1A2E;
  --text-secondary: #64748B;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
}

/* ── Tipografia ─────────────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; }
a { color: var(--cor); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout Geral ──────────────────────────────────────────────── */
.checkout-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Barra Superior ────────────────────────────────────────────── */
.checkout-topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.checkout-topbar .logo {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.checkout-topbar .logo span {
  color: var(--cor);
}

.checkout-topbar .seguro-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.checkout-topbar .seguro-badge svg {
  color: #22C55E;
}

/* ── Wrapper Principal ─────────────────────────────────────────── */
.checkout-wrapper {
  flex: 1;
  max-width: 1060px;
  margin: 0 auto;
  padding: 32px 16px 64px;
  width: 100%;
}

/* ── Grid: Produto + Formulário ────────────────────────────────── */
.checkout-grid {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
  align-items: start;
}

/* ── Card genérico ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── Card do Produto (esquerda) ────────────────────────────────── */
.produto-card .produto-header {
  background: var(--cor);
  padding: 28px 28px 24px;
  color: #fff;
  position: relative;
}

.produto-card .produto-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 6px;
}

.produto-card .produto-nome {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 6px;
}

.produto-card .produto-subtitulo {
  font-size: 13px;
  opacity: 0.9;
}

.produto-card .produto-body {
  padding: 24px 28px;
}

/* Preço principal */
.preco-principal {
  margin-bottom: 20px;
}

.preco-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.preco-valor {
  font-size: 40px;
  font-weight: 800;
  color: var(--cor);
  letter-spacing: -1.5px;
  line-height: 1;
}

.preco-valor .preco-cifrao {
  font-size: 22px;
  font-weight: 700;
  vertical-align: super;
  line-height: 0;
  position: relative;
  top: -4px;
}

.preco-detalhe {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Badge economia */
.badge-economia {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #BBF7D0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 12px;
}

/* Alternativas de pagamento */
.preco-alternativa {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Entrega badge */
.entrega-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cor-clara);
  color: var(--cor);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Features */
.features-lista {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.features-lista li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text);
}

.features-lista li .check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: var(--cor-clara);
  color: var(--cor);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.features-lista li .check svg { width: 10px; height: 10px; }

/* Divider */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* Selos de garantia */
.garantia-selos {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.garantia-selo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.garantia-selo svg { color: #22C55E; width: 16px; height: 16px; }

/* ── Card do Formulário (direita) ──────────────────────────────── */
.form-card .form-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
}

.form-card .form-header h2 {
  font-size: 20px;
  color: var(--text);
}

.form-card .form-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-card .form-body {
  padding: 24px 28px 28px;
}

/* ── Seções do formulário ──────────────────────────────────────── */
.form-secao {
  margin-bottom: 24px;
}

.form-secao-titulo {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-secao-titulo::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Campos ────────────────────────────────────────────────────── */
.form-row {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

.field input {
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}

.field input:focus {
  border-color: var(--cor);
  box-shadow: 0 0 0 3px rgba(47,111,255,0.12);
}

.field input::placeholder { color: var(--text-light); }

.field input.erro { border-color: #EF4444; }
.field .mensagem-erro { font-size: 12px; color: #EF4444; margin-top: 2px; }

/* ── Seletor de parcelas ───────────────────────────────────────── */
.field select {
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  outline: none;
  transition: border-color var(--transition);
}

.field select:focus { border-color: var(--cor); }

/* ── Tabs PIX / Cartão ─────────────────────────────────────────── */
.tabs-pagamento {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
}

.tab-btn:hover { border-color: var(--cor); color: var(--cor); }

.tab-btn.ativo {
  border-color: var(--cor);
  background: var(--cor-clara);
  color: var(--cor);
}

.painel-pagamento { display: none; }
.painel-pagamento.ativo { display: block; }

/* Nota pagamento */
.nota-pagamento {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
}

/* ── Botão de Compra ───────────────────────────────────────────── */
.btn-comprar {
  width: 100%;
  height: 56px;
  background: var(--cor);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  transition: opacity var(--transition), transform var(--transition);
  letter-spacing: -0.3px;
}

.btn-comprar:hover { opacity: 0.92; transform: translateY(-1px); }
.btn-comprar:active { transform: translateY(0); }
.btn-comprar:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-comprar .spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

.btn-comprar.carregando .spinner { display: block; }
.btn-comprar.carregando .texto-btn { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Selos de pagamento seguro ─────────────────────────────────── */
.selos-pagamento {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.selo-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.selo-item svg { width: 14px; height: 14px; color: #22C55E; }

/* Bandeiras de cartão */
.bandeiras {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  opacity: 0.6;
}

.bandeiras img { height: 20px; }

/* ── Alerta de Erro ────────────────────────────────────────────── */
.alerta-erro {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: #991B1B;
  margin-top: 12px;
  display: none;
}

.alerta-erro.visivel { display: block; }

/* ── Página: Aguardando PIX ────────────────────────────────────── */
.pix-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  padding: 40px 16px;
}

.pix-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
}

.pix-card .pix-logo {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
}

.pix-card h2 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--text);
}

.pix-card .pix-instrucao {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.pix-qrcode {
  width: 200px;
  height: 200px;
  margin: 0 auto 24px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pix-qrcode img { width: 100%; height: 100%; object-fit: contain; }

.pix-valor {
  font-size: 32px;
  font-weight: 800;
  color: #10B981;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.pix-copiacola {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-all;
  text-align: left;
  margin-bottom: 12px;
}

.btn-copiar {
  width: 100%;
  height: 48px;
  background: #10B981;
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  transition: opacity var(--transition);
}

.btn-copiar:hover { opacity: 0.88; }

.pix-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.pix-status .pulsando {
  width: 10px; height: 10px;
  background: #F59E0B;
  border-radius: 50%;
  animation: pulsar 1.2s ease-in-out infinite;
}

@keyframes pulsar {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.pix-expirar {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 12px;
}

/* ── Página: Obrigado ──────────────────────────────────────────── */
.obrigado-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px 16px;
  text-align: center;
}

.obrigado-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 48px 40px;
  max-width: 520px;
  width: 100%;
}

.obrigado-icone {
  width: 72px; height: 72px;
  background: #DCFCE7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.obrigado-icone svg { width: 36px; height: 36px; color: #16A34A; }

.obrigado-card h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.obrigado-card p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-acessar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--cor);
  color: #fff;
  padding: 14px 32px;
  border-radius: var(--radius-btn);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: opacity var(--transition);
}

.btn-acessar:hover { opacity: 0.88; text-decoration: none; }

/* ── Footer ────────────────────────────────────────────────────── */
.checkout-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.checkout-footer a { color: var(--cor); }

/* ══════════════════════════════════════════════════════════════════
   CLASSES TRÁFEGO PAGO — aliases para o padrão checkout-template
   ════════════════════════════════════════════════════════════════ */

/* Card direito do checkout de tráfego */
.pagamento-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pagamento-header {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
}

.pagamento-titulo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.pagamento-subtitulo {
  font-size: 13px;
  color: var(--text-muted);
}

/* Formulário principal */
.form-principal {
  padding: 22px 28px 28px;
}

/* Grupo de campo */
.grupo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}

.grupo-duplo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label.label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

input.input-text {
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
  font-family: inherit;
}

input.input-text:focus {
  border-color: var(--cor);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cor) 15%, transparent);
}

input.input-text::placeholder { color: var(--text-light); }

/* Botão principal (PIX e Cartão) */
.btn-principal {
  width: 100%;
  height: 54px;
  background: var(--cor);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  margin-bottom: 14px;
  transition: opacity var(--transition), transform var(--transition);
  letter-spacing: -0.2px;
  font-family: inherit;
}

.btn-principal:hover { opacity: 0.91; transform: translateY(-1px); }
.btn-principal:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Selos de segurança */
.seguranca-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

/* Label de features (coluna esquerda) */
.features-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin: 16px 0 10px;
}

/* features-lista com check SVG inline (sem .check span) */
.features-lista li svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--cor);
}


@media (max-width: 560px) {
  .grupo-duplo { grid-template-columns: 1fr; }
  .form-principal { padding: 18px 20px 24px; }
  .pagamento-header { padding: 18px 20px 14px; }
}

/* ── Responsivo ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .checkout-grid {
    grid-template-columns: 1fr;
  }

  .checkout-wrapper {
    padding: 20px 12px 48px;
  }

  .produto-card .produto-header {
    padding: 22px 20px;
  }

  .produto-card .produto-body,
  .form-card .form-body {
    padding: 20px;
  }

  .produto-card .produto-nome {
    font-size: 30px;
  }

  .preco-valor {
    font-size: 34px;
  }

  .form-row.cols-2,
  .form-row.cols-3 {
    grid-template-columns: 1fr;
  }

  .pix-card, .obrigado-card {
    padding: 28px 20px;
  }
}

@media (max-width: 480px) {
  .checkout-topbar {
    padding: 0 16px;
  }

  .checkout-topbar .seguro-badge span {
    display: none;
  }
}
