/* ====================================================================
   RenovaEco — Design system
   Paleta inspirada em energia solar + cooperativismo:
   verde-floresta (identidade), verde-folha (crescimento/positivo),
   dourado-sol (energia/destaque) sobre fundo claro e quente.
   ==================================================================== */

:root {
  /* Novos Design Tokens - Paleta PWA Mobile */
  --verde-900: #0B3D2E;
  --verde-700: #0F6E56;
  --verde-500: #1D9E75;
  --verde-200: #bcead5;
  --verde-100: #E1F5EE;

  --sol-600: #d97706;
  --sol-500: #f5a623;
  --sol-100: #fef3c7;

  --fundo: #F6F8F6;
  --branco: #FFFFFF;
  --texto-1: #1A1A18;
  --texto-2: #5F5E5A;
  --borda: #E4E4E0;
  
  --ambar-100: #FAEEDA;
  --ambar-800: #633806;
  --azul-100: #E6F1FB;
  --azul-800: #0C447C;
  --vermelho: #E24B4A;

  /* Mapeamento de variáveis antigas para compatibilidade */
  --bg: var(--fundo);
  --paper: rgba(255, 255, 255, 0.95);
  --paper-blur: blur(12px);
  --paper-borda: rgba(255, 255, 255, 0.6);
  --texto: var(--texto-1);
  --texto-suave: var(--texto-2);
  --erro: var(--vermelho);

  --fonte-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --fonte-corpo: "Inter", "Segoe UI", system-ui, sans-serif;

  --raio: 12px; /* Conforme especificação 3.3 (12px nos cards, 10px nos campos) */
  --raio-grande: 24px;
  --sombra: 0 10px 30px -10px rgba(15, 44, 34, 0.08);
  --sombra-hover: 0 20px 40px -15px rgba(15, 44, 34, 0.15);
  --gradiente-premium: linear-gradient(135deg, var(--verde-700), var(--verde-900));
  --gradiente-sol: linear-gradient(135deg, var(--sol-500), var(--sol-600));
}

/* Tema escuro do PWA. A classe e aplicada no elemento html pelo
   /admin/js/nav-badge.js e a preferencia fica salva no navegador. */
html.tema-escuro {
  color-scheme: dark;
  --verde-900: #0d544a;
  --verde-700: #27a887;
  --verde-500: #68d8b3;
  --verde-200: #1a4038;
  --verde-100: #142d28;
  --sol-600: #d99c31;
  --sol-500: #f4bd55;
  --sol-100: #342a17;
  --fundo: #0d1513;
  --branco: #15201d;
  --texto-1: #edf8f2;
  --texto-2: #afc1ba;
  --borda: #2c4a42;
  --ambar-100: #342a17;
  --ambar-800: #f3c66d;
  --azul-100: #112d3e;
  --azul-800: #9ad1f8;
  --vermelho: #ff827a;
  --paper: rgba(21, 32, 29, 0.98);
  --paper-borda: rgba(88, 139, 122, 0.36);
  --sombra: 0 12px 32px -14px rgba(0, 0, 0, 0.55);
  --sombra-hover: 0 20px 44px -16px rgba(0, 0, 0, 0.7);
}

@media (prefers-color-scheme: dark) {
  html.tema-sistema {
    color-scheme: dark;
    --verde-900: #0d544a;
    --verde-700: #27a887;
    --verde-500: #68d8b3;
    --verde-200: #1a4038;
    --verde-100: #142d28;
    --sol-600: #d99c31;
    --sol-500: #f4bd55;
    --sol-100: #342a17;
    --fundo: #0d1513;
    --branco: #15201d;
    --texto-1: #edf8f2;
    --texto-2: #afc1ba;
    --borda: #2c4a42;
    --ambar-100: #342a17;
    --ambar-800: #f3c66d;
    --azul-100: #112d3e;
    --azul-800: #9ad1f8;
    --vermelho: #ff827a;
    --paper: rgba(21, 32, 29, 0.98);
    --paper-borda: rgba(88, 139, 122, 0.36);
    --sombra: 0 12px 32px -14px rgba(0, 0, 0, 0.55);
    --sombra-hover: 0 20px 44px -16px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: var(--fonte-corpo);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--fonte-display);
  color: var(--verde-900);
  margin: 0;
  line-height: 1.2;
}

a { color: var(--verde-700); }

img.brasao-sol {
  display: block;
}

/* ---------- Layout geral ---------- */
.pagina {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: var(--verde-900);
  color: #fff;
}

