/* =========================================================================
   Sistema de Revisao Online — SENAI MG
   Identidade visual: "Circuito" — navy profundo + ciano eletrico + dourado
   ========================================================================= */

:root {
  --navy-950: #0a1220;
  --navy-900: #0f1b2e;
  --navy-800: #16273f;
  --navy-700: #1e3552;
  --navy-600: #2a4568;
  --cyan-400: #35d0e0;
  --cyan-300: #6fe4ef;
  --gold-400: #e0b04a;
  --gold-300: #f0c869;
  --green-500: #2ecc71;
  --red-500: #e74c3c;
  --gray-100: #f4f7fb;
  --gray-200: #e6ebf2;
  --gray-400: #9aa8bd;
  --gray-600: #5b6b82;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 99px;
  --shadow-card: 0 10px 30px rgba(10, 18, 32, 0.10), 0 2px 8px rgba(10, 18, 32, 0.06);
  --shadow-card-hover: 0 16px 40px rgba(10, 18, 32, 0.16), 0 4px 12px rgba(10, 18, 32, 0.08);
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font);
  background: var(--gray-100);
  color: var(--navy-900);
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* Impede selecao de texto no enunciado / alternativas (protecao anti-copia) */
.no-select {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* ===================== TELAS DE AUTENTICACAO (login/cadastro) ===================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 20% 20%, var(--navy-800), var(--navy-950) 70%);
}

/* --- LADO ESQUERDO (imagem de fundo — nao mexer no formulario branco) ---
   No celular a imagem fica em cima (reduzida), formulario embaixo.
   A partir de 960px vira lado a lado, imagem ocupando 2/3 da largura. */
.auth-visual {
  display: block;
  position: relative;
  overflow: hidden;
  height: 200px;
  min-height: 200px;
  background-image: url('../img/auth-visual-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

@media (min-width: 960px) {
  .auth-page { flex-direction: row; }
  .auth-visual {
    flex: 2;
    height: auto;
    min-height: auto;
    display: flex;
    background-size: contain;   /* no desktop, nunca corta — melhor sobrar faixa de fundo que cortar gente/texto */
    background-color: var(--navy-950);
  }
}

.auth-visual .brand {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 640px;
}

.auth-visual .brand .tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--cyan-300);
  background: rgba(53, 208, 224, 0.1);
  border: 1px solid rgba(111, 228, 239, 0.35);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 28px;
  box-shadow: 0 4px 15px rgba(53, 208, 224, 0.15);
}

