/* ===== ENEM Dashboard — Visualização das Questões de Pesquisa ===== */
:root {
  --bg: #eef1f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08);
  --radius: 18px;
  --radius-sm: 11px;

  /* Cores fixas por região — reaproveitadas em todos os gráficos e controles */
  --c-norte: #2563eb;
  --c-nordeste: #0891b2;
  --c-sudeste: #7c3aed;
  --c-sul: #ea580c;
  --c-centro: #16a34a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
  background: linear-gradient(135deg, #312e81 0%, #4f46e5 55%, #6d28d9 100%);
  color: #fff;
  padding: 34px 0 30px;
}
.site-header .eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  font-weight: 600;
  opacity: .82;
  margin: 0 0 8px;
}
.site-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -.02em;
}
.site-header p.lead {
  margin: 10px 0 0;
  width: 100%;
  font-size: 15px;
  opacity: .92;
}
.source-badges { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.source-badges span {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* ===== Filtros (sticky) ===== */
.filters {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.filters-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px 28px;
  padding: 16px 20px;
}
.filter-group { display: flex; flex-direction: column; gap: 7px; }
.filter-group > label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
}
select {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 34px 9px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  min-width: 190px;
  transition: border-color .15s, box-shadow .15s;
}
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  --pc: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all .14s ease;
}
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); opacity: .35; transition: opacity .14s; }
.pill[aria-pressed="true"] {
  border-color: var(--pc);
  background: color-mix(in srgb, var(--pc) 10%, #fff);
  color: var(--text);
}
.pill[aria-pressed="true"] .dot { opacity: 1; }
.pill:hover { transform: translateY(-1px); }

.btn-reset {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .14s;
}
.btn-reset:hover { border-color: var(--accent); color: var(--accent); }

/* ===== KPIs ===== */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 26px 0;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.kpi .k-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kpi .k-value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; }
.kpi .k-sub { font-size: 12.5px; color: var(--text-soft); margin-top: 2px; }

/* ===== Seções de RQ ===== */
.rq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  overflow: hidden;
}
.rq-head {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.rq-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .04em;
  padding: 4px 10px;
  border-radius: 7px;
  margin-bottom: 10px;
}
.rq-head h2 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.35;
}
.rq-head .hint { margin: 9px 0 0; font-size: 13.5px; color: var(--text-muted); }
.rq-body { padding: 18px 22px 24px; }

.chart-grid { display: grid; gap: 18px; }
.chart-grid.two { grid-template-columns: 1.05fr .95fr; }

.chart-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 12px 6px; }
.chart-card h3 {
  margin: 4px 6px 2px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.chart-card .cap { margin: 0 6px 8px; font-size: 12px; color: var(--text-soft); }
.plot { width: 100%; height: 380px; }

/* ===== Faixa de insight ===== */
.insight {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
  padding: 15px 18px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, #fff);
  border-radius: var(--radius-sm);
}
.insight .ic { font-size: 18px; line-height: 1.4; }
.insight .txt { font-size: 14px; color: #312e81; }
.insight .txt strong { color: var(--accent); }
.badge-r {
  margin-left: auto;
  white-space: nowrap;
  font-weight: 800;
  font-size: 13px;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, #fff);
  color: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
  align-self: center;
}

.empty-note {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-soft);
  font-size: 14px;
}

/* ===== Footer ===== */
.site-footer {
  margin: 10px 0 40px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-muted);
}
.site-footer h4 { margin: 0 0 8px; font-size: 13px; color: var(--text); }
.site-footer ul { margin: 0; padding-left: 18px; }
.site-footer li { margin-bottom: 3px; }
.site-footer .credits {
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text);
}
.site-footer .credits strong { color: var(--accent); }

/* ===== Responsivo ===== */
@media (max-width: 820px) {
  .chart-grid.two { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .filters-inner { gap: 14px 18px; }
  select { min-width: 150px; }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr; }
}
