:root {
  --primary: #1e3a8a;
  --primary-hover: #172554;
  --accent: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 40px;
}

/* Header & Navegação */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-links a.active, .nav-links a:hover {
  color: var(--primary);
  background-color: #eff6ff;
}

/* Container Principal */
.container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Barra de Progresso das 60 Questões */
.progress-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.progress-bar-bg {
  background: #dbeafe;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--accent);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}

/* Filtros por Matéria */
.filter-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}

.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Questão */
.question-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.badge {
  background: #e0e7ff;
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-weight: 600;
}

.question-statement {
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.question-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

/* Alternativas */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.option-item {
  display: flex;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.option-item:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
}

.option-item.selected {
  border-color: var(--primary);
  background-color: #eff6ff;
}

.option-letter {
  font-weight: 700;
  margin-right: 0.75rem;
  color: var(--primary);
}

/* Botões */
.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #cbd5e1;
}

/* Botão de Gravação de Voz */
.btn-mic {
  background-color: #0284c7;
  color: white;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-mic.recording {
  background-color: var(--danger);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
  70% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Trava Visual da Redação */
.lock-card {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 2px dashed #cbd5e1;
}

.lock-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

/* Editor de Redação */
.essay-textarea {
  width: 100%;
  min-height: 380px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.7;
  resize: vertical;
  margin-top: 1rem;
}

.essay-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

/* Tabela de Ranking */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
}

.ranking-table th, .ranking-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.ranking-table th {
  background: #f1f5f9;
  font-weight: 600;
  color: var(--text-muted);
}

.ranking-table tr.current-user {
  background-color: #fef3c7;
  font-weight: 600;
}

/* ==========================================
   Carrossel de Banners Rolantes e Hub
   ========================================== */
.carousel-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 1.5rem auto;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.carousel-slides {
  display: flex;
  transition: transform 0.6s ease-in-out;
  width: 300%; /* 3 banners */
}

.carousel-slide {
  width: 33.333%;
  padding: 3.5rem 2rem;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 260px;
}

.slide-1 {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}
.slide-2 {
  background: linear-gradient(135deg, #065f46 0%, #10b981 100%);
}
.slide-3 {
  background: linear-gradient(135deg, #4c1d95 0%, #8b5cf6 100%);
}

.carousel-slide h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.carousel-slide p {
  font-size: 1.1rem;
  max-width: 650px;
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

.carousel-dots {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.3s;
}

.dot.active {
  background: white;
  transform: scale(1.1);
}

/* Grid de Módulos / Hub */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.hub-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