.sga-hero-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.sga-mark-large {
  font-size: 87px;
  font-weight: 900;
  letter-spacing: 8px;
  line-height: 0.95;
  background: linear-gradient(135deg, var(--cyan-300) 0%, #ffffff 50%, var(--gold-300) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 20px rgba(53, 208, 224, 0.25));
}

.sga-hero-title {
  font-size: 31px;
  font-weight: 800;
  color: var(--white);
  line-height: 1.3;
  margin-top: 10px;
}

.sga-hero-title span {
  color: var(--cyan-300);
}

.sga-description {
  color: var(--gray-400);
  font-size: 21.5px;
  line-height: 1.6;
  margin-top: 14px;
  font-weight: 400;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 36px;
}

.feature-card {
  background: rgba(22, 39, 63, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: rgba(111, 228, 239, 0.3);
  background: rgba(30, 53, 82, 0.65);
}

.feature-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(53, 208, 224, 0.2), rgba(15, 27, 46, 0.8));
  border: 1px solid rgba(53, 208, 224, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  flex-shrink: 0;
  color: var(--cyan-300);
}

.feature-card .info h4 {
  margin: 0 0 4px;
  font-size: 19.5px;
  font-weight: 700;
  color: var(--white);
}

.feature-card .info p {
  margin: 0;
  font-size: 18px;
  color: var(--gray-400);
  line-height: 1.45;
}

.ranking-teaser {
  margin-top: 24px;
  background: linear-gradient(135deg, rgba(15, 27, 46, 0.9), rgba(22, 39, 63, 0.8));
  border: 1px solid rgba(224, 176, 74, 0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ranking-teaser .left-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ranking-teaser .trophy {
  font-size: 29px;
}

.ranking-teaser .text h5 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  color: var(--gold-300);
}

.ranking-teaser .text p {
  margin: 2px 0 0;
  font-size: 17px;
  color: var(--gray-400);
}

.ranking-podium-dots {
  display: flex;
  gap: 6px;
}

.podium-pill {
  font-size: 16px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.podium-pill.p1 { background: var(--gold-400); color: var(--navy-950); }
.podium-pill.p2 { background: #b9c2cf; color: var(--navy-950); }
.podium-pill.p3 { background: #cd8a5c; color: var(--white); }

.auth-visual .footer-note {
  position: relative;
  z-index: 2;
  color: rgba(255, 255, 255, 0.45);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
  margin-top: 30px;
}

/* --- LADO DIREITO (FORMULÁRIO MANTIDO INTACTO) --- */
.auth-form-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--white);
}
.auth-card {
  width: 100%;
  max-width: 400px;
}
.auth-card .logo-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
.auth-card .logo-mini .dot {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--cyan-400), var(--navy-700));
  display: flex; align-items: center; justify-content: center;
  color: var(--white); font-weight: 800; font-size: 20px;
}
.auth-card .logo-mini span {
  font-weight: 700; color: var(--navy-900); font-size: 20px;
}
.auth-card h2 {
  font-size: 29px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--navy-900);
}
.auth-card .sub {
  color: var(--gray-600);
  font-size: 19px;
  margin-bottom: 26px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--gray-600);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 19.5px;
  color: var(--navy-900);
  background: var(--gray-100);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--cyan-400);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(53,208,224,0.14);
}
.form-group select,
select.select-premium {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 19.5px;
  font-weight: 600;
  color: var(--navy-900);
  background-color: var(--gray-100);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23425466' d='M1 1l5 5 5-5' stroke='%23425466' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}
.form-group select:focus {
  outline: none;
  border-color: var(--cyan-400);
  background-color: var(--white);
  box-shadow: 0 0 0 4px rgba(53,208,224,0.14);
}
.form-group select:hover {
  border-color: var(--cyan-300);
}
.form-group select option {
  font-weight: 600;
  color: var(--navy-900);
}
.form-group .hint {
  font-size: 17px;
  color: var(--gray-400);
  margin-top: 5px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-weight: 700;
  font-size: 19.5px;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .15s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: var(--white);
  box-shadow: 0 8px 20px rgba(15,27,46,0.25);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(15,27,46,0.32); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-400));
  color: var(--navy-950);
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-200);
  color: var(--navy-800);
}
.btn-danger { background: var(--red-500); color: var(--white); }
.btn-sm { padding: 8px 14px; font-size: 18px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.auth-switch {
  text-align: center;
  margin-top: 22px;
  font-size: 18.5px;
  color: var(--gray-600);
}
.auth-switch a { color: var(--cyan-400); font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; }

.alert {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 18.5px;
  margin-bottom: 16px;
  font-weight: 600;
}
.alert-error { background: #fdeceb; color: #a5271e; border: 1px solid #f6c6c2; }
.alert-success { background: #e8f8ee; color: #1c7a41; border: 1px solid #b9e8c9; }
.alert-info { background: #eaf7fb; color: #1a6d80; border: 1px solid #bfe6ee; }

/* ===================== TOPBAR (aluno) ===================== */

.topbar {
  background: var(--navy-950);
  color: var(--white);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px;
}
.topbar .brand .dot {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan-400), var(--navy-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.topbar .user-chip {
  display: flex; align-items: center; gap: 10px;
  font-size: 18.5px; color: var(--gray-400);
}
.topbar .user-chip strong { color: var(--white); }
.topbar .logout-link {
  color: var(--gray-400);
  font-size: 18px;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 12px;
  border-radius: 999px;
  transition: all .15s;
}
.topbar .logout-link:hover { color: var(--white); border-color: rgba(255,255,255,0.4); }

/* ===================== QUIZ (pergunta por pagina) ===================== */

.quiz-shell {
  min-height: 100vh;
  background: var(--gray-100);
  display: flex;
  flex-direction: column;
}
.quiz-shell {
  --fonte-escala: 1;
}
.quiz-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 16px 50px;
}
.quiz-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  max-width: 1280px;
}
.quiz-card {
  min-width: 0;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  flex: 2 1 0%;
}
.quiz-progress-wrap {
  padding: 26px 34px 0;
}
.quiz-progress-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.quiz-progress-top .tema-badge {
  font-size: calc(17px * var(--fonte-escala));
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--navy-700);
  background: var(--gray-200);
  padding: 5px 11px;
  border-radius: 999px;
}
.quiz-progress-top .contador {
  font-size: calc(19px * var(--fonte-escala));
  color: var(--gray-600);
  font-weight: 700;
}
.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-400), var(--gold-400));
  border-radius: 999px;
  transition: width .3s ease;
}

