/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --azul:       #1a3a5c;
  --azul-mid:   #2563a8;
  --azul-light: #e8f0fb;
  --verde:      #10b981;
  --ouro:       #f59e0b;
  --prata:      #6b7280;
  --bronze:     #b45309;
  --text:       #1a1a2e;
  --text-2:     #4b5563;
  --border:     #e5e7eb;
  --bg:         #f8fafc;
  --white:      #ffffff;
  --radius:     12px;
  --shadow:     0 2px 16px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── HEADER ── */
.header {
  background: var(--azul);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.logo { height: 36px; }
.logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}
.header-tagline {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  margin-left: auto;
}

/* ── TELAS ── */
.tela { display: none; }
.tela.ativa { display: block; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.container-resultado { max-width: 900px; }

/* ── HERO ── */
.hero { text-align: center; margin-bottom: 2.5rem; }
.badge {
  display: inline-block;
  background: var(--azul-light);
  color: var(--azul-mid);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--azul);
  line-height: 1.3;
  margin-bottom: 1rem;
}
.hero-sub {
  color: var(--text-2);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── CARD FORM ── */
.card-form {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  border: 1px solid var(--border);
}
.card-form h2 {
  font-size: 1.1rem;
  color: var(--azul);
  margin-bottom: 1.5rem;
  font-weight: 600;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text); }

input, select, textarea {
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--azul-mid);
  box-shadow: 0 0 0 3px rgba(37,99,168,0.1);
}
input.erro, select.erro { border-color: #ef4444; }

.lgpd {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 1.25rem 0;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
}
.lgpd input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  padding: 0;
  cursor: pointer;
}
.lgpd a { color: var(--azul-mid); text-decoration: underline; }

.erro-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ── BOTÕES ── */
.btn-primary {
  background: var(--azul);
  color: #fff;
  border: none;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}
.btn-primary:hover { background: #0f2540; }
.btn-primary:active { transform: scale(0.98); }
.btn-full { width: 100%; }

.btn-secondary {
  background: transparent;
  color: var(--azul);
  border: 1.5px solid var(--border);
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-secondary:hover { border-color: var(--azul); background: var(--azul-light); }

/* ── PROGRESSO ── */
.progresso-wrapper {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.progresso-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-2);
}
.badge-pilar {
  background: var(--azul);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.progresso-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.progresso-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--azul-mid), var(--verde));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.pilares-nav {
  display: flex;
  gap: 0.5rem;
  font-size: 0.75rem;
}
.pilar-nav {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.pilar-nav.ativo {
  background: var(--azul-light);
  color: var(--azul-mid);
  border-color: var(--azul-mid);
  font-weight: 600;
}
.pilar-nav.concluido {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}

/* ── CARD PERGUNTA ── */
.card-pergunta {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  border: 1px solid var(--border);
}
.pergunta-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.tag-subsistema {
  background: var(--azul-light);
  color: var(--azul-mid);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
}
.perg-num {
  font-size: 0.8rem;
  color: var(--text-2);
}
.perg-texto {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 2rem;
  min-height: 80px;
}

/* ── ESCALA ── */
.escala-wrapper { margin-bottom: 2rem; }
.escala-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-2);
  margin-bottom: 0.5rem;
}
.escala-botoes {
  display: flex;
  gap: 0.5rem;
}
.btn-nota {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 0.25rem;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-nota:hover { border-color: var(--azul-mid); background: var(--azul-light); }
.btn-nota.selecionado {
  border-color: var(--azul);
  background: var(--azul);
  color: #fff;
}
.btn-nota.selecionado .nota-num { color: #fff; }
.btn-nota.selecionado .nota-label { color: rgba(255,255,255,0.85); }
.nota-num { font-size: 1.2rem; font-weight: 700; color: var(--azul); }
.nota-label { font-size: 0.65rem; color: var(--text-2); text-align: center; line-height: 1.3; }

@media (max-width: 480px) {
  .nota-label { display: none; }
  .btn-nota { padding: 0.75rem 0; }
}

/* ── NAV PERGUNTAS ── */
.nav-perguntas {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ── RESULTADO ── */
.resultado-header {
  text-align: center;
  margin-bottom: 2rem;
}
.nivel-badge {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}
.resultado-header h2 {
  font-size: 1.75rem;
  color: var(--azul);
  margin-bottom: 0.5rem;
}
.resultado-header p { color: var(--text-2); font-size: 1rem; }

.resultado-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 640px) { .resultado-grid { grid-template-columns: 1fr; } }

.card-pontuacao, .card-analise {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem;
  border: 1px solid var(--border);
}

/* GAUGE */
.gauge { width: 100%; max-width: 200px; display: block; margin: 0 auto 1.5rem; }
.gauge-pct { font-size: 22px; font-weight: 700; fill: var(--azul); }
.gauge-label { font-size: 10px; fill: var(--text-2); }

.pilares-scores { display: flex; flex-direction: column; gap: 1rem; }
.pilar-score { display: flex; align-items: center; gap: 0.75rem; }
.pilar-score-nome { font-size: 0.8rem; font-weight: 500; min-width: 130px; color: var(--text); }
.pilar-score-bar { flex: 1; height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.pilar-score-fill { height: 100%; background: var(--azul-mid); border-radius: 999px; transition: width 1s ease; }
.pilar-score-pct { font-size: 0.8rem; font-weight: 600; color: var(--azul); min-width: 36px; text-align: right; }

.card-analise h3 {
  font-size: 1rem;
  color: var(--azul);
  margin-bottom: 1.25rem;
  font-weight: 600;
}
.analise-item { margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.analise-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.analise-pilar-nome { font-weight: 600; font-size: 0.9rem; color: var(--azul); margin-bottom: 0.4rem; }
.analise-nivel {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.nivel-ouro { background: #fef3c7; color: #92400e; }
.nivel-prata { background: #f3f4f6; color: #374151; }
.nivel-bronze { background: #fef3c7; color: #92400e; }
.nivel-bronze { background: #fde8d0; color: #7c2d12; }
.analise-texto { font-size: 0.82rem; color: var(--text-2); line-height: 1.55; }
.analise-cta { font-size: 0.8rem; color: var(--azul-mid); font-style: italic; margin-top: 0.35rem; }

/* ── CTA ── */
.card-cta {
  background: var(--azul);
  border-radius: var(--radius);
  overflow: hidden;
}
.cta-inner { padding: 2rem; text-align: center; }
.cta-inner h3 { color: #fff; font-size: 1.2rem; margin-bottom: 0.75rem; }
.cta-inner p { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-bottom: 1.5rem; }
.btn-cta {
  display: inline-block;
  background: var(--ouro);
  color: #1a1a1a;
  padding: 0.9rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
}
.btn-cta:hover { background: #d97706; transform: translateY(-1px); }

/* ── FOOTER ── */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-2);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.footer a { color: var(--azul-mid); text-decoration: none; }

/* ── LOADING ── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  gap: 1rem;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--azul);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-texto { color: var(--azul); font-weight: 500; font-size: 0.95rem; }
