/* Cadastro de pacientes · estilos do formulário (complementa style.css) */

[hidden] { display: none !important; }

.pagina-pacientes { background: var(--fundo-suave); }
.container.estreito { max-width: 40rem; }
.centro { text-align: center; }
.texto-suave { color: var(--texto-suave); }

/* Boas-vindas */
.boas-vindas { padding: 2.5rem 0 3.5rem; text-align: center; }
.logo-grande { width: min(100%, 300px); height: auto; margin: 0 auto 1.25rem; }
.boas-vindas h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); margin-top: 1.75rem; }
.boas-vindas .destaque { font-size: 1.125rem; color: var(--texto); max-width: 34rem; margin-inline: auto; }
.boas-vindas .selo { margin-bottom: 1.25rem; }
.aviso {
  text-align: left; background: #FFF8E6; border: 1px solid #F3DFA3; border-radius: var(--raio);
  padding: 1rem 1.25rem; margin: 1.5rem 0 1rem; color: #6B4E00;
}
.aviso strong { display: block; margin-bottom: 0.25rem; }
.aviso p { margin: 0; }
.tempo { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--texto-suave); font-size: 0.9375rem; margin: 0.5rem 0 1.5rem; }
.tempo svg { width: 18px; height: 18px; }
.botao-largo { display: block; width: 100%; text-align: center; padding: 1rem 1.5rem; font-size: 1.0625rem; }
.nota-lgpd { font-size: 0.8125rem; color: var(--rosa); margin-top: 1rem; }
.rodape-simples { padding: 1.5rem 0; text-align: center; font-size: 0.8125rem; }
.rodape-simples .container { display: block; }
.rodape-simples p { margin: 0 auto; max-width: 40rem; }

/* Cabeçalho da ficha com barra de progresso */
.cabecalho-form .container { display: block; padding: 0.75rem 0 0.875rem; min-height: 0; }
.linha-topo { display: flex; align-items: center; justify-content: space-between; }
.voltar { display: inline-flex; align-items: center; gap: 0.375rem; text-decoration: none; font-size: 0.9375rem; color: var(--texto-suave); }
.voltar svg { width: 18px; height: 18px; }
.linha-topo img { width: 48px; height: 40px; object-fit: contain; }
.progresso { margin-top: 0.5rem; }
.progresso-texto { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--azul); }
.progresso-texto span { color: var(--texto-suave); }
.barra { height: 8px; background: var(--borda); border-radius: 999px; overflow: hidden; margin-top: 0.375rem; }
.barra-preenchida { height: 100%; background: var(--rosa); transition: width 0.3s ease; }

/* Cartão e campos */
main { padding: 1.5rem 0 7rem; }
.cartao { background: var(--branco); border: 1px solid var(--borda); border-radius: 14px; padding: 1.5rem; }
@media (min-width: 600px) { .cartao { padding: 2rem; } }
fieldset.etapa { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 1.25rem; }
legend h2 { font-size: 1.375rem; margin-bottom: 0.25rem; }
legend .sub { color: var(--texto-suave); font-size: 0.9375rem; margin: 0; }