.quiz-body { padding: 30px 34px 34px; }
.quiz-question {
  font-size: calc(26px * var(--fonte-escala));
  font-weight: 800;
  line-height: 1.5;
  color: var(--navy-900);
  margin: 0 0 20px;
}
.quiz-img-tip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: calc(18px * var(--fonte-escala));
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px dashed var(--gray-200);
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
}

.alt-list { display: flex; flex-direction: column; gap: 13px; }
.alt-option {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 18px 20px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  background: var(--white);
}
.alt-option:hover { border-color: var(--cyan-300); background: #f3fdfe; }
.alt-option.selecionada {
  border-color: var(--cyan-400);
  background: #edfbfd;
  box-shadow: 0 0 0 3px rgba(53,208,224,0.15);
}
.alt-option .letra {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--gray-100);
  color: var(--navy-700);
  font-weight: 800;
  font-size: calc(19px * var(--fonte-escala));
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--gray-200);
}
.alt-option.selecionada .letra {
  background: var(--navy-900);
  color: var(--white);
  border-color: var(--navy-900);
}
.alt-option .texto { font-size: calc(21px * var(--fonte-escala)); color: var(--navy-900); padding-top: 6px; line-height: 1.5; }
.alt-option input[type="radio"] { display: none; }

.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 30px 26px;
  border-top: 1px solid var(--gray-200);
  gap: 10px;
}
.quiz-nav .grupo-dir { display: flex; gap: 10px; }

.quiz-warning {
  max-width: 720px;
  margin: 18px auto 0;
  padding: 12px 18px;
  background: #fff8e8;
  border: 1px solid #f3dfa8;
  color: #8a6412;
  border-radius: var(--radius-sm);
  font-size: 18px;
  text-align: center;
  font-weight: 600;
}

/* ===================== RESULTADO (aluno) ===================== */

.resultado-hero {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  padding: 46px 20px 60px;
  text-align: center;
}
.resultado-hero .pct {
  font-size: 57px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan-300), var(--gold-300));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.resultado-hero h2 { margin: 6px 0 4px; font-size: 25px; }
.resultado-hero p { color: var(--gray-400); font-size: 19px; margin: 0; }

.resultado-container {
  max-width: 760px;
  margin: -34px auto 60px;
  padding: 0 16px;
}
.resultado-resumo {
  display: flex;
  gap: 14px;
  margin-bottom: 26px;
}
.resultado-resumo .mini-card { flex: 1 1 0; }
.mini-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px;
  text-align: center;
}
.mini-card .num { font-size: 31px; font-weight: 900; }
.mini-card .lbl { font-size: 17px; color: var(--gray-600); font-weight: 700; text-transform: uppercase; margin-top: 4px; }
.mini-card.acertos .num { color: var(--green-500); }
.mini-card.parcial .num { color: var(--gold-400); }
.mini-card.erros .num { color: var(--red-500); }
.mini-card.total .num { color: var(--navy-700); }

