/* ─── Variáveis ──────────────────────────────────────────────── */
:root {
  --navy:      #07111f;
  --navy2:     #0d1e33;
  --blue:      #0047c8;
  --blue2:     #0057f8;
  --cyan:      #00b4d8;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #f59e0b;
  --text:      #e2eaf6;
  --muted:     #8da4bf;
  --card:      rgba(13,30,51,.9);
  --border:    rgba(255,255,255,.07);
  --radius:    14px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--navy);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(0,71,200,.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 110%, rgba(0,180,216,.12) 0%, transparent 60%);
}

.hidden { display: none !important; }

/* ─── Layout ─────────────────────────────────────────────────── */
.container {
  position: relative; z-index: 1;
  max-width: 860px; margin: 0 auto; padding: 0 18px;
}

main { padding: 26px 0 60px; }

/* ─── Header ─────────────────────────────────────────────────── */
.topo {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7,17,31,.93);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 18px;
}
.topo-inner {
  max-width: 860px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px;
  height: 62px;
}
.logo-img { height: 38px; width: auto; display: block; }
.logo-brand { line-height: 1.2; }
.logo-brand .brand-name { font-size: .72rem; font-weight: 700; color: var(--cyan); letter-spacing: .08em; text-transform: uppercase; }
.logo-brand .brand-sub  { font-size: .63rem; color: var(--muted); letter-spacing: .04em; }
.topo-divider { width: 1px; height: 28px; background: var(--border); }
.subtitulo { font-size: .85rem; color: var(--muted); }

/* ─── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card.destaque { border-top: 3px solid var(--blue2); }

h1 { font-size: 1.55rem; font-weight: 800; color: #fff; margin-bottom: 10px; }
h1 span { color: var(--cyan); }
h2 { font-size: 1.15rem; font-weight: 700; color: var(--cyan); margin-bottom: 14px; }
h3 { font-size: 1rem; font-weight: 700; color: var(--cyan); margin-bottom: 14px; }
.lead { color: var(--muted); margin-bottom: 20px; font-size: .97rem; }

/* ─── Tela início ────────────────────────────────────────────── */
.hero-badge {
  display: inline-block;
  background: linear-gradient(90deg, var(--blue), var(--blue2));
  color: #fff; font-size: .7rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 20px; margin-bottom: 14px;
}

.opcoes {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: rgba(255,255,255,.04); border-radius: 10px;
  padding: 14px 18px; margin-top: 18px;
}
.switch { display: flex; align-items: center; gap: 10px; font-size: .92rem; cursor: pointer; color: var(--text); }
.switch input[type=checkbox] { display: none; }
.switch-slider {
  position: relative; width: 42px; height: 23px;
  background: #1e3a5f; border-radius: 23px; flex-shrink: 0; cursor: pointer;
  transition: background .2s;
}
.switch-slider::after {
  content: ''; position: absolute;
  width: 17px; height: 17px; border-radius: 50%; background: #fff;
  top: 3px; left: 3px; transition: transform .2s;
}
.switch input:checked + .switch-slider { background: var(--blue2); }
.switch input:checked + .switch-slider::after { transform: translateX(19px); }

