/* =========================
   Paleta Mercado Livre
========================= */
:root {
  --ml-yellow: #fff159;
  --ml-yellow-dark: #ffe600;
  --ml-blue: #3483fa;
  --ml-blue-dark: #2968c8;
  --ml-bg: #f5f5f5;
  --ml-text: #333;
  --ml-muted: #666;
  --ml-border: #ddd;
}

/* =========================
   Reset & Base
========================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: var(--ml-bg);
  color: var(--ml-text);
  line-height: 1.5;
}

/* transição suave com tema */
body,
.ml-container,
.ml-header,
.ml-footer,
input,
textarea,
select,
.ml-btn {
  transition: background-color 0.3s ease,
              color 0.3s ease,
              border-color 0.3s ease;
}

/* =========================
   Layout Main
========================= */

.layout-main {
  min-height: calc(100vh - 140px);
  padding: 20px 16px 30px;
}

/* tenta centralizar conteúdo “solto” */
.layout-main > h1,
.layout-main > h2,
.layout-main > .ml-container,
.layout-main > .ranking-container,
.layout-main > .ml-quiz-container,
.layout-main > .quiz-container,
.layout-main > .painel-container,
.layout-main > .ml-form-container {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* =========================
   Header & Navigation (estilo Mercado Livre)
========================= */

.ml-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(
    90deg,
    var(--ml-yellow) 0%,
    var(--ml-yellow-dark) 45%,
    #ffffff 100%
  );
  padding: 10px 24px;
  border-bottom: 2px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.ml-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}

/* LOGO BLOCO */
.ml-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ml-text);
  margin-right: 16px;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.ml-logo:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

.ml-logo-mark {
  background: #fff;
  color: #222;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.18);
}

.ml-logo-text {
  display: flex;
  flex-direction: column;
}

.ml-logo-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.ml-logo-subtitle {
  font-size: 11px;
  opacity: 0.7;
}

/* NAV PRINCIPAL */
.ml-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  flex: 1 1 auto;
}

.ml-link {
  text-decoration: none;
  font-weight: 600;
  color: #333;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  white-space: nowrap;
}

.ml-link:hover {
  background: rgba(0,0,0,0.06);
  color: #111;
  transform: translateY(-1px);
}

/* LADO DIREITO (usuário + botões) */
.ml-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* PILL DO USUÁRIO */
.ml-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.05);
  font-size: 13px;
}

.ml-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ml-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.ml-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.ml-user-name {
  font-weight: 600;
}

.ml-user-role {
  font-size: 11px;
  color: var(--ml-muted);
}

.ml-user-logout {
  margin-left: 4px;
  text-decoration: none;
  font-size: 18px;
}

/* BOTÕES DO TOPO (tema + menu) */
.ml-menu-toggle,
.ml-theme-toggle {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.95rem;
  cursor: pointer;
  color: #333;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.ml-theme-toggle {
  min-width: 38px;
  text-align: center;
}

.ml-menu-toggle {
  display: none; /* só mostra em mobile */
}

.ml-menu-toggle:hover,
.ml-theme-toggle:hover {
  background: var(--ml-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* Mobile nav */
@media (max-width: 900px) {
  .ml-header-inner {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .ml-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
  }

  .ml-nav.show {
    display: flex;
  }

  .ml-link {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
  }

  .ml-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ml-user-pill {
    display: none; /* some no mobile pra não espremer tudo */
  }
}

/* =========================
   Banner (usado em algumas páginas)
========================= */

.ml-banner {
  background: linear-gradient(90deg, var(--ml-yellow) 0%, var(--ml-yellow-dark) 100%);
  padding: 60px 20px;
  text-align: center;
}

.ml-banner-content h1 {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--ml-text);
}

.ml-banner-content p {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--ml-muted);
}

/* =========================
   Containers & Titles
========================= */

.ml-container {
  max-width: 1100px;
  margin: 30px auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
}