.rev-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 12px;
  border-left: 5px solid var(--gray-200);
}
.rev-item.ok { border-left-color: var(--green-500); }
.rev-item.errado { border-left-color: var(--red-500); }
.rev-item.pendente { border-left-color: #f0c94a; }
.rev-item.parcial { border-left-color: var(--gold-400); }
.rev-item .rev-q { font-weight: 700; font-size: 19.5px; margin-bottom: 8px; }
.rev-item .rev-alt { font-size: 18.5px; padding: 3px 0; display: flex; gap: 6px; align-items: flex-start; }
.rev-item .rev-alt .tagcheck { font-weight: 800; font-size: 16px; }
.rev-alt.correta-alt .tagcheck { color: var(--green-500); }
.rev-alt.marcada-errada .tagcheck { color: var(--red-500); }
.rev-item.parcial .tagcheck { color: var(--gold-400); }

.rev-nota-questao {
  font-size: 14px;
  font-weight: 600;
  color: var(--navy-700);
  background: #f7f8fb;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 7px 12px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rev-nota-questao strong { color: var(--navy-950); font-size: 15px; }
.badge-parcial {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--navy-950);
  background: linear-gradient(135deg, var(--gold-300), var(--gold-400));
  padding: 2px 9px;
  border-radius: 999px;
}

/* ===================== PAINEL DO PROFESSOR ===================== */

.painel-shell { display: flex; min-height: 100vh; }
.painel-sidebar {
  width: 250px;
  background: var(--navy-950);
  color: var(--white);
  flex-shrink: 0;
  padding: 22px 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.painel-sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 22px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 16px;
}
.painel-sidebar .brand .dot {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--cyan-400), var(--navy-700));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
}
.painel-sidebar .brand span { font-weight: 800; font-size: 19px; }
.painel-sidebar nav { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 0 12px; overflow-y: auto; min-height: 0; }
.painel-sidebar nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 18.5px;
  font-weight: 600;
  color: var(--gray-400);
  transition: background .15s, color .15s;
}
.painel-sidebar nav a:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.painel-sidebar nav a.ativo { background: linear-gradient(135deg, var(--cyan-400), var(--navy-700)); color: var(--white); }
.painel-sidebar .rodape {
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.painel-sidebar .rodape .prof-nome { font-size: 18px; font-weight: 700; color: var(--white); }
.painel-sidebar .rodape a { font-size: 17.5px; color: var(--gray-400); }
.painel-sidebar .rodape a:hover { color: var(--white); }

/* Topbar mobile (hamburguer) — escondida no desktop */
.painel-topbar-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: var(--navy-950);
  color: var(--white);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.painel-topbar-mobile .brand-mini { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; }
.painel-topbar-mobile .brand-mini .dot {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--cyan-400), var(--navy-700));
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.hamburguer-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px;
  cursor: pointer;
}
.painel-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,18,32,0.55);
  z-index: 45;
}
.painel-backdrop.aberto { display: block; }

