/* =============================================================
   style.css — o visual do AI Prioritizer Framework
   rosa pq não sou obrigada
   ============================================================= */

/* 1. CORES E MEDIDAS
   "Variáveis" do CSS: definidas uma vez, usadas no arquivo todo.
   Para mudar o tom de rosa do app inteiro, troque só --pink. */
:root {
  --pink: #e0337a;
  --pink-dark: #c2185b;
  --pink-light: #fde4ee;
  --bg: #f4f5f8;
  --card: #ffffff;
  --text: #1f2330;
  --muted: #8a8fa0;
  --border: #eceef3;
  --green: #0f7a4a;
  --green-light: #c8f5dd;
  --amber: #e08a00;
  --amber-light: #fbe7b0;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(31, 35, 48, 0.06);
}

/* 2. BASE: fundo, fonte e cor do texto da página */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* 3. BARRA DO TOPO com o nome do app */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}

.brand { display: flex; align-items: center; gap: 12px; max-width: 1100px; margin: 0 auto; }

.logo {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: white;
  display: grid; place-items: center;
  font-size: 20px;
}

.brand strong { display: block; font-size: 16px; }
.brand small { color: var(--pink); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; }

/* 4. LAYOUT EM DUAS COLUNAS: formulário à esquerda, score à direita */
.layout {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

/* 5. CARDS: as caixas brancas */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card h2 { font-size: 17px; margin: 0; }

.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* a etiqueta "Peso: 30% · Média: 3.8" vira uma pílula rosa */
.weight {
  background: var(--pink-light);
  color: var(--pink-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 6. IDENTIFICAÇÃO: o número "1" e os campos de texto */
.step {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; margin-right: 8px;
  border-radius: 8px;
  background: var(--pink-light); color: var(--pink-dark);
  font-size: 12px;
}

.field { display: block; margin-top: 16px; }

.field span {
  display: block; margin-bottom: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--muted); text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font: inherit; font-size: 14px;
  resize: vertical;
}

/* quando o campo está selecionado, a borda fica rosa */
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--pink);
  background: white;
  box-shadow: 0 0 0 3px var(--pink-light);
}

/* 7. CRITÉRIOS: título e nota em cima, botões e dica embaixo */
.criterion {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.criterion-title {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between;
  font-size: 14px; margin-bottom: 8px;
}

.value { color: var(--pink); font-weight: 800; }

.hint { color: var(--muted); font-size: 12px; font-style: italic; }

/* os botões 1 a 5 ficam juntos, como um seletor */
.scale {
  display: inline-flex;
  justify-self: start;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
}

.scale button {
  width: 34px; height: 34px;
  border: none; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.scale button:hover { background: var(--pink-light); color: var(--pink-dark); }

.scale button.active {
  background: var(--pink);
  color: white;
  box-shadow: 0 2px 8px rgba(224, 51, 122, 0.35);
}

/* 8. LIVE SCORE: a coluna da direita acompanha a rolagem (sticky) */
.side {
  position: sticky;
  top: 24px;
}

.live { text-align: center; }

.live small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.12em; }

.score { font-size: 56px; font-weight: 800; margin: 4px 0 12px; letter-spacing: -0.02em; }

.verdict {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* verde = candidato à execução / amarelo = backlog */
.score.go { color: var(--green); }
.verdict.go { background: var(--green-light); color: var(--green); }
.score.backlog { color: var(--amber); }
.verdict.backlog { background: var(--amber-light); color: #8a5a00; }

/* 9. CELULAR: em telas pequenas, vira uma coluna só
   e o score gruda no topo da tela */
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; margin-top: 16px; padding: 0 16px; }
  .side { order: -1; position: sticky; top: 0; z-index: 10; }
  .live { padding: 12px; margin-bottom: 12px; }
  .score { font-size: 36px; margin: 0 0 6px; }
  .criterion { grid-template-columns: 1fr; row-gap: 6px; }
}
/* =============================================================
   ETAPA 4: PÁGINA DE RESULTADOS
   ============================================================= */

/* garante que telas marcadas como "hidden" fiquem escondidas */
[hidden] { display: none !important; }

/* botão rosa "Ver resultados" */
.btn-primary {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--pink);
  color: white;
  font: inherit; font-weight: 700;
  cursor: pointer;
}
.btn-primary:hover { background: var(--pink-dark); }

/* área dos resultados */
.results { max-width: 1100px; margin: 32px auto; padding: 0 24px; }