.ml-title {
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

/* =========================
   Cards & Grid (genéricos)
========================= */

.ml-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.ml-card {
  background: #fff;
  border: 1px solid var(--ml-border);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ml-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.ml-card-title {
  font-size: 18px;
  margin-bottom: 8px;
}

.ml-card-desc {
  font-size: 14px;
  color: var(--ml-muted);
  margin-bottom: 12px;
}

.ml-card.safety {
  background-color: #fff4e5;
  border-left: 6px solid #f57c00;
}

.ml-card.safety h3 {
  color: #d84315;
}

.ml-card.safety .ml-btn {
  background-color: #f57c00;
  color: #fff;
}

.ml-card.safety .ml-btn:hover {
  background-color: #e65100;
}

/* =========================
   Buttons
========================= */

.ml-btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.2s ease, opacity 0.2s ease, color 0.2s ease;
  background: var(--ml-yellow);
  color: var(--ml-text);
}

.ml-btn:hover {
  opacity: 0.95;
}

.ml-btn.primary {
  background: var(--ml-blue);
  color: #fff;
}

.ml-btn.primary:hover {
  background: var(--ml-blue-dark);
}

.ml-btn.danger {
  background-color: #e74c3c;
  color: #fff;
}

.ml-btn.info {
  background-color: #3498db;
  color: #fff;
}

.ml-btn.success {
  background-color: #2ecc71;
  color: #fff;
}

/* =========================
   Actions
========================= */

.ml-actions {
  margin-top: 20px;
  text-align: center;
}

.ml-actions .ml-btn {
  margin: 5px;
}

/* =========================
   Tables
========================= */

.ml-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.ml-table th,
.ml-table td {
  border: 1px solid var(--ml-border);
  padding: 10px;
  text-align: center;
}

.ml-table th {
  background: var(--ml-yellow);
  color: var(--ml-text);
}

.ml-table tr:nth-child(even) {
  background: #f9f9f9;
}

.ml-table tr:hover {
  background: #f1f1f1;
}

/* Podium styles dentro de tabelas de ranking (alternativo) */
.podium {
  font-weight: bold;
  font-size: 1.1em;
}

.gold {
  background: #ffd70033;
}

.silver {
  background: #c0c0c033;
}

.bronze {
  background: #cd7f3233;
}

/* Tabelas textuais de correção (avaliações escritas) */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background-color: #f9fcff;
  border: 2px solid #0077cc;
}

th,
td {
  padding: 12px;
  border: 1px solid #ccc;
  vertical-align: top;
  text-align: left;
}

th {
  background-color: #e6f2ff;
  color: #003366;
}

td.correta {
  background-color: #e0ffe0;
  color: green;
  font-weight: bold;
}

td.parcial {
  background-color: #fff8dc;
  color: orange;
  font-weight: bold;
}

td.incorreta {
  background-color: #ffe0e0;
  color: red;
  font-weight: bold;
}

/* Filtros de tabela */

.painel-filtros {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.painel-filtros label {
  font-weight: bold;
}

.painel-filtros input,
.painel-filtros select {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Efeitos em linhas */

tr {
  transition: all 0.3s ease;
}

tr.oculto {
  opacity: 0;
  transform: scaleY(0);
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* =========================
   Login & Register Forms
========================= */

.ml-form-container {
  max-width: 400px;
  margin: 40px auto;
  padding: 30px;
  background: #fff;
  border: 1px solid var(--ml-border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.ml-form-container h2 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 22px;
  color: var(--ml-text);
}

.ml-form-group {
  margin-bottom: 15px;
}

.ml-form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: var(--ml-muted);
}

.ml-form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--ml-border);
  border-radius: 6px;
  font-size: 14px;
}

.ml-form-group input:focus {
  border-color: var(--ml-blue);
  outline: none;
}

.ml-form-actions {
  text-align: center;
  margin-top: 20px;
}

.ml-form-actions .ml-btn {
  width: 100%;
}

.ml-form-footer {
  text-align: center;
  margin-top: 15px;
  font-size: 14px;
}

.ml-form-footer a {
  color: var(--ml-blue);
  text-decoration: none;
}

.ml-form-footer a:hover {
  text-decoration: underline;
}

/* mini forms / painéis */

.ml-form {
  margin: 2em 0;
  padding: 1em;
  background: #f9f9f9;
  border-left: 4px solid #28a745;
  border-radius: 8px;
}

.ml-subform {
  margin-top: 1em;
}

.ml-input {
  width: 100%;
  max-width: 400px;
  padding: 0.6em 0.8em;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1em;
  margin-bottom: 0.5em;
}

.ml-checkbox-column {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  font-size: 0.95em;
}

/* Auth container wrapper */

.ml-auth-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  background-color: #f9f9f9;
}