.topo .logo-sol {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.topo .marca {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.topo .marca strong {
  font-family: var(--fonte-display);
  font-size: 17px;
  letter-spacing: 0.02em;
}

.topo .marca span {
  font-size: 12px;
  color: var(--verde-200);
}

.conteudo {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

#area-form,
#tela-sucesso {
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- Landing Split Layout ---------- */
.landing-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
  margin-top: 10px;
}

@media (min-width: 768px) {
  .landing-container {
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
    padding: 20px 0;
  }
}

.landing-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.landing-boasvindas {
  display: inline-block;
  align-self: flex-start;
  background: var(--verde-100);
  color: var(--verde-700);
  border: 1px solid var(--verde-200);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
}

.landing-info h1 {
  font-size: 34px;
  color: var(--verde-900);
  margin-bottom: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.landing-desc {
  font-size: 16px;
  color: var(--texto-suave);
  line-height: 1.6;
  margin-bottom: 32px;
}

.landing-benefits {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.benefit-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.benefit-icon {
  font-size: 20px;
  background: var(--verde-100);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--verde-700);
  border: 1px solid rgba(36, 130, 91, 0.15);
}

.benefit-item strong {
  display: block;
  font-size: 15px;
  color: var(--verde-900);
  margin-bottom: 2px;
}

.benefit-item p {
  margin: 0;
  font-size: 13px;
  color: var(--texto-suave);
  line-height: 1.5;
}

.landing-choice {
  display: flex;
  flex-direction: column;
}

/* ---------- Indicador de progresso (arco solar) ---------- */
.progresso {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px 0 26px;
}

.progresso .etapa {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: var(--verde-200);
  position: relative;
  overflow: hidden;
}

.progresso .etapa.feita,
.progresso .etapa.atual {
  background: linear-gradient(90deg, var(--verde-500), var(--sol-500));
}

.progresso-legenda {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--texto-suave);
  margin-bottom: 4px;
}

/* ---------- Cartões ---------- */
.cartao {
  background: var(--paper);
  backdrop-filter: var(--paper-blur);
  -webkit-backdrop-filter: var(--paper-blur);
  border: 1px solid var(--paper-borda);
  border-radius: var(--raio-grande);
  box-shadow: var(--sombra);
  padding: 24px;
  margin-bottom: 18px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.cartao:hover {
  transform: translateY(-2px);
  box-shadow: var(--sombra-hover);
}

.cartao h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.cartao .subtitulo {
  color: var(--texto-suave);
  font-size: 14px;
  margin-bottom: 18px;
}

/* ---------- Card de boas-vindas (escolha PF/PJ) — destacado com o
   gradiente da marca em vez do fundo branco padrão dos outros cards. ---------- */
.landing-choice .cartao {
  background: var(--gradiente-premium);
  border: none;
  box-shadow: 0 12px 32px rgba(15, 44, 34, 0.28);
}

.landing-choice .cartao h2 {
  color: #fff;
}

.landing-choice .cartao .subtitulo {
  color: var(--verde-200);
}

.landing-choice .opcoes-tipo-hint {
  color: var(--sol-100);
}

/* ---------- Seleção de tipo (PF/PJ) ---------- */
.opcoes-tipo {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .opcoes-tipo { grid-template-columns: 1fr 1fr; }
}

.opcao-tipo {
  border: 2px solid var(--borda);
  border-radius: var(--raio);
  padding: 20px;
  text-align: left;
  background: var(--paper);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.05s;
  font-family: var(--fonte-corpo);
}

.opcao-tipo:hover {
  border-color: var(--verde-500);
  box-shadow: 0 4px 16px rgba(47, 143, 106, 0.15);
}

.opcao-tipo:active { transform: scale(0.99); }

/* ---------- Destaque de CTA (PF/PJ) ---------- */
.opcao-tipo-cta {
  border-color: var(--verde-500);
  box-shadow: 0 6px 20px rgba(47, 143, 106, 0.18);
  animation: cta-pulso 2.2s ease-in-out infinite;
}

.opcao-tipo-cta:hover {
  border-color: var(--sol-500);
  box-shadow: 0 8px 26px rgba(245, 166, 35, 0.28);
  transform: translateY(-2px) scale(1.01);
  animation-play-state: paused;
}

.opcao-tipo-seta {
  font-size: 22px;
  font-weight: 700;
  color: var(--verde-500);
  flex-shrink: 0;
  transition: transform 0.15s, color 0.15s;
}

.opcao-tipo-cta:hover .opcao-tipo-seta {
  color: var(--sol-600);
  transform: translateX(4px);
}

.opcoes-tipo-hint {
  margin: 14px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--verde-700);
  text-align: center;
}

@keyframes cta-pulso {
  0%, 100% { box-shadow: 0 6px 20px rgba(47, 143, 106, 0.18); }
  50% { box-shadow: 0 6px 26px rgba(47, 143, 106, 0.38); }
}

.opcao-tipo .icone {
  font-size: 26px;
  margin-bottom: 8px;
  display: block;
}

.opcao-tipo strong {
  display: block;
  font-family: var(--fonte-display);
  font-size: 16px;
  color: var(--verde-900);
  margin-bottom: 4px;
}

.opcao-tipo span {
  font-size: 13px;
  color: var(--texto-suave);
}

/* ---------- Formulário ---------- */
.campo {
  margin-bottom: 16px;
}

.campo label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--verde-900);
  margin-bottom: 6px;
}