.results-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.results-header h1 { font-size: 22px; margin: 0; }
.results-header small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }

/* duas colunas: radar | veredito */
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }

.results-title { text-align: center; text-transform: uppercase; letter-spacing: 0.1em; font-size: 14px; }

/* caixa da nota final */
.final-box {
  background: var(--bg);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0 20px;
  text-align: center;
}
.final-box .verdict { display: inline-block; }

/* barras por dimensão */
.bar-row { margin-bottom: 12px; }
.bar-label { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.bar-track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-fill.go { background: var(--green); }
.bar-fill.backlog { background: var(--amber); }

/* botão "← Voltar" */
.btn-back {
  display: block;
  margin: 8px auto 40px;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit; font-weight: 600;
  cursor: pointer;
}
.btn-back:hover { border-color: var(--pink); color: var(--pink); }

/* celular: resultados em uma coluna */
@media (max-width: 800px) {
  .results { padding: 0 16px; margin-top: 16px; }
  .results-grid { grid-template-columns: 1fr; }
}
/* =============================================================
   ETAPA 5: EXPORTAÇÕES
   ============================================================= */

/* botões pequenos: CSV, PDF e Copiar */
.export-buttons { display: flex; gap: 6px; }

.btn-small {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit; font-size: 11px; font-weight: 700;
  cursor: pointer;
}
.btn-small:hover { border-color: var(--pink); color: var(--pink); }

.btn-small.pink { background: var(--pink); border-color: var(--pink); color: white; }
.btn-small.pink:hover { background: var(--pink-dark); color: white; }

/* caixa escura do Jira, com cara de código */
.jira { background: #12141c; border-color: #12141c; color: white; margin-top: 4px; }
.jira h2 { color: white; font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; }

.jira pre {
  margin: 12px 0 0;
  padding: 16px;
  max-height: 260px;
  overflow: auto;
  background: #000;
  border-radius: 10px;
  color: #d6d8e0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* IMPRESSÃO / PDF: só o relatório, sem botões nem barra do topo */
@media print {
  body { background: white; }
  .topbar, .export-buttons, .btn-back, .jira { display: none !important; }
  .results { margin: 0; padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
  /* força as cores de fundo (barras, veredito) a aparecerem no PDF */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* =============================================================
   ETAPA 6: AI STRATEGIC ADVISOR
   ============================================================= */

/* card rosa do advisor */
.advisor {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  border: none;
  color: white;
}
.advisor h2 { color: white; }
.advisor-intro { font-size: 13px; opacity: 0.9; margin: 4px 0 0; }

/* botão branco (sobre fundo rosa) */
.btn-small.white { background: white; border-color: white; color: var(--pink-dark); }
.btn-small.white:hover { background: var(--pink-light); }
.btn-small:disabled { opacity: 0.5; cursor: not-allowed; }

/* caixa da chave de API */
.key-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 12px;
}
.key-box label { display: block; font-weight: 700; margin-bottom: 8px; }
.key-box a { color: white; }
.key-box small { display: block; margin-top: 8px; opacity: 0.9; }
.key-row { display: flex; gap: 8px; }
.key-row input {
  flex: 1;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  font: inherit;
}
#ai-key-saved { display: flex; justify-content: space-between; align-items: center; }
#ai-key-saved small { margin: 0; }

.link-button {
  background: none; border: none; padding: 0;
  color: white; text-decoration: underline;
  font: inherit; font-size: 12px; cursor: pointer;
}

.ai-error { margin: 12px 0 0; padding: 10px; border-radius: 8px; background: white; color: #b00020; font-size: 12px; }

/* o parecer */
.ai-output { border-top: 4px solid var(--pink); }
.ai-output h3 {
  margin: 16px 0 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--pink);
}
.ai-output p { margin: 0; font-size: 13px; line-height: 1.6; }

.ai-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

.risk-box { margin-top: 16px; padding: 14px; border-radius: 10px; background: var(--pink-light); }
.risk-box h3 { margin-top: 0; }

.exec-box { margin-top: 16px; padding: 18px; border-radius: 12px; background: #12141c; color: white; }
.exec-box h3 { margin-top: 0; }
.exec-box p { font-size: 15px; font-weight: 700; }

/* celular: parecer em uma coluna */
@media (max-width: 800px) {
  .ai-grid { grid-template-columns: 1fr; gap: 0; }
}

/* impressão: o PDF inclui o parecer, mas não o card da chave */
@media print {
  .advisor { display: none !important; }
  .ai-output { break-inside: avoid; }
}