.ml-auth-container .ml-title {
  margin-bottom: 1rem;
}

/* Mensagens de erro */

.ml-error-box {
  background: #ffe0e0;
  border-left: 4px solid red;
  padding: 10px;
  margin-bottom: 20px;
  border-radius: 6px;
  color: #b00020;
  font-weight: bold;
  text-align: center;
}

/* =========================
   Footer
========================= */

.ml-footer {
  text-align: center;
  padding: 15px;
  background: #f0f0f0;
  margin-top: 30px;
  font-size: 14px;
  color: var(--ml-muted);
  border-top: 3px solid #0078d7;
}

.ml-footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  font-size: 0.9rem;
}

/* =========================
   Quiz blocks
========================= */

.ml-quiz-container {
  max-width: 600px;
  margin: 4rem auto;
  padding: 2rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ml-quiz-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.ml-quiz-question p {
  font-size: 1.2rem;
  margin: 0;
}

.ml-quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ml-quiz-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
}

.ml-quiz-option input[type="radio"] {
  accent-color: #007bff;
}

.ml-quiz-actions {
  text-align: right;
}

.ml-info {
  text-align: center;
  font-style: italic;
  color: #666;
}

/* Quiz (nova versão) */

.quiz-container {
  max-width: 800px;
  margin: 4rem auto;
  padding: 2rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.quiz-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 2rem;
  color: #333;
}

.quiz-question {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background-color: #f9f9f9;
}

.quiz-question legend {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  transition: background 0.2s;
}

.quiz-option:hover {
  background-color: #eef2ff;
}

.quiz-actions {
  text-align: center;
  margin-top: 2rem;
}

