* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primaria: #0f766e;
  --primaria-escura: #115e59;
  --fundo: #f8fafc;
  --cartao: #ffffff;
  --texto: #1e293b;
  --texto-suave: #64748b;
  --borda: #e2e8f0;
  --erro: #dc2626;
  --sucesso: #16a34a;
  --raio: 12px;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 560px; margin: 0 auto; padding: 20px 16px 60px; }

.cabecalho { text-align: center; margin-bottom: 20px; }
.cabecalho h1 { font-size: 1.5rem; color: var(--primaria-escura); margin-bottom: 8px; }
.cabecalho p { color: var(--texto-suave); font-size: 0.95rem; }

.aviso-modelo {
  background: #ecfeff; border: 1px solid #a5f3fc; color: #155e75;
  border-radius: var(--raio); padding: 10px 14px; font-size: 0.9rem;
  margin-bottom: 16px; display: flex; align-items: center; gap: 10px;
}
.aviso-modelo.erro { background: #fef2f2; border-color: #fecaca; color: var(--erro); }
.aviso-modelo[hidden] { display: none; }

.spinner {
  width: 16px; height: 16px; flex: none;
  border: 2px solid #a5f3fc; border-top-color: #155e75;
  border-radius: 50%; animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.bloco {
  background: var(--cartao); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 18px 16px; margin-bottom: 16px;
}
.bloco h2 { font-size: 1.05rem; margin-bottom: 12px; color: var(--primaria-escura); }

label { display: block; font-size: 0.88rem; font-weight: 600; margin: 12px 0 4px; }
input[type="text"] {
  width: 100%; padding: 12px; font-size: 1rem;
  border: 1px solid var(--borda); border-radius: 8px; background: #fff;
}
input[type="text"]:focus { outline: 2px solid var(--primaria); border-color: transparent; }

.aviso-nome {
  margin-top: 6px; font-size: 0.82rem; color: #b45309;
  background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 8px; padding: 8px 10px;
}

.dica-geral { font-size: 0.88rem; color: var(--texto-suave); margin-bottom: 12px; }

.cartao-vista {
  border: 1px solid var(--borda); border-radius: var(--raio);
  padding: 12px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.cartao-vista.aprovada { border-color: var(--sucesso); background: #f0fdf4; }
.cartao-vista.reprovada { border-color: var(--erro); background: #fef2f2; }

.miniatura {
  width: 64px; height: 84px; flex: none; border-radius: 8px;
  background: var(--fundo); border: 1px dashed var(--borda);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 1.6rem; color: var(--texto-suave);
}
.miniatura img { width: 100%; height: 100%; object-fit: cover; }

.info-vista { flex: 1; min-width: 0; }
.info-vista .titulo { font-weight: 700; font-size: 0.95rem; }
.info-vista .estado { font-size: 0.82rem; color: var(--texto-suave); margin-top: 2px; }
.cartao-vista.aprovada .estado { color: var(--sucesso); font-weight: 600; }
.cartao-vista.reprovada .estado { color: var(--erro); font-weight: 600; }

.btn-foto {
  flex: none; padding: 10px 14px; font-size: 0.9rem; font-weight: 600;
  color: var(--primaria); background: #fff;
  border: 1.5px solid var(--primaria); border-radius: 8px; cursor: pointer;
}
.btn-foto:disabled { opacity: 0.5; cursor: default; }

.btn-principal {
  width: 100%; padding: 15px; font-size: 1.05rem; font-weight: 700;
  color: #fff; background: var(--primaria); border: none;
  border-radius: var(--raio); cursor: pointer;
}
.btn-principal:disabled { background: #94a3b8; cursor: default; }
.btn-principal:not(:disabled):active { background: var(--primaria-escura); }

.msg-envio { margin-top: 12px; text-align: center; font-size: 0.92rem; }
.msg-envio.erro { color: var(--erro); }

.tela-sucesso {
  position: fixed; inset: 0; background: var(--fundo); z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; gap: 12px;
}
.tela-sucesso[hidden] { display: none; }
.tela-sucesso .check {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--sucesso); color: #fff; font-size: 2.4rem;
  display: flex; align-items: center; justify-content: center;
}

.modal-fundo {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-fundo[hidden] { display: none; }

.modal {
  background: #fff; border-radius: var(--raio); padding: 20px 16px;
  max-width: 480px; width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal h3 { color: var(--erro); font-size: 1.15rem; margin-bottom: 10px; }

#modal-problemas { margin: 0 0 14px 20px; font-size: 0.92rem; }
#modal-problemas li { margin-bottom: 4px; }

.modal-exemplo {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--fundo); border: 1px solid var(--borda);
  border-radius: var(--raio); padding: 12px; margin-bottom: 16px;
}
.modal-exemplo img {
  width: 120px; flex: none; border-radius: 8px; border: 1px solid var(--borda);
  background: #fff;
}
.modal-exemplo-titulo { font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
#modal-dicas { margin-left: 18px; font-size: 0.85rem; color: var(--texto); }
#modal-dicas li { margin-bottom: 4px; }
