* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  background: #f5f5f3;
  color: #222;
  line-height: 1.5;
}
.topo {
  background: #1f6f3a;
  color: #fff;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { font-size: 20px; font-weight: 600; }
.sair-form { margin: 0; }
.btn-link {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 16px;
  cursor: pointer;
}
.container {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
}
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  padding: 32px;
}
.centralizado { text-align: center; }
h1 { font-size: 28px; margin: 0 0 12px; }

/* ---- Banner "planilha pronta" no topo da tela inicial ---- */
.banner-pronta {
  background: #e6f5ec;
  border: 1px solid #b6dcc4;
  border-radius: 12px;
  padding: 16px 22px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.banner-texto {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.banner-texto strong { color: #1f6f3a; font-size: 17px; }
.banner-acoes {
  display: flex;
  gap: 10px;
  align-items: center;
}
.banner-acoes .botao { padding: 10px 18px; font-size: 16px; }
.banner-descartar { margin: 0; }

/* ---- Login ---- */
.login-card {
  max-width: 420px;
  margin: 56px auto 0;
  padding: 40px 36px;
  text-align: center;
}
.login-card h1 { margin-bottom: 8px; }
.login-card .ajuda { margin: 0 0 8px; font-size: 16px; }
.form-login {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 28px;
  text-align: left;
}
.campo-bloco {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.botao-largo {
  width: 100%;
  padding: 16px 24px;
  font-size: 18px;
}

/* ---- Modo destaque: ANP ---- */
.modo-destaque {
  background: linear-gradient(180deg, #ffffff 0%, #f4faf6 100%);
  border: 2px solid #1f6f3a;
  position: relative;
  margin-top: 20px;
}
.modo-destaque .form-anp { margin-top: 18px; }
.numero-destaque {
  background: #f2c94c;
  color: #6b4f00;
  font-size: 24px;
}
.badge-recomendado {
  display: inline-block;
  background: #f2c94c;
  color: #6b4f00;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 10px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.estado-fixo {
  background: #fff;
  border: 1px solid #d8d8d4;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 12px;
}
.estado-fixo-titulo {
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.estado-fixo-valor {
  font-size: 22px;
  font-weight: 700;
  color: #1f6f3a;
}
.estado-fixo-nota {
  font-size: 14px;
  color: #777;
  margin-top: 6px;
}

.estimativa {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 18px 12px;
  background: #f4faf6;
  border: 1px dashed #b6dcc4;
  border-radius: 10px;
  margin: 14px 0;
}
.estimativa-bloco {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
}
.estimativa-num {
  font-size: 32px;
  font-weight: 700;
  color: #1f6f3a;
  line-height: 1;
}
.estimativa-label {
  font-size: 14px;
  color: #555;
  margin-top: 4px;
}
.estimativa-separador {
  font-size: 28px;
  color: #aaa;
  font-weight: 300;
}
.aviso-tempo {
  background: #fff8e1;
  border-left: 4px solid #f2c94c;
  padding: 12px 16px;
  border-radius: 6px;
  margin: 14px 0 4px;
  font-size: 16px;
  line-height: 1.5;
}
.aviso-tempo strong { color: #6b4f00; }
.botao-grande-destaque {
  font-size: 19px;
  padding: 18px 28px;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(31, 111, 58, 0.25);
}
.separador-modos {
  display: flex;
  align-items: center;
  margin: 28px 0 8px;
  color: #888;
  font-size: 15px;
}
.separador-modos::before,
.separador-modos::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #d8d8d4;
}
.separador-modos span {
  padding: 0 14px;
}

/* ---- Tela inicial com 2 modos ---- */
.modos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 20px;
}
@media (max-width: 880px) {
  .modos { grid-template-columns: 1fr; }
}
.modo { display: flex; flex-direction: column; }
.modo-titulo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.modo-titulo h2 {
  margin: 0;
  font-size: 22px;
}
.modo-titulo .numero {
  flex: 0 0 36px;
  height: 36px;
  width: 36px;
  font-size: 18px;
}
.form-modo {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 14px;
  flex: 1;
}
.form-modo .botao-largo { margin-top: auto; }
.textarea-cnpjs {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 16px;
  min-height: 180px;
  resize: vertical;
}
.rodape-ajuda { text-align: center; margin-top: 18px; }

/* ---- Configurações avançadas (details/summary) ---- */
.config-avancada {
  background: #f7f7f4;
  border: 1px solid #e2e2dd;
  border-radius: 8px;
  padding: 0;
}
.config-avancada > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.config-avancada > summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
  color: #888;
}
.config-avancada[open] > summary::before { transform: rotate(90deg); }
.config-avancada > summary::-webkit-details-marker { display: none; }
.config-avancada[open] {
  padding-bottom: 14px;
}
.config-avancada .campo-bloco {
  margin: 12px 16px 0;
}

/* ---- Rodapé com botão de ajuda ---- */
.ajuda-rodape {
  text-align: center;
  margin-top: 24px;
  padding: 0 16px;
}
.botao-ajuda {
  font-size: 17px;
  padding: 12px 22px;
  margin-bottom: 10px;
}

/* ---- Modal de ajuda ---- */
.modal-ajuda {
  border: none;
  border-radius: 12px;
  padding: 32px 36px 28px;
  max-width: 640px;
  width: 92vw;
  box-shadow: 0 12px 48px rgba(0,0,0,.25);
  font-size: 17px;
  line-height: 1.55;
  color: #222;
}
.modal-ajuda::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
.modal-ajuda h2 {
  font-size: 22px;
  margin: 22px 0 10px;
  color: #1f6f3a;
}
.modal-ajuda h2:first-of-type { margin-top: 4px; }
.modal-fechar-form {
  position: absolute;
  top: 12px;
  right: 16px;
  margin: 0;
}
.modal-fechar {
  background: transparent;
  border: none;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  color: #888;
  padding: 4px 10px;
  border-radius: 8px;
}
.modal-fechar:hover { background: #f0f0ec; color: #222; }
.ajuda-lista {
  padding-left: 22px;
  margin: 0 0 12px;
}
.ajuda-lista li { margin-bottom: 8px; }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  margin-right: 4px;
}
.tag-quente      { background: #fde2e2; color: #a01a1a; }
.tag-quente-logo { background: #ffe1c4; color: #a04612; }
.tag-morno       { background: #fff2cc; color: #8a6d10; }
.tag-frio        { background: #dbeafe; color: #1e3a8a; }
.tag-sem         { background: #ececec; color: #555; }
.ajuda { color: #555; }
.ajuda-pequena { color: #777; font-size: 15px; margin-top: 8px; }
.rotulo { display: block; font-weight: 600; margin: 14px 0 6px; }
.campo, .campo-arquivo {
  width: 100%;
  padding: 12px 14px;
  font-size: 18px;
  border: 2px solid #cfcfcf;
  border-radius: 8px;
  background: #fafafa;
}
.campo:focus, .campo-arquivo:focus { outline: none; border-color: #1f6f3a; }
.botao {
  display: inline-block;
  padding: 14px 24px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.botao-verde { background: #1f6f3a; color: #fff; }
.botao-verde:hover { background: #174d2a; }
.botao-secundario { background: #eaeaea; color: #333; }
.botao-grande {
  font-size: 22px;
  padding: 18px 32px;
  width: 100%;
  max-width: 360px;
  margin: 12px auto;
  display: block;
}
.passo {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 0;
  border-top: 1px solid #eee;
}
.passo:first-of-type { border-top: none; }
.numero {
  flex: 0 0 40px;
  height: 40px;
  width: 40px;
  border-radius: 50%;
  background: #1f6f3a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
}
.conteudo { flex: 1; }
.msg {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 16px;
}
.msg.erro { background: #fde8e8; color: #8c1c1c; }
.msg.ok { background: #e6f5ec; color: #1f6f3a; }
.barra-fora {
  width: 100%;
  height: 28px;
  background: #e6e6e6;
  border-radius: 14px;
  overflow: hidden;
  margin: 18px 0 12px;
}
.barra-dentro {
  height: 100%;
  background: linear-gradient(90deg, #2c8a4a, #1f6f3a);
  transition: width .4s ease;
}
.msg-progresso { font-size: 20px; font-weight: 600; margin: 6px 0; }
.rodape {
  text-align: center;
  padding: 24px;
  color: #888;
  font-size: 14px;
}