.campo .ajuda {
  font-size: 12px;
  color: var(--texto-suave);
  margin-top: 4px;
}

.campo-senha-wrapper {
  position: relative;
}

.campo-senha-wrapper input[type="password"],
.campo-senha-wrapper input[type="text"] {
  padding-right: 42px;
}

.btn-olhinho-senha {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--texto-suave);
}

.btn-olhinho-senha:hover {
  background: rgba(0, 0, 0, 0.05);
}

.campo input[type="text"],
.campo input[type="email"],
.campo input[type="tel"],
.campo input[type="date"],
.campo input[type="number"],
.campo input[type="password"],
.campo input[type="search"],
.campo select,
.campo textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: var(--fonte-corpo);
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  background: var(--bg);
  color: var(--texto);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

/* Evita que o autofill do navegador quebre o visual dos campos */
.campo input:-webkit-autofill {
  -webkit-text-fill-color: var(--texto);
  box-shadow: 0 0 0 1000px var(--bg) inset;
  border-radius: 10px;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  border-color: var(--verde-500);
  background: var(--paper);
}

.campo input.invalido,
.campo select.invalido {
  border-color: var(--erro);
}

.erro-campo {
  color: var(--erro);
  font-size: 12px;
  margin-top: 4px;
  display: none;
}

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

.cep-status {
  color: var(--muted, #6b7280);
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
}

.link-cep-correios {
  display: inline-block;
  font-size: 12px;
  margin-top: 4px;
  color: var(--verde-700, #0a7d32);
  text-decoration: underline;
}

.linha-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 14px;
}

@media (min-width: 480px) {
  .linha-2 { grid-template-columns: 1fr 1fr; }
  .linha-3 { grid-template-columns: 2fr 1fr 1fr; }
}

/* ---------- Upload de arquivos ---------- */
.upload-area {
  border: 2px dashed var(--borda);
  border-radius: var(--raio);
  padding: 18px;
  text-align: center;
  background: var(--verde-100);
  cursor: pointer;
  transition: border-color 0.15s;
}

.upload-area:hover { border-color: var(--verde-500); }

.upload-area .icone {
  font-size: 28px;
  display: block;
  margin-bottom: 6px;
}

.upload-area strong {
  color: var(--verde-900);
  font-size: 14px;
}

.upload-area span {
  display: block;
  font-size: 12px;
  color: var(--texto-suave);
  margin-top: 4px;
}

.lista-arquivos {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lista-arquivos li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--borda);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.lista-arquivos button {
  border: none;
  background: none;
  color: var(--erro);
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Botões ---------- */
.acoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.acoes .btn,
.acoes a.btn,
.acoes label.btn {
  flex: 1 1 140px;
}

.btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  font-family: var(--fonte-display);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primario {
  background: var(--gradiente-premium);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 44, 34, 0.25);
}

.btn-primario:hover {
  box-shadow: 0 6px 20px rgba(15, 44, 34, 0.35);
  transform: translateY(-1px);
}

.btn-secundario {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--verde-700);
  border: 1.5px solid var(--verde-500);
}

.btn-secundario:hover {
  background: var(--verde-100);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- Resumo (revisão) ---------- */
.resumo-grupo {
  margin-bottom: 14px;
}

.resumo-grupo h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--verde-500);
  margin-bottom: 8px;
}

.resumo-linha {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--borda);
  font-size: 14px;
}

.resumo-linha span:first-child {
  color: var(--texto-suave);
}