/* ─── Tabela distribuição ────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
td:last-child, th:last-child { text-align: center; }
.center { text-align: center; }

.tabela-distribuicao tbody tr:hover { background: rgba(255,255,255,.03); }

.badge {
  display: inline-block; color: #fff;
  font-size: .7rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}

.nota-rodape { font-size: .8rem; color: var(--muted); margin-top: 16px; line-height: 1.6; }
.nota-rodape b { color: var(--text); }

/* ─── Botões ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 9px;
  font-size: .92rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.07); color: var(--text);
  transition: background .15s, transform .1s;
}
.btn:hover { background: rgba(255,255,255,.12); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(90deg, var(--blue), var(--blue2));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 16px rgba(0,87,248,.35);
}
.btn.primary:hover { box-shadow: 0 6px 22px rgba(0,87,248,.55); transform: translateY(-1px); }
.btn.grande { padding: 13px 26px; font-size: 1rem; }

/* ─── Barra de progresso ─────────────────────────────────────── */
.barra-progresso {
  position: sticky; top: 62px; z-index: 49;
  background: rgba(7,17,31,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 10px 18px;
  display: flex; align-items: center; gap: 14px;
}
.progresso {
  flex: 1; height: 5px;
  background: rgba(255,255,255,.08); border-radius: 5px; overflow: hidden;
}
#progresso-bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--blue2), var(--cyan));
  transition: width .3s ease;
}
#progresso-txt { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ─── Questão ────────────────────────────────────────────────── */
.questao {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px; margin-bottom: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  transition: border-color .2s;
}
.questao:hover { border-color: rgba(0,87,248,.25); }
.questao header {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.questao .numero {
  font-weight: 800; color: var(--muted);
  background: rgba(255,255,255,.07);
  border-radius: 7px; padding: 3px 10px; font-size: .82rem;
}
.questao .topico { font-size: .75rem; color: var(--muted); margin-left: auto; }
.enunciado { margin: 0 0 16px; line-height: 1.7; color: var(--text); }

/* ─── Alternativas ───────────────────────────────────────────── */
.alternativas { list-style: none; margin: 0; padding: 0; }
.alternativa {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 14px; border-radius: 9px; margin-bottom: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  cursor: pointer; transition: background .12s, border-color .12s;
}
.alternativa:hover { border-color: rgba(0,87,248,.35); background: rgba(0,87,248,.07); }
.alternativa .letra {
  font-weight: 800; font-size: .78rem;
  border: 2px solid rgba(255,255,255,.18);
  border-radius: 50%; width: 26px; height: 26px;
  display: grid; place-items: center; flex-shrink: 0; color: var(--muted);
  transition: all .12s;
}
.alternativa .texto { color: var(--text); line-height: 1.5; font-size: .93rem; }

.alternativa.selecionada { border-color: rgba(0,87,248,.45); background: rgba(0,87,248,.1); }
.alternativa.selecionada .letra { background: var(--blue2); border-color: var(--blue2); color: #fff; }

.alternativa.correta { border-color: rgba(34,197,94,.4); background: rgba(34,197,94,.07); }
.alternativa.correta .letra { background: var(--green); border-color: var(--green); color: #fff; }

.alternativa.incorreta { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.07); }
.alternativa.incorreta .letra { background: var(--red); border-color: var(--red); color: #fff; }

/* ─── Gabarito comentado ─────────────────────────────────────── */
.comentario {
  margin-top: 16px; padding: 14px 16px;
  background: rgba(0,0,0,.2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue2);
  border-radius: 0 9px 9px 0;
}
.resultado { font-weight: 700; margin: 0 0 8px; font-size: .95rem; }
.resultado.acerto { color: var(--green); }
.resultado.erro    { color: var(--red); }
.resultado.branco  { color: var(--muted); }
.fundamento { font-size: .87rem; margin: 0 0 10px; color: var(--muted); }
.fundamento b { color: var(--text); }
.distratores { list-style: none; margin: 0 0 8px; padding: 0; font-size: .86rem; }
.distratores li { padding: 3px 0; }
.distratores li.ok { color: #86efac; }
.distratores li.no { color: #fca5a5; }
.pegadinha { font-size: .83rem; color: var(--yellow); margin: 6px 0 0; }

/* ─── Navegação modo prova ───────────────────────────────────── */
.nav-mp {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin: 20px 0;
}
.nav-mp #mp-pos { font-weight: 600; color: var(--muted); }
.acoes { display: flex; justify-content: center; margin: 24px 0; }

/* ─── Resultado ──────────────────────────────────────────────── */
.resultado-card {
  border-radius: var(--radius); padding: 30px 24px;
  text-align: center; color: #fff; margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.resultado-card.aprovado { background: linear-gradient(135deg, #14532d, #16a34a); }
.resultado-card.reprovado { background: linear-gradient(135deg, #7f1d1d, #dc2626); }
.resultado-card h2 { margin: 0 0 8px; font-size: 1.3rem; }
.resultado-card .nota { font-size: 2.8rem; font-weight: 800; margin: 8px 0; }
.resultado-card .nota span { font-size: 1rem; font-weight: 500; opacity: .85; }
.resultado-card .corte { margin: 0; opacity: .9; font-size: .9rem; }

.titulo-gabarito {
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--cyan); font-size: 1.1rem;
}

/* Tabela desempenho */
.tabela-desempenho {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 18px;
}
.tabela-desempenho th { background: rgba(255,255,255,.04); }

.mini-bar {
  display: inline-block; width: 100px; height: 6px;
  background: rgba(255,255,255,.1); border-radius: 6px;
  overflow: hidden; vertical-align: middle; margin-right: 8px;
}
.mini-bar span { display: block; height: 100%; border-radius: 6px; }

/* Mapa revisão */
.mapa-revisao {
  list-style: none; padding: 16px 20px; margin: 0 0 18px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: .9rem;
}
.mapa-revisao li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.mapa-revisao li:last-child { border-bottom: none; }
.parabens { color: var(--green); font-weight: 700; text-align: center; padding: 12px 0; }

/* ─── Rodapé ─────────────────────────────────────────────────── */
.rodape {
  position: relative; z-index: 1;
  background: rgba(0,0,0,.4);
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: .78rem;
  padding: 20px 0; text-align: center;
}
.rodape strong { color: var(--cyan); }

/* ─── Responsivo ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .topo-inner { height: 54px; }
  .logo-brand { display: none; }
  .topo-divider { display: none; }
  .card { padding: 20px 16px; }
  .questao .topico { margin-left: 0; width: 100%; }
  .resultado-card .nota { font-size: 2.1rem; }
  .mini-bar { width: 70px; }
}