.painel-main { flex: 1; background: var(--gray-100); min-width: 0; }
.painel-topo {
  background: var(--white);
  padding: 18px 32px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.painel-topo h1 { font-size: 24px; margin: 0; font-weight: 800; }
.painel-conteudo { padding: 28px 32px 60px; }

.stat-grid { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px;
  flex: 1 1 180px;
  min-width: 180px;
}
.stat-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stat-card .icon-box {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: var(--gray-100);
}
.stat-card .num { font-size: 33px; font-weight: 900; color: var(--navy-900); }
.stat-card .lbl { font-size: 17.5px; color: var(--gray-600); font-weight: 700; }

.panel-box {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.panel-box h3 { margin: 0 0 16px; font-size: 20.5px; font-weight: 800; }

.ranking-list { display: flex; flex-direction: column; gap: 10px; }
.ranking-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--gray-100);
}
.ranking-item .pos {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 19px;
  color: var(--white);
}
.ranking-item:nth-child(1) .pos { background: linear-gradient(135deg, var(--gold-300), var(--gold-400)); color: var(--navy-950); }
.ranking-item:nth-child(2) .pos { background: #b9c2cf; color: var(--navy-950); }
.ranking-item:nth-child(3) .pos { background: #cd8a5c; color: var(--white); }
.ranking-item .info { flex: 1; }
.ranking-item .info .nome { font-weight: 700; font-size: 19px; }
.ranking-item .info .user { font-size: 17px; color: var(--gray-600); }
.ranking-item .score { font-weight: 900; font-size: 21px; color: var(--navy-700); }

.tabela-alunos { width: 100%; border-collapse: collapse; font-size: 18.5px; }
.tabela-alunos th {
  text-align: left; padding: 11px 14px;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 16.5px;
  text-transform: uppercase;
  letter-spacing: .3px;
  font-weight: 800;
}
.tabela-alunos td { padding: 12px 14px; border-bottom: 1px solid var(--gray-200); }
.tabela-alunos tr:last-child td { border-bottom: none; }
.tabela-alunos tr:hover td { background: #fafcff; }
.tabela-alunos td a.link-aluno {
  color: var(--cyan-600, #0a7ea4);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color .15s;
}
.tabela-alunos td a.link-aluno:hover { text-decoration-color: currentColor; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 16.5px; font-weight: 800; }
.badge-concluida { background: #e8f8ee; color: #1c7a41; }
.badge-andamento { background: #fff4de; color: #a06a11; }
.badge-nao_iniciada { background: var(--gray-200); color: var(--gray-600); }

.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .form-group { margin-bottom: 0; flex: 1; min-width: 220px; }

.codigo-atual {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}
.codigo-atual .val { font-size: 29px; font-weight: 900; letter-spacing: 1px; font-family: monospace; }
.codigo-atual .lbl { font-size: 17px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; }

@media (max-width: 860px) {
  .painel-topbar-mobile { display: flex; }

  .painel-sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 260px;
    max-width: 82vw;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 50;
    height: 100vh;
    overflow: hidden;
  }
  .painel-sidebar.aberta { transform: translateX(0); }

  .painel-topo { padding: 16px 18px; }
  .painel-topo h1 { font-size: 22px; }
  .painel-conteudo { padding: 18px 14px 50px; }

  .stat-grid { gap: 10px; }
  .stat-card { flex: 1 1 100%; min-width: 0; }
  .resultado-resumo { flex-direction: column; }

  .form-inline { flex-direction: column; align-items: stretch; }
  .form-inline .form-group { min-width: 0; width: 100%; }
  .form-inline .btn { width: 100%; }

  .codigo-atual { flex-direction: column; align-items: flex-start; gap: 10px; }
  .codigo-atual .val { font-size: 25px; word-break: break-all; }

  /* Tabelas: permite rolar horizontalmente em vez de espremer colunas */
  .tabela-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabela-alunos { min-width: 640px; }

  .quiz-nav { flex-wrap: wrap; gap: 10px; }
  .quiz-nav .grupo-dir { width: 100%; }
  .quiz-nav .grupo-dir .btn { flex: 1; }

  .painel-cards-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .quiz-body { padding: 20px 18px 24px; }
  .quiz-question { font-size: 22px; }
  .resultado-hero { padding: 34px 16px 46px; }
  .resultado-hero .pct { font-size: 45px; }
}

/* ===================== CARDS DE TURMA / UC ===================== */

.painel-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.entidade-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.entidade-card .topo-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.entidade-card h4 { margin: 0; font-size: 20px; font-weight: 800; color: var(--navy-900); line-height: 1.35; }
.entidade-card .codigo-chip {
  font-family: monospace; font-weight: 800; font-size: 18px;
  background: var(--gray-100); border: 1px solid var(--gray-200);
  padding: 4px 9px; border-radius: 7px; display: inline-block;
  word-break: break-all;
}
.entidade-card .meta { font-size: 17.5px; color: var(--gray-600); display: flex; gap: 12px; flex-wrap: wrap; }
.entidade-card .acoes { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.entidade-card .acoes .btn { flex: 1; min-width: 90px; }

.badge-off { background: var(--gray-200); color: var(--gray-600); }
.badge-on { background: #e8f8ee; color: #1c7a41; }

/* ===================== BARRA DE FILTROS ===================== */

.filtro-bar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin-bottom: 20px;
}
.filtro-bar form { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filtro-bar .form-group { flex: 1 1 160px; min-width: 140px; margin-bottom: 0; }
.filtro-bar .form-group select,
.filtro-bar .form-group input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); font-size: 18.5px; background: var(--gray-100);
}
.filtro-bar .form-group select:focus, .filtro-bar .form-group input:focus {
  outline: none; border-color: var(--cyan-400); background: var(--white);
}
.filtro-bar .btn { flex-shrink: 0; }

/* ===================== TOGGLE (ativar/desativar UC p/ turma) ===================== */

.toggle-linha {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--gray-100); margin-bottom: 8px; gap: 10px; flex-wrap: wrap;
}
.toggle-linha .nome-uc { font-weight: 700; font-size: 18.5px; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--gray-200); border-radius: 999px; transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.switch input:checked + .slider { background: var(--green-500); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ===================== FORMULARIO DE PERGUNTA (CRUD + imagem) ===================== */

.form-pergunta-grid { display: flex; flex-direction: column; gap: 16px; }
.upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  background: var(--gray-100);
}
.upload-area img { max-width: 100%; max-height: 220px; border-radius: var(--radius-sm); margin-bottom: 10px; }
.upload-area input[type=file] { font-size: 18px; }
.upload-area .remover-img { margin-top: 8px; }

.alt-editor-linha {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  margin-bottom: 9px; background: var(--white);
}
.alt-editor-linha .letra-fixa {
  width: 30px; height: 30px; border-radius: 8px; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
  flex-shrink: 0;
}
.alt-editor-linha input[type=text] {
  flex: 1; border: none; background: transparent; font-size: 19px; padding: 6px 2px;
}
.alt-editor-linha input[type=text]:focus { outline: none; }
.alt-editor-linha .correta-radio { flex-shrink: 0; display: flex; align-items: center; gap: 6px; font-size: 17px; color: var(--gray-600); font-weight: 700; }

/* ===================== ATIVIDADES DO ALUNO (hub multi-UC) ===================== */

.atividade-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.atividade-card .info h4 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.atividade-card .info .status-linha { font-size: 17.5px; color: var(--gray-600); }
.atividade-card .acao { flex-shrink: 0; }

@media (max-width: 480px) {
  .atividade-card { flex-direction: column; align-items: stretch; }
  .atividade-card .acao .btn { width: 100%; }
}

/* ===================== CONTROLE DE FONTE (acessibilidade) ===================== */

.controle-fonte {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 4px 6px;
}
.controle-fonte button {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.controle-fonte button:hover { background: rgba(255,255,255,0.22); }
.controle-fonte .rotulo { font-size: 15.5px; color: var(--gray-400); padding: 0 2px; }

/* ===================== GABARITO LATERAL (desktop) ===================== */

.gabarito-panel {
  flex: 1 1 0%;
  min-width: 220px;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 22px;
  position: sticky;
  top: 20px;
  display: none;
}
@media (min-width: 1020px) {
  .gabarito-panel { display: block; }
}
.gabarito-panel h4 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 800;
  color: var(--navy-900);
}
.gabarito-panel .sub { font-size: 16.5px; color: var(--gray-600); margin-bottom: 16px; }
.gabarito-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 10px;
}
.gabarito-item {
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform .12s;
  box-shadow: 0 2px 5px rgba(10,18,32,0.12);
}
.gabarito-item:hover { transform: scale(1.1); }
.gabarito-item.nao-respondida {
  background: var(--red-500);
  color: #1a0a08;
  font-weight: 900;
}
.gabarito-item.respondida {
  background: var(--cyan-400);
  color: var(--white);
  font-weight: 900;
}
.gabarito-item.atual {
  border-color: var(--navy-900);
  box-shadow: 0 0 0 3px rgba(15,27,46,0.2);
}
.gabarito-legenda { display: flex; gap: 14px; margin-top: 16px; font-size: 16.5px; color: var(--gray-600); flex-wrap: wrap; }
.gabarito-legenda span { display: flex; align-items: center; gap: 6px; }
.gabarito-legenda .quadro { width: 13px; height: 13px; border-radius: 50%; display: inline-block; }

.gabarito-mobile-toggle {
  display: none;
  width: 100%;
  max-width: 760px;
  margin-bottom: 14px;
}
@media (max-width: 1019px) {
  .gabarito-mobile-toggle { display: block; }
}
.gabarito-mobile-toggle summary {
  cursor: pointer;
  background: var(--white);
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 18.5px;
  box-shadow: var(--shadow-card);
  list-style: none;
}
.gabarito-mobile-toggle summary::-webkit-details-marker { display: none; }
.gabarito-mobile-toggle[open] summary { border-radius: 14px 14px 0 0; }
.gabarito-mobile-toggle .gabarito-panel {
  display: block;
  position: static;
  border-radius: 0 0 14px 14px;
  box-shadow: var(--shadow-card);
}

/* ===================== CARD INTRODUTORIO ===================== */

.intro-overlay {
  position: fixed; inset: 0;
  background: rgba(10,18,32,0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
}
.intro-card {
  background: var(--white);
  border-radius: 20px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.intro-card .cabecalho {
  padding: 26px 30px 18px;
  border-bottom: 1px solid var(--gray-200);
}
.intro-card .cabecalho h2 { margin: 0 0 6px; font-size: 25px; font-weight: 800; }
.intro-card .cabecalho p { margin: 0; font-size: 18.5px; color: var(--gray-600); }
.intro-card .corpo {
  padding: 22px 30px;
  overflow-y: auto;
  font-size: 19.5px;
  line-height: 1.7;
  color: var(--navy-900);
  white-space: pre-wrap;
}
.intro-card .rodape {
  padding: 18px 30px 26px;
  border-top: 1px solid var(--gray-200);
}
.intro-card .aceite-linha {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 18.5px; font-weight: 600; color: var(--navy-900);
  margin-bottom: 16px; cursor: pointer;
}
.intro-card .aceite-linha input { margin-top: 3px; }

/* ===================== RANKING (aluno) ===================== */

.ranking-select-bar {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.ranking-select-bar form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.ranking-select-bar select {
  padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 19px; background: var(--gray-100); min-width: 240px;
}

.minha-posicao-card {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.minha-posicao-card .num-posicao {
  font-size: 29px; font-weight: 900;
  line-height: 1.3;
  background: linear-gradient(135deg, var(--cyan-300), var(--gold-300));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.minha-posicao-card .detalhes .lbl { font-size: 16.5px; color: var(--gray-400); text-transform: uppercase; letter-spacing: .4px; }
.minha-posicao-card .detalhes .val { font-size: 25px; font-weight: 800; }

.podio-top3 { display: flex; flex-direction: column; gap: 10px; }
.podio-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 14px 18px;
}
.podio-item .medalha {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; flex-shrink: 0;
}
.podio-item:nth-child(1) .medalha { background: linear-gradient(135deg, var(--gold-300), var(--gold-400)); color: var(--navy-950); }
.podio-item:nth-child(2) .medalha { background: #c3cbd6; color: var(--navy-950); }
.podio-item:nth-child(3) .medalha { background: #d09666; color: var(--white); }
.podio-item .nome { font-weight: 700; font-size: 19.5px; flex: 1; }
.podio-item .pontuacao { font-weight: 900; font-size: 21px; color: var(--navy-700); }
.podio-item.eh-voce { border: 2px solid var(--cyan-400); background: #f3fdfe; }
.podio-item.eh-voce .nome::after { content: " (você)"; font-weight: 600; color: var(--cyan-400); font-size: 17px; }

/* ===================== LOG DE INTERACAO & PDF ===================== */

.linha-suspeita td { background: #fdeceb !important; color: #a5271e; font-weight: 700; }

.pdf-preview-item {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin-bottom: 12px;
  border-left: 5px solid var(--green-500);
}
.pdf-preview-item.invalida { border-left-color: var(--red-500); background: #fff8f7; }
.pdf-preview-item .num-q { font-weight: 800; font-size: 18px; color: var(--gray-600); margin-bottom: 6px; }
.pdf-preview-item .enun { font-weight: 700; font-size: 19.5px; margin-bottom: 8px; }
.pdf-preview-item .alt-linha { font-size: 18px; padding: 3px 0; color: var(--navy-900); }
.pdf-preview-item .alt-linha.certa { color: var(--green-500); font-weight: 700; }
.pdf-preview-item .erro-msg { color: var(--red-500); font-size: 17.5px; font-weight: 700; margin-top: 6px; }

@media (max-width: 480px) {
  .gabarito-grid { grid-template-columns: repeat(6, 1fr); }
  .intro-card .corpo { padding: 18px 20px; }
  .minha-posicao-card { flex-direction: column; align-items: flex-start; }
}

.atividade-card.atividade-concluida { opacity: 0.72; background: var(--gray-100); }
.atividade-card.atividade-concluida .info h4 { color: var(--gray-600); }
.obs-bloco { margin-top: 10px; }
.obs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--gold-400);
  background: linear-gradient(135deg, rgba(240, 200, 105, 0.14), rgba(224, 176, 74, 0.06));
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.obs-toggle:hover { box-shadow: 0 2px 10px rgba(224, 176, 74, 0.25); }
.obs-toggle input.obs-checkbox {
  width: 15px;
  height: 15px;
  accent-color: var(--gold-400);
  cursor: pointer;
}
.obs-toggle-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #8a6a1c;
  letter-spacing: 0.1px;
}
.obs-campo {
  margin-top: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px;
  border-radius: 12px;
  border: 1.5px solid var(--gold-300);
  background: linear-gradient(180deg, #fffaf0, #fffdf7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.obs-campo:focus-within {
  border-color: var(--gold-400);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 0 0 3px rgba(224, 176, 74, 0.18);
}
.obs-campo textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: var(--navy-900);
  min-height: 100px;
  padding: 14px 16px;
}
.obs-campo textarea::placeholder { color: #b8a06a; }
.obs-campo textarea:focus { outline: none; }

.observacao-aluno {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--gold-300);
  background: linear-gradient(135deg, #fffaf0 0%, #fff6e6 100%);
  box-shadow: 0 2px 10px rgba(224, 176, 74, 0.14);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.observacao-aluno .icone {
  font-size: 16px;
  line-height: 1.4;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08));
}
.observacao-aluno .texto {
  font-size: 13.5px;
  color: #6b5314;
  line-height: 1.5;
}
.observacao-aluno .rotulo {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--gold-400);
  margin-bottom: 3px;
}