.quiz-btn {
  background-color: #007bff;
  color: #fff;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}

.quiz-btn:hover {
  background-color: #0056b3;
}

.quiz-result {
  margin-top: 2rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: #333;
}

/* Correção visual */

.correct {
  background-color: #d4edda !important;
  border-left: 4px solid #28a745;
}

.wrong {
  background-color: #f8d7da !important;
  border-left: 4px solid #dc3545;
}

/* Versão ML das alternativas */

.ml-question {
  font-size: 16px;
  margin-bottom: 20px;
  padding: 10px;
  border: 1px solid var(--ml-border);
  border-radius: 6px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ml-question:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ml-option {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.ml-option.correct {
  background-color: #e8f5e9;
  border-left: 4px solid #4caf50;
  padding: 8px;
  border-radius: 4px;
  font-weight: bold;
  color: #2e7d32;
}

.ml-option.wrong {
  background-color: #ffebee;
  border-left: 4px solid #f44336;
  padding: 8px;
  border-radius: 4px;
  font-weight: bold;
  color: #c62828;
}

/* Questões escritas */

.quiz-written-section {
  margin-top: 40px;
  padding: 20px;
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
}

.quiz-subtitle {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 20px;
  color: #333;
}

.quiz-written {
  margin-bottom: 25px;
}

.quiz-written label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #222;
}

.quiz-written textarea {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  border: 1px solid #ccc;
  border-radius: 6px;
  resize: vertical;
  background-color: #fff;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.quiz-written textarea:focus {
  border-color: #0077cc;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 119, 204, 0.2);
}

/* =========================
   Ranking Layout
========================= */

.ranking-container {
  max-width: 800px;
  margin: 40px auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ranking-title {
  text-align: center;
  font-size: 28px;
  margin-bottom: 20px;
  color: var(--ml-blue-dark);
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.ranking-table th,
.ranking-table td {
  padding: 12px;
  border: 1px solid var(--ml-border);
  text-align: center;
}

.ranking-table th {
  background: var(--ml-yellow);
  color: var(--ml-text);
  font-size: 16px;
}

.ranking-table tr:nth-child(even) {
  background: #f9f9f9;
}

.ranking-table tr:hover {
  background: #eef6ff;
}

/* Destaque para top 3 */

.ranking-table tr.gold td {
  background: #fff8dc;
  font-weight: bold;
  color: #b8860b;
}

.ranking-table tr.silver td {
  background: #f0f0f0;
  font-weight: bold;
  color: #555;
}

.ranking-table tr.bronze td {
  background: #fff0e0;
  font-weight: bold;
  color: #8b4513;
}

/* =========================
   Página de erro
========================= */

.error-icon {
  font-size: 4rem;
  color: #e74c3c;
  margin-bottom: 20px;
}

.error-title {
  color: #e74c3c;
  font-size: 2rem;
  margin-bottom: 15px;
}

.error-message {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: var(--ml-muted);
}

/* =========================
   Alert / Toast simples
========================= */

.ml-alert {
  background: #ffeeba;
  color: #856404;
  padding: 12px 16px;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  margin: 15px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ml-alert-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #856404;
  cursor: pointer;
  padding: 0 8px;
}

/* =========================
   Destaque Home (slider)
========================= */

.ml-destaque {
  position: relative;
  overflow: hidden;
  max-width: 700px;
  margin: 30px auto;
  background-color: #fff3cd;
  border-left: 6px solid #ffc107;
  border-radius: 8px;
  padding: 20px;
  color: #856404;
  box-sizing: border-box;
}

.ml-destaque-wrapper {
  display: flex;
  width: 100%;
  transition: transform 0.5s ease;
  will-change: transform;
}

.ml-destaque-slide {
  flex: 0 0 100%;
  box-sizing: border-box;
  padding-right: 20px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.ml-destaque-slide.active {
  opacity: 1;
}

.ml-destaque-dots {
  text-align: center;
  margin-top: 15px;
}

.ml-destaque-dots .dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 6px;
  background-color: #ffc107;
  border-radius: 50%;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ml-destaque-dots .dot.active {
  opacity: 1;
  transform: scale(1.2);
}

/* =========================
   Menu dropdown usuário
========================= */

.menu-container {
  position: relative;
  display: inline-block;
}

.menu-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
}

.menu-opcoes {
  display: block;
  position: absolute;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  padding: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 10;
  min-width: 180px;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.menu-opcoes form {
  margin: 4px 0;
}

.menu-container.show .menu-opcoes {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-divider {
  border: none;
  border-top: 1px solid #ddd;
  margin: 8px 0;
}

/* Mobile menu-opcoes (modalzinho) */

@media (max-width: 600px) {
  .ml-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .menu-opcoes {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 260px;
    width: 80%;
    border-radius: 8px;
    padding: 16px;
  }

  .menu-opcoes::before {
    content: "⚙️ Ações do usuário";
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
  }

  .menu-opcoes form {
    margin: 10px 0;
  }
}

/* =========================
   Painel Administrativo
========================= */

.painel-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.painel-container h2.ml-title {
  font-size: 2rem;
  color: var(--ml-blue-dark);
  margin-bottom: 1.5rem;
  text-align: center;
}

.painel-header {
  background-color: #f0f4ff;
  padding: 1em;
  border-bottom: 2px solid #ccc;
  text-align: center;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1em;
}

.user-card {
  background-color: #fff;
  border: 1px solid #ddd;
  padding: 1em;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.user-card.admin {
  border-left: 5px solid #007bff;
}

.user-actions form {
  margin-top: 0.5em;
}

.painel-massa {
  margin-top: 40px;
  padding: 20px;
  border-top: 2px dashed #ccc;
}

.painel-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}

/* pódio */

.ml-podio {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 2em;
  margin: 2em 0;
}

.ml-podio-item {
  text-align: center;
  padding: 1em;
  border-radius: 8px;
  background-color: #f0f4ff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 120px;
}

.ml-podio-item.primeiro {
  background-color: #ffeaa7;
  transform: scale(1.1);
}

.ml-podio-item.segundo {
  background-color: #dfe6e9;
}

.ml-podio-item.terceiro {
  background-color: #fab1a0;
}

.ml-podio-posicao {
  font-size: 2em;
}

.ml-podio-nome {
  font-weight: bold;
  margin-top: 0.5em;
}

.ml-podio-pontos {
  font-size: 1.2em;
  margin-top: 0.25em;
}

/* =========================
   Responsividade geral
========================= */

@media (max-width: 1024px) {
  .ml-container {
    margin: 20px;
    padding: 15px;
  }

  .ml-title {
    font-size: 22px;
  }

  .ml-banner-content h1 {
    font-size: 28px;
  }

  .ml-banner-content p {
    font-size: 16px;
  }

  .ml-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .ml-form-container {
    margin: 20px auto;
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .ml-banner {
    padding: 40px 15px;
  }

  .ml-banner-content h1 {
    font-size: 24px;
  }

  .ml-banner-content p {
    font-size: 15px;
  }

  .ml-btn,
  .ml-form-actions .ml-btn {
    width: 100%;
    text-align: center;
  }

  .ml-table th,
  .ml-table td {
    font-size: 13px;
    padding: 8px;
  }

  .quiz-container {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .ml-title {
    font-size: 20px;
  }

  .ml-banner-content h1 {
    font-size: 20px;
  }

  .ml-banner-content p {
    font-size: 14px;
  }

  .ml-card-title {
    font-size: 16px;
  }

  .ml-card-desc {
    font-size: 13px;
  }

  .ml-btn {
    font-size: 14px;
    padding: 8px 16px;
  }

  .ml-form-container {
    padding: 15px;
  }

  .ml-form-container h2 {
    font-size: 20px;
  }

  .ml-form-group input {
    font-size: 13px;
    padding: 8px;
  }

  .ml-footer {
    font-size: 13px;
    padding: 10px;
  }
}

/* =========================
   Dark mode (complemento)
========================= */

/* 1) Troca a paleta base quando o dark mode está ativo */
body.dark-mode {
  --ml-bg: #0f1115;
  --ml-text: #f5f5f5;
  --ml-muted: #9ca3af;
  --ml-border: #2d2d2d;

  background-color: var(--ml-bg);
  color: var(--ml-text);
}

/* 2) Header / Nav / Footer / Banner */

body.dark-mode .ml-header {
  background: #111827;
  border-bottom: 3px solid var(--ml-blue-dark);
  box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

body.dark-mode .ml-logo,
body.dark-mode .ml-user {
  color: var(--ml-text);
}

body.dark-mode .ml-nav {
  background: transparent;
}

body.dark-mode .ml-nav .ml-link {
  color: var(--ml-text);
}

body.dark-mode .ml-nav .ml-link:hover {
  background: var(--ml-blue-dark);
  color: #fff;
}

@media (max-width: 900px) {
  body.dark-mode .ml-nav {
    background: #020617;
    border: 1px solid #1f2937;
  }
}

body.dark-mode .ml-menu-toggle,
body.dark-mode .ml-theme-toggle {
  border-color: var(--ml-blue);
  color: var(--ml-blue);
}

body.dark-mode .ml-menu-toggle:hover,
body.dark-mode .ml-theme-toggle:hover {
  background: var(--ml-blue);
  color: #fff;
}

/* Banner */

body.dark-mode .ml-banner {
  background: linear-gradient(90deg, #020617 0%, #020617 100%);
}

body.dark-mode .ml-banner-content h1 {
  color: var(--ml-text);
}

body.dark-mode .ml-banner-content p {
  color: var(--ml-muted);
}

/* Footer */

body.dark-mode .ml-footer {
  background: #020617;
  color: var(--ml-muted);
  border-top: 3px solid var(--ml-blue-dark);
}

/* 3) Containers, cards, forms */

body.dark-mode .ml-container,
body.dark-mode .ml-form-container,
body.dark-mode .ml-card,
body.dark-mode .ml-question,
body.dark-mode .quiz-container,
body.dark-mode .ml-quiz-container,
body.dark-mode .ranking-container,
body.dark-mode .painel-container,
body.dark-mode .user-card {
  background: #111827;
  border-color: #27272f;
  color: var(--ml-text);
}

body.dark-mode .ml-title,
body.dark-mode .ml-card-title,
body.dark-mode .ml-card-desc,
body.dark-mode .ml-form-group label,
body.dark-mode .ml-form-footer,
body.dark-mode .quiz-title {
  color: var(--ml-text);
}

body.dark-mode .ml-card-desc,
body.dark-mode .ml-info,
body.dark-mode .error-message {
  color: var(--ml-muted);
}

body.dark-mode .ml-form {
  background: #020617;
  border-left-color: #22c55e;
}

body.dark-mode .quiz-question {
  background-color: #020617;
  border-color: #1f2933;
}

/* 4) Inputs / selects / textareas */

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background-color: #020617;
  color: var(--ml-text);
  border: 1px solid #374151;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #6b7280;
}

/* 5) Botões */

body.dark-mode .ml-btn {
  background-color: #1f2933;
  color: var(--ml-text);
  border: 1px solid #374151;
}

body.dark-mode .ml-btn:hover {
  background-color: #111827;
}

body.dark-mode .ml-btn.primary {
  background-color: var(--ml-blue-dark);
  color: #fff;
}

body.dark-mode .ml-btn.primary:hover {
  background-color: #1d4ed8;
}

body.dark-mode .ml-btn.danger {
  background-color: #b91c1c;
  color: #fff;
}

body.dark-mode .ml-btn.success {
  background-color: #15803d;
  color: #fff;
}

body.dark-mode .ml-btn.info {
  background-color: #0369a1;
  color: #fff;
}

/* 6) Tabelas padrão e ml-table */

body.dark-mode .ml-table {
  background-color: #020617;
  border-color: #1f2937;
}

body.dark-mode .ml-table th {
  background: #111827;
  color: #e5e7eb;
}

body.dark-mode .ml-table tr:nth-child(even) {
  background: #020617;
}

body.dark-mode .ml-table tr:hover {
  background: #111827;
}

/* tabelas genéricas (usadas nas correções escritas) */
body.dark-mode table {
  background-color: #020617;
  border-color: #1f2937;
}

body.dark-mode th {
  background-color: #111827;
  color: #e5e7eb;
}

body.dark-mode td {
  border-color: #1f2937;
}

/* células corretas/parciais/incorretas ainda com contraste bom */
body.dark-mode td.correta {
  background-color: #14532d;
  color: #bbf7d0;
}

body.dark-mode td.parcial {
  background-color: #78350f;
  color: #ffedd5;
}

body.dark-mode td.incorreta {
  background-color: #7f1d1d;
  color: #fecaca;
}

/* 7) Alert / Toast */

body.dark-mode .ml-alert {
  background-color: #1f2933;
  color: var(--ml-text);
  border-color: #4b5563;
}

body.dark-mode .ml-alert-close {
  color: var(--ml-text);
}

/* 8) Destaques / cards especiais */

body.dark-mode .ml-card.safety {
  background-color: #3b2a16;
  border-left-color: #ff9800;
}

body.dark-mode .ml-card.safety h3 {
  color: #ffcc80;
}

body.dark-mode .ml-card.safety .ml-btn {
  background-color: #ff9800;
  color: #000;
}

body.dark-mode .ml-destaque {
  background-color: #3b2a16;
  border-left-color: #ffc107;
  color: #ffe9b5;
}

/* 9) Ranking */

body.dark-mode .ranking-container {
  background: #111827;
}

body.dark-mode .ranking-title {
  color: var(--ml-blue);
}

body.dark-mode .ranking-table th {
  background: #111827;
  color: var(--ml-text);
}

body.dark-mode .ranking-table tr:nth-child(even) {
  background: #020617;
}

body.dark-mode .ranking-table tr:hover {
  background: #111827;
}

/* 10) Pódio */

body.dark-mode .ml-podio-item {
  background-color: #020617;
  color: var(--ml-text);
}

body.dark-mode .ml-podio-item.primeiro {
  background-color: #43302b;
}

body.dark-mode .ml-podio-item.segundo {
  background-color: #374151;
}

body.dark-mode .ml-podio-item.terceiro {
  background-color: #4b3621;
}

/* =======================================
   QUICK LINKS DO TOPO (layout.ejs)
======================================= */

.ml-quick-links {
  max-width: 1200px;
  margin: 15px auto 0 auto;
  padding: 10px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
}

.ml-quick-card {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 14px 10px;
  text-decoration: none;
  color: #333;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all .18s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.ml-quick-card .icon {
  font-size: 26px;
}

.ml-quick-card .label {
  font-weight: 600;
  font-size: 14px;
}

.ml-quick-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
  border-color: var(--ml-blue);
}

.ml-quick-card.admin {
  border-left: 4px solid var(--ml-blue);
}

/* Dark mode quick links */
body.dark-mode .ml-quick-card {
  background: #111827;
  border-color: #1f2937;
  color: #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

body.dark-mode .ml-quick-card:hover {
  background: #1a1f2c;
  border-color: var(--ml-blue-dark);
}

/* Responsivo quick links */
@media (max-width: 600px) {
  .ml-quick-links {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    padding: 6px 12px;
    gap: 10px;
  }
}