/* Raio-X RE9 — identidade visual RE9 TI
   Navy #0E2A5E · Verde-limão #A4CE4E · Azul claro de apoio #8FA3D4 */
:root {
  --navy: #0E2A5E;
  --navy-700: #0a2048;
  --navy-300: #3a5aa0;
  --lime: #A4CE4E;
  --lime-600: #8bb734;
  --blue-soft: #8FA3D4;
  --ink: #16233f;
  --muted: #5b6b86;
  --bg: #eef1f7;
  --card: #ffffff;
  --line: #dde3ee;
  --danger: #c0392b;
  --danger-bg: #fdecea;
  --ok: #2e7d32;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(14, 42, 94, 0.12);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: radial-gradient(1200px 800px at 50% -10%, #f7f9fc 0%, var(--bg) 60%);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
}

.screen {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Topbar / marca */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px;
}
.brand-logo { height: 46px; width: auto; display: block; }
.topbar-title {
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .3px;
  font-size: 15px;
  opacity: .9;
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 26px;
  border: 1px solid var(--line);
}

.screen-title {
  font-size: 26px;
  line-height: 1.2;
  margin: 0 0 8px;
  color: var(--navy);
}
.screen-support { font-size: 16px; color: var(--muted); margin: 0 0 22px; line-height: 1.45; }

