:root {
  --azul: #2563eb;
  --azul-escuro: #1e3a8a;
  --bg: #f4f6fb;
  --bolha-bot: #ffffff;
  --bolha-user: #2563eb;
  --texto: #1f2937;
  --borda: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--texto);
}

/* ---------- CONVERSA ---------- */
.chat-view {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 760px;
  margin: 0 auto;
}

.topbar {
  background: var(--azul-escuro);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.topbar .logo { font-weight: 700; font-size: 1.1rem; }
.topbar small { opacity: 0.8; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 80%;
  padding: 12px 15px;
  border-radius: 16px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.bot {
  background: var(--bolha-bot);
  border: 1px solid var(--borda);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}
.msg.user {
  background: var(--bolha-user);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.msg.typing { color: #9ca3af; font-style: italic; }

.composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--borda);
  background: #fff;
}
.composer input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--borda);
  border-radius: 24px;
  font-size: 1rem;
  outline: none;
}
.composer input:focus { border-color: var(--azul); }
.composer button {
  background: var(--azul);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 0 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.composer button:disabled { opacity: 0.5; cursor: default; }

/* ---------- RELATÓRIO ---------- */
.report-view {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 60px;
}

.report-card {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 28px;
  text-align: justify;
}
.report-card h1 {
  color: var(--azul-escuro);
  font-size: 1.5rem;
  margin: 0 0 4px;
  text-align: center;
}
.report-card .sub { text-align: center; color: #6b7280; margin: 0 0 20px; }
.report-card h2 {
  color: var(--azul);
  font-size: 1.05rem;
  border-bottom: 2px solid var(--bg);
  padding-bottom: 4px;
  margin: 22px 0 8px;
}
.report-card ul { margin: 6px 0; padding-left: 20px; }
.report-card li { margin: 4px 0; }
.carreira {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 8px 0;
}
.carreira strong { color: var(--azul-escuro); }
.carreira .passo { font-size: 0.9rem; color: #4b5563; margin-top: 4px; }

.acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  justify-content: center;
}
.acoes button {
  border: none;
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-pdf { background: var(--azul); color: #fff; }
.btn-imagem { background: #f59e0b; color: #fff; }

/* Fase 2: "Me ver nessa profissão" */
.fotos-box {
  margin-top: 20px;
  background: #fff7ed;
  border: 1px dashed #f59e0b;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}
.fotos-box strong { color: #b45309; }
.foto-label {
  display: block;
  margin: 10px auto 0;
  font-size: 0.95rem;
  text-align: left;
  max-width: 420px;
}
.foto-label input { margin-top: 4px; display: block; width: 100%; }
.consent {
  display: block;
  margin: 14px auto 0;
  max-width: 420px;
  text-align: left;
  font-size: 0.9rem;
  color: #4b5563;
}

.btn-ver {
  margin-top: 10px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-ver:disabled { opacity: 0.6; cursor: default; }

.cenarios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.cenarios:empty { display: none; }
@media (max-width: 560px) {
  .cenarios { grid-template-columns: 1fr; }
}
.cenario { margin: 0; }
.cenario img {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.cenario figcaption {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
  text-align: center;
}
.cenario .gerando {
  background: #fff;
  border: 1px dashed var(--borda);
  border-radius: 10px;
  padding: 24px 12px;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
}
.cenario .gerando.erro { color: #b91c1c; }

/* Impressão: só o relatório (com as ilustrações) sai no PDF */
@media print {
  .chat-view, .acoes, .fotos-box, .btn-ver { display: none !important; }
  .report-view { padding: 0; }
  .report-card { border: none; padding: 0; }
  .cenario { break-inside: avoid; }
}
