/* ── RESET & BASE (padrão visual AJ3) ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:     rgba(239, 5, 5, 1);
  --primary-dk:  rgba(200, 0, 0, 1);
  --primary-lt:  #fee2e2;
  --bg:          #f1f5f9;
  --card:        #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --muted:       #64748b;
  --red:         #ef4444;
  --red-lt:      #fee2e2;
  --red-dk:      #b91c1c;
  --yellow:      #f59e0b;
  --yellow-lt:   #fef3c7;
  --yellow-dk:   #92400e;
  --green:       #10b981;
  --green-lt:    #d1fae5;
  --green-dk:    #065f46;
  --radius:      10px;
  --shadow:      0 1px 6px rgba(0,0,0,.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,.12);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg) url('../image/bg-body.jpg') repeat;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ── SPLASH DE ABERTURA ── */
#splash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 999;
  transition: opacity .5s ease;
}
#splash.saindo { opacity: 0; pointer-events: none; }

#splash img {
  width: 200px;
  max-width: 60vw;
  animation: splashLogo .9s cubic-bezier(.34, 1.56, .64, 1) both,
             splashPulse 1.6s ease-in-out 1s infinite;
}

@keyframes splashLogo {
  from { opacity: 0; transform: scale(.5) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(.96); opacity: .85; }
}

.splash-barra {
  width: 150px;
  height: 4px;
  background: var(--primary-lt);
  border-radius: 99px;
  overflow: hidden;
  animation: splashLogo .9s ease both;
}
.splash-barra div {
  height: 100%;
  width: 0;
  background: var(--primary);
  border-radius: 99px;
  animation: splashCarrega 1.7s ease .3s forwards;
}
@keyframes splashCarrega { to { width: 100%; } }

.wrapper {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1rem 3.25rem;
}

.card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 1.4rem 1.35rem 1.6rem;
  width: 100%;
  max-width: 460px;
  animation: popIn .35s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}

.logo-topo { text-align: center; margin-bottom: .75rem; }
.logo-topo img { width: 110px; max-width: 100%; }

.progresso { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 1rem; }
.progresso-barra { height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .4s ease; }

/* ── PASSOS ── */
.passo { display: none; animation: fadeUp .3s ease both; }
.passo.ativo { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

h1 { font-size: 1.15rem; font-weight: 700; color: var(--text); margin-bottom: .35rem; }
p { color: var(--muted); font-size: .85rem; line-height: 1.5; margin-bottom: .5rem; }
p strong { color: var(--text); }
.centro { text-align: center; }
.dica { font-size: .82rem; }

.lista-itens { list-style: none; margin: .4rem 0 .9rem; }
.lista-itens li {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .6rem .85rem;
  margin-bottom: .5rem;
  line-height: 1.5;
  color: var(--muted);
  font-size: .88rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.lista-itens strong { color: var(--text); }
.lista-itens .item-icone { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--primary); }

.opcoes-doc { display: flex; flex-direction: column; gap: .65rem; margin: 1rem 0 .5rem; }
.opcao-doc {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem .9rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all .15s;
}
.opcao-doc:hover { border-color: var(--primary); background: var(--primary-lt); }
.opcao-doc > svg:first-child { width: 26px; height: 26px; color: var(--primary); flex-shrink: 0; }
.opcao-doc div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.opcao-doc strong { color: var(--text); font-size: .95rem; }
.opcao-doc span { color: var(--muted); font-size: .8rem; }
.opcao-seta { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }

.dica-icone { width: 14px; height: 14px; vertical-align: -2px; color: var(--yellow); }

/* ── FORMULÁRIO ── */
label { display: block; font-weight: 600; font-size: .85rem; color: var(--text); margin: .75rem 0 .3rem; }

input[type="text"], input[type="tel"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: #f8fafc;
  transition: border-color .2s, box-shadow .2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(239, 5, 5, .15);
  background: white;
}

#nome { text-transform: uppercase; }

#placa {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 700;
  text-align: center;
  font-size: 1.25rem;
}

.tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: .25rem; }
.tipo {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.tipo svg { width: 28px; height: 28px; color: var(--muted); transition: color .15s; }
.tipo.selecionado svg { color: var(--primary); }
.tipo span { font-size: .8rem; font-weight: 600; }
.tipo.selecionado {
  border-color: var(--primary);
  background: var(--primary-lt);
  box-shadow: 0 0 0 3px rgba(239, 5, 5, .12);
}

/* ── BOTÕES ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px;
  margin-top: .9rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:hover:not(:disabled) { background: var(--primary-dk); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

.btn.secundario { background: #f1f5f9; color: var(--muted); }
.btn.secundario:hover:not(:disabled) { background: var(--border); }

.btn.contorno {
  background: white;
  color: var(--text);
  border: 1.5px dashed var(--muted);
}
.btn.contorno:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }

.botoes { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

.erro {
  color: var(--red-dk);
  font-size: .85rem;
  font-weight: 600;
  min-height: 1.2em;
  margin-top: .75rem;
}
.erro:not(:empty) {
  background: var(--red-lt);
  border-radius: 6px;
  padding: .6rem .9rem;
}
.erro a { color: inherit; font-weight: 700; text-decoration: underline; }

/* ── PREVIEW / ANÁLISE ── */
.preview {
  margin-top: .75rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .65rem .8rem;
}
.preview img { width: 100%; border-radius: 8px; display: block; margin-top: .6rem; }
.preview .pdf-info { display: flex; align-items: center; gap: 10px; }
.preview .pdf-icone { display: flex; flex-shrink: 0; }
.preview .pdf-icone svg { width: 30px; height: 30px; color: var(--primary); }
.preview .pdf-dados { flex: 1; min-width: 0; }
.preview .pdf-nome { font-weight: 600; color: var(--text); word-break: break-all; font-size: .88rem; }
.preview .pdf-tam { font-size: .78rem; color: var(--muted); }
.preview-remover {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--red-lt);
  color: var(--red-dk);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s;
}
.preview-remover:hover { background: #fecaca; }
.preview-remover svg { width: 16px; height: 16px; }

.analise {
  margin-top: .6rem;
  border-radius: var(--radius);
  padding: .55rem .8rem;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.45;
}
.analise svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.analise.ok    { background: var(--green-lt);  color: var(--green-dk); }
.analise.ruim  { background: var(--red-lt);    color: var(--red-dk); }
.analise.aviso { background: var(--yellow-lt); color: var(--yellow-dk); }

/* ── RESUMO / CONFIRMAÇÃO ── */
.resumo {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .25rem 1rem;
  margin: .75rem 0;
}
.resumo .linha {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: .65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.resumo .linha:last-child { border-bottom: none; }
.resumo .rotulo { color: var(--muted); }
.resumo .valor { font-weight: 600; color: var(--text); text-align: right; word-break: break-word; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 1rem 0 .25rem; cursor: pointer; font-weight: 400; }
.check input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; accent-color: var(--primary); }
.check span { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.check strong { color: var(--text); }

/* ── SUCESSO ── */
.sucesso-icone {
  background: var(--green-lt);
  color: var(--green);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: .5rem auto 1rem;
}
.sucesso-icone svg { width: 32px; height: 32px; }

.protocolo {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .8rem;
  text-align: center;
  font-size: .85rem;
  word-break: break-all;
}
.protocolo strong { color: var(--text); }

/* ── RODAPÉ ── */
.rodape {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  color: #ffffff;
  font-size: .8rem;
  text-align: center;
  background: #000000;
  padding: .65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  z-index: 50;
}
.rodape-link { color: #ffffff; font-weight: 700; text-decoration: none; transition: opacity .2s; }
.rodape-link:hover { opacity: .75; }

.enviando { pointer-events: none; opacity: .6; }

@media (max-width: 600px) {
  .rodape { font-size: .62rem; padding: .4rem .5rem; white-space: nowrap; overflow: hidden; gap: 0; }
  .card { padding: 1.2rem 1.05rem 1.4rem; }
}

/* Telas baixas: compacta ainda mais para evitar rolagem */
@media (max-height: 700px) {
  .logo-topo img { width: 90px; }
  .logo-topo { margin-bottom: .5rem; }
  .progresso { margin-bottom: .75rem; }
  .preview img { max-height: 32vh; object-fit: contain; }
}