/* Formulário */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field-label { font-size: 13px; font-weight: 600; color: var(--navy); }
.field-label i { color: var(--danger); font-style: normal; }
.input {
  font-family: var(--font);
  font-size: 16px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.input:focus {
  outline: none;
  border-color: var(--navy-300);
  box-shadow: 0 0 0 3px rgba(58, 90, 160, .15);
}
select.input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230E2A5E' stroke-width='2.5'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

/* Consentimentos */
.consent-box { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.consent-item { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.consent-check { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--lime-600); flex: 0 0 auto; }
.consent-text { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.consent-text i { color: var(--danger); font-style: normal; }

.form-erro { color: var(--danger); background: var(--danger-bg); border-radius: var(--radius-sm); font-size: 14px; margin: 16px 0 0; min-height: 0; padding: 0; transition: padding .1s; }
.form-erro:not(:empty) { padding: 12px 14px; }

/* Botões */
.btn {
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform .08s, box-shadow .15s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--lime); color: var(--navy-700); box-shadow: 0 8px 20px rgba(164, 206, 78, .35); }
.btn-primary:hover { background: var(--lime-600); }
.btn-primary:disabled { background: #cfd6e2; color: #8a93a6; box-shadow: none; cursor: not-allowed; }
.btn-lg { width: 100%; padding: 17px 24px; font-size: 17px; margin-top: 24px; }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn-ok { background: var(--ok) !important; color: #fff !important; }

/* Introdução */
.intro-card { text-align: center; }
.intro-text { font-size: 17px; }
.intro-rodape { margin: 14px 0 0; font-size: 13px; color: var(--blue-soft); font-weight: 600; }

/* Quiz */
.quiz-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.quiz-pilar { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--lime-600); }
.quiz-contador { font-size: 13px; color: var(--muted); }
.progress { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 22px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--lime), var(--lime-600)); border-radius: 999px; transition: width .3s ease; }
.quiz-enunciado { font-size: 21px; line-height: 1.3; color: var(--navy); margin: 0 0 20px; }
.options { display: flex; flex-direction: column; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 14px;
  text-align: left;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-family: var(--font); font-size: 16px; color: var(--ink);
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.option:hover { border-color: var(--blue-soft); }
.option-marker { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; transition: border-color .12s, background .12s; position: relative; }
.option-selected { border-color: var(--lime-600); background: #f6fbec; box-shadow: 0 0 0 3px rgba(164, 206, 78, .18); }
.option-selected .option-marker { border-color: var(--lime-600); background: var(--lime-600); }
.option-selected .option-marker::after { content: ""; position: absolute; inset: 4px; background: #fff; border-radius: 50%; }
.option-text { line-height: 1.35; }
.quiz-actions { display: flex; gap: 12px; align-items: center; margin-top: 24px; }
.quiz-actions .btn-lg { margin-top: 0; }
.quiz-actions .btn-ghost { width: auto; flex: 0 0 auto; }

/* Processando */
.processing-card { text-align: center; padding: 56px 26px; }
.spinner { width: 54px; height: 54px; margin: 0 auto 20px; border: 5px solid var(--line); border-top-color: var(--lime-600); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing-text { color: var(--muted); font-size: 16px; }

/* Resultado */
.result-card { padding: 26px 24px 20px; }
.indice-bloco { text-align: center; border-radius: var(--radius); padding: 24px; margin-bottom: 22px; color: #fff; background: var(--navy); }
.indice-bloco.faixa-risco { background: linear-gradient(135deg, #a3312a, #7d241e); }
.indice-bloco.faixa-construcao { background: linear-gradient(135deg, #c77f2a, #9c5f17); }
.indice-bloco.faixa-solida { background: linear-gradient(135deg, #2f6fae, var(--navy)); }
.indice-bloco.faixa-avancada { background: linear-gradient(135deg, #4a8f2f, #2f6b1f); }
.indice-numero { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.indice-valor { font-size: 64px; font-weight: 800; line-height: 1; }
.indice-max { font-size: 20px; opacity: .85; }
.indice-classificacao { margin-top: 8px; font-size: 16px; font-weight: 700; letter-spacing: .3px; opacity: .97; }

.pilares { display: flex; flex-direction: column; gap: 18px; margin-bottom: 22px; }
.pilar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.pilar-nome { font-weight: 700; color: var(--navy); font-size: 15px; }
.pilar-percent { font-weight: 800; color: var(--navy); font-size: 15px; }
.pilar-track { height: 12px; background: var(--line); border-radius: 999px; overflow: hidden; }
.pilar-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.pilar-tec .pilar-fill { background: linear-gradient(90deg, var(--blue-soft), var(--navy-300)); }
.pilar-ia .pilar-fill { background: linear-gradient(90deg, #b0d96a, var(--lime-600)); }
.pilar-seg .pilar-fill { background: linear-gradient(90deg, var(--navy-300), var(--navy)); }
.pilar-leitura { margin: 7px 0 0; font-size: 13.5px; color: var(--muted); }

.diagnostico { border-top: 1px solid var(--line); padding-top: 20px; margin-bottom: 18px; }
.diag-titulo { font-size: 20px; color: var(--navy); margin: 0 0 8px; }
.diag-texto { font-size: 15.5px; color: var(--ink); line-height: 1.5; margin: 0 0 12px; }
.diag-pilar { font-size: 15px; color: var(--navy-700); font-weight: 600; line-height: 1.45; margin: 0; }

.alertas { background: #fff7ed; border: 1.5px solid #f3c88a; border-left: 5px solid #d98324; border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 20px; }
.alerta-destaque { font-weight: 700; color: #9a5a12; margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.alertas-lista { margin: 0; padding-left: 18px; color: #7a4a12; }
.alertas-lista li { font-size: 14px; line-height: 1.4; margin-bottom: 6px; }

.bloco-final { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 24px; text-align: center; }
.final-titulo { font-size: 20px; margin: 0 0 8px; }
.final-apoio { font-size: 15px; opacity: .9; margin: 0 0 4px; line-height: 1.45; }
.bloco-final .btn-lg { margin-top: 18px; }
.final-abaixo { font-size: 13.5px; opacity: .85; margin: 14px 0 0; }

.result-rodape { text-align: center; font-size: 12px; color: var(--muted); margin: 16px 0 0; }
.btn-reiniciar { width: 100%; margin-top: 14px; }

/* Número do sorteio */
.sorteio-bloco { text-align: center; border-radius: var(--radius); padding: 20px 18px; margin-bottom: 20px; background: linear-gradient(135deg, var(--lime), var(--lime-600)); color: var(--navy-700); box-shadow: 0 10px 28px rgba(164, 206, 78, .4); }
.sorteio-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; opacity: .85; }
.sorteio-numero { font-size: 52px; font-weight: 800; line-height: 1.05; margin: 4px 0 6px; letter-spacing: 1px; }
.sorteio-ajuda { font-size: 13px; font-weight: 600; opacity: .9; line-height: 1.35; }

/* Responsivo */
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .card { padding: 22px 18px; }
  .screen-title { font-size: 23px; }
  .quiz-enunciado { font-size: 19px; }
  .indice-valor { font-size: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