.resumo-linha span:last-child {
  text-align: right;
  font-weight: 600;
  word-break: break-word;
}

.consentimento {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--verde-100);
  border-radius: var(--raio);
  padding: 14px;
  font-size: 13px;
  color: var(--verde-900);
  margin-top: 12px;
}

.consentimento input { margin-top: 3px; }

/* ---------- Selo de seguranca/LGPD ---------- */
.selo-seguranca {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--texto-suave);
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.selo-seguranca-icone {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1.4;
}

/* ---------- Indicador de autosave ---------- */
.indicador-autosave {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--verde-700);
  margin: 4px 0 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.indicador-autosave.visivel { opacity: 1; }

.indicador-autosave-ponto {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--verde-500);
  flex-shrink: 0;
  animation: autosave-pulso 1.4s ease-in-out infinite;
}

@keyframes autosave-pulso {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

/* ---------- Tela de sucesso ---------- */
.sucesso {
  text-align: center;
  padding: 32px 24px;
}

.sucesso .icone-grande {
  font-size: 56px;
  margin-bottom: 12px;
}

.sucesso .protocolo {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--sol-100);
  color: var(--verde-900);
  font-family: var(--fonte-display);
  font-weight: 700;
  font-size: 15px;
}

.sucesso #link-boas-vindas {
  display: block;
  width: fit-content;
  margin: 18px auto 0;
}

/* ---------- Mensagens ---------- */
.alerta {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

.alerta-erro {
  background: #fbeae7;
  color: var(--erro);
  border: 1px solid #f0c4bd;
}

.alerta-info {
  background: var(--verde-100);
  color: var(--verde-900);
  border: 1px solid var(--verde-200);
}

/* ---------- Rodapé ---------- */
.rodape {
  text-align: center;
  font-size: 12px;
  color: var(--texto-suave);
  padding: 18px;
}

/* ---------- Linha do Tempo (Próximos Passos) ---------- */
.landing-timeline-section {
  margin-top: 56px;
  text-align: center;
}

.landing-timeline-section h2 {
  font-size: 24px;
  color: var(--verde-900);
  margin-bottom: 28px;
  font-family: var(--fonte-display);
}

.landing-timeline {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 640px) {
  .landing-timeline {
    grid-template-columns: repeat(4, 1fr);
  }
}

.timeline-card {
  background: var(--paper);
  backdrop-filter: var(--paper-blur);
  -webkit-backdrop-filter: var(--paper-blur);
  border: 1px solid var(--paper-borda);
  border-radius: var(--raio);
  padding: 24px 20px;
  text-align: left;
  position: relative;
  box-shadow: var(--sombra);
  transition: transform 0.3s ease;
}

.timeline-card:hover {
  transform: translateY(-2px);
}

.timeline-num {
  font-family: var(--fonte-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--sol-600);
  background: var(--sol-100);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.timeline-card strong {
  display: block;
  font-size: 15px;
  color: var(--verde-900);
  margin-bottom: 8px;
}

.timeline-card p {
  margin: 0;
  font-size: 13px;
  color: var(--texto-suave);
  line-height: 1.45;
}

/* ---------- FAQ (Perguntas Frequentes) ---------- */
.landing-faq-section {
  margin-top: 56px;
}

.landing-faq-section h2 {
  font-size: 24px;
  color: var(--verde-900);
  margin-bottom: 28px;
  text-align: center;
  font-family: var(--fonte-display);
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  background: var(--paper);
  backdrop-filter: var(--paper-blur);
  -webkit-backdrop-filter: var(--paper-blur);
  border: 1px solid var(--paper-borda);
  border-radius: var(--raio);
  padding: 18px 20px;
  box-shadow: var(--sombra);
  transition: all 0.3s ease;
}

.faq-item[open] {
  border-color: var(--verde-500);
}

.faq-item summary {
  font-family: var(--fonte-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--verde-900);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '▼';
  font-size: 10px;
  color: var(--verde-700);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after {
  transform: rotate(180deg);
}

.faq-content {
  margin-top: 14px;
  font-size: 14px;
  color: var(--texto-suave);
  line-height: 1.5;
  border-top: 1px solid rgba(0,0,0,0.06);
  padding-top: 14px;
}

/* ---------- Barra de Suporte no Rodapé ---------- */
.suporte-rodape {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--texto-suave);
  margin-top: 40px;
  flex-wrap: wrap;
}

.suporte-rodape a {
  color: var(--verde-700);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.suporte-rodape a:hover {
  text-decoration: underline;
}