.campo { margin-bottom: 1.125rem; }
.campo label, .rotulo-grupo { display: block; font-weight: 600; font-size: 0.9375rem; margin-bottom: 0.375rem; }
.obrig { color: var(--rosa); }
.campo input[type="text"], .campo input[type="tel"], .campo input[type="email"], .campo select, .campo textarea {
  width: 100%; font: inherit; color: var(--texto); background: var(--branco);
  border: 1px solid #C9CCDD; border-radius: 8px; padding: 0.7rem 0.875rem; min-height: 2.9rem;
}
.campo textarea { resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: 2px solid var(--azul); outline-offset: 0; border-color: var(--azul); }
.campo.invalido input, .campo.invalido select, .campo.invalido textarea { border-color: #C62828; }
.dica { font-size: 0.8125rem; color: var(--texto-suave); margin: 0.375rem 0 0; }
.erro { font-size: 0.8125rem; color: #C62828; margin: 0.375rem 0 0; font-weight: 500; }
.erro:empty { display: none; }

.opcoes { display: grid; gap: 0.5rem; }
.opcao {
  display: flex; align-items: center; gap: 0.75rem; border: 1px solid #C9CCDD; border-radius: 8px;
  padding: 0.75rem 0.875rem; cursor: pointer; font-weight: 400 !important; margin: 0 !important;
}
.opcao:has(:checked) { border-color: var(--azul); background: var(--azul-claro); }
.opcao input { accent-color: var(--azul); width: 1.125rem; height: 1.125rem; margin: 0; }

.bloco-condicional { background: var(--azul-claro); border: 1px solid #D5D9F2; border-radius: 10px; padding: 1rem; margin-top: 1rem; }
.bloco-condicional .campo:last-child { margin-bottom: 0; }
.marcar { display: flex !important; align-items: flex-start; gap: 0.625rem; font-weight: 400 !important; margin-top: 0.5rem; cursor: pointer; line-height: 1.4; }
.marcar input { accent-color: var(--azul); width: 1.125rem; height: 1.125rem; margin: 0.15rem 0 0; flex: none; }
.marcar-destaque { font-weight: 600 !important; font-size: 1rem; border: 1px solid #C9CCDD; border-radius: 8px; padding: 0.875rem; }
.marcar-destaque:has(:checked) { border-color: var(--azul); background: var(--azul-claro); }

/* Arquivos */
.campo-arquivo input[type="file"] { width: 100%; font: inherit; font-size: 0.9375rem; }
.campo-arquivo input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; color: var(--azul); background: var(--azul-claro);
  border: 1px solid #D5D9F2; border-radius: 999px; padding: 0.5rem 0.875rem; margin-right: 0.75rem; cursor: pointer;
}
.arquivos { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.375rem; }
.arquivos li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; background: var(--fundo-suave); border-radius: 6px; padding: 0.375rem 0.625rem; }
.arquivos li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arquivos li small { color: var(--texto-suave); }
.arquivos button { font: inherit; font-size: 0.8125rem; color: #C62828; background: none; border: 0; cursor: pointer; padding: 0.125rem 0.25rem; }

/* Termo e resumo */
.termo { background: var(--fundo-suave); border: 1px solid var(--borda); border-radius: 10px; padding: 1rem 1.25rem; font-size: 0.9375rem; margin-bottom: 1rem; }
.termo p:last-child { margin: 0; }
.resumo { margin-top: 1.5rem; font-size: 0.9375rem; }
.resumo h3 { font-size: 1rem; margin: 1rem 0 0.375rem; }
.resumo dl { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0.25rem; }
.resumo dt { color: var(--texto-suave); font-size: 0.8125rem; }
.resumo dd { margin: 0 0 0.375rem; }
@media (min-width: 600px) { .resumo dl { grid-template-columns: 11rem 1fr; gap: 0.25rem 1rem; } .resumo dd { margin: 0; } }

/* Botões fixos no rodapé */
.rodape-fixo {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--branco);
  border-top: 1px solid var(--borda); padding: 0.75rem 0; padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}
.acoes { display: flex; gap: 0.75rem; }
.acoes .botao { flex: 1; text-align: center; padding: 0.9rem 1rem; cursor: pointer; font: inherit; font-weight: 600; }
.acoes .botao[disabled] { opacity: 0.6; cursor: wait; }

.erro-geral { background: #FDECEC; border: 1px solid #F3B4B4; color: #8A1C1C; border-radius: 10px; padding: 0.875rem 1rem; margin-bottom: 1rem; }
.isca { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Confirmação */
.check { width: 80px; height: 80px; border-radius: 50%; background: var(--rosa-claro); color: var(--rosa); display: grid; place-items: center; margin: 0 auto 1.5rem; }
.check svg { width: 44px; height: 44px; }
.protocolo { font-size: 1.125rem; }
.protocolo strong { font-family: var(--fonte-titulo); color: var(--azul); letter-spacing: 0.05em; }
