/* Ficha de anamnese */
.topo .btn { white-space: nowrap; padding: 8px 14px; font-size: .85rem; }
.topo .marca span { white-space: nowrap; font-size: 1.5rem; }
.anamnese { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.ana-cabecalho { text-align: center; margin-bottom: 20px; }
.ana-cabecalho h1 { font-size: 2.8rem; color: var(--roxo-escuro); margin-bottom: 0; }
.ana-subtitulo { text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--roxo); font-size: .9rem; margin: 0 0 12px; }
.ana-cabecalho p:last-child { color: var(--texto-suave); margin: 0; }

.ana-bloco {
  border: 2px solid #ead7f0; border-radius: var(--raio); background: var(--branco);
  padding: 16px; margin: 0 0 16px; display: grid; gap: 14px; min-width: 0;
}
.ana-bloco legend {
  background: var(--lilas-claro); color: var(--roxo-escuro); font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; font-size: .85rem; padding: 6px 14px; border-radius: 999px;
}
.ana-campo { display: grid; gap: 6px; font-weight: 700; font-size: .95rem; min-width: 0; }
.ana-rotulo { font-weight: 700; }
.ana-campo input:not([type=radio]):not([type=checkbox]), .ana-campo select, .ana-campo textarea, .ana-bloco > div > input, .ana-pergunta input[type=text] {
  font: inherit; font-weight: 400; padding: 11px; border: 2px solid #e9d6ef; border-radius: 12px;
  background: var(--creme); width: 100%; min-width: 0; color: var(--texto);
}
.ana-campo input:focus, .ana-campo select:focus, .ana-campo textarea:focus, .ana-pergunta input:focus { outline: none; border-color: var(--roxo); }
.ana-campo input[readonly] { background: var(--lilas-claro); }
.ana-linha { display: grid; gap: 14px; }
.ana-opcoes { display: flex; flex-wrap: wrap; gap: 8px 18px; font-weight: 400; }
.ana-opcoes label, .ana-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.ana-opcoes input, .ana-check input { width: 20px; height: 20px; accent-color: var(--roxo); flex: none; }
.ana-opcoes-grade { display: grid; grid-template-columns: repeat(2, 1fr); }
.ana-check { align-items: flex-start; font-size: .95rem; }
.ana-check input { margin-top: 2px; }

.ana-pergunta { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px dashed #efe0f4; }
.ana-pergunta:last-child { border-bottom: 0; padding-bottom: 0; }
.ana-pergunta > span { font-weight: 700; }
.ana-pergunta input[type=text][hidden] { display: none; }
#perguntas-saude, #perguntas-habitos, #perguntas-especificas { display: grid; gap: 12px; }

.ana-declaracao p { margin: 0; color: var(--texto-suave); }
.ana-erro { background: #fde8ec; color: #9b1c3a; padding: 12px 16px; border-radius: 12px; font-weight: 700; }
.ana-acoes { display: grid; gap: 12px; margin: 8px 0 12px; }
.ana-resultado { text-align: center; }
.ana-resultado h2 { font-size: 2.2rem; margin: 0; }
.ana-resultado p { margin: 0; color: var(--texto-suave); }
.ana-resultado img { width: 100%; border-radius: 12px; border: 2px solid #ead7f0; }
.ana-resultado #res-editar { justify-self: center; }
.ana-resultado[hidden], #form-anamnese[hidden] { display: none; }
.invalido { border-color: #d6456b !important; }

@media (min-width: 640px) {
  .ana-linha { grid-template-columns: 1fr 1fr; }
  .ana-opcoes-grade { grid-template-columns: repeat(3, 1fr); }
  .ana-acoes { grid-template-columns: 1fr 1fr; }
  .ana-bloco { padding: 20px 24px; }
}

@media print {
  .topo, .ana-acoes, .rodape, .pix-aviso, .ana-erro { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .anamnese { padding: 0; max-width: none; }
  .ana-bloco { break-inside: avoid; border-color: #ccc; padding: 10px 14px; gap: 8px; }
  .ana-campo input, .ana-campo select, .ana-campo textarea { background: #fff !important; border: 0 !important; border-bottom: 1px solid #999 !important; border-radius: 0 !important; padding: 4px 0 !important; }
}
