/* ==========================================================================
   Plataforma Hugo — Área do aluno
   Tema escuro imersivo, estilo área de membros premium.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #0c0d11;
  --surface: #15171e;
  --surface-2: #1c1f28;
  --border: #262a36;
  --border-strong: #333849;
  --ink: #f1f3f8;
  --muted: #9aa2b5;
  /* --faint era #6b7284 e reprovava a WCAG AA em TODO texto pequeno que usa
     ela: 4,04:1 sobre --bg, 3,72:1 sobre --surface e 3,42:1 sobre --surface-2,
     contra os 4,5:1 que texto abaixo de 18,66px exige. Isso ficou visível
     quando as prateleiras chegaram, porque a linha "1/5 aulas concluídas · 20%"
     e o "0/3 aulas" do cartão são exatamente esta cor — a informação de
     progresso do aluno era a menos legível da tela. #838b9e é o primeiro cinza
     que passa nos TRÊS fundos (pior caso 4,82:1) e continua mais apagado que
     --muted, então a hierarquia de leitura não muda. */
  --faint: #838b9e;

  /* Acento harmonizado com a paleta nova do painel (css/tokens.css) */
  --primary: oklch(0.585 0.215 277);
  --primary-bright: oklch(0.72 0.15 277);
  --primary-strong: oklch(0.52 0.24 277);
  --success: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --radius: 14px;
  --radius-sm: 9px;
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary-bright); text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- primitivas ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 570;
  font-size: 13.5px;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, transform 0.06s;
}
.btn:active { transform: translateY(1px); }
.btn.lg { padding: 13px 18px; font-size: 14.5px; border-radius: 11px; }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 18px rgba(99, 102, 241, 0.35); }
.btn.primary:hover { background: var(--primary-strong); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border-color: var(--border-strong); }
.btn.ghost:hover { background: #232734; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
/* ALCANCE DO POLEGAR — os dois controles do topo da área do aluno mediam 36px
   (sair) e 32px (a foto), abaixo dos 44px mínimos, na mesma tela onde o aluno
   passa o dia. Em vez de inflar o desenho (o que empurraria o cabeçalho e
   arrastaria o selo da câmera junto), a área de TOQUE cresce por baixo, sem
   pixel visível: 44x44 centrado no botão. Medido antes de escolher isto — a
   folga entre os dois é de 10px e os dois retângulos de 44px ficam colados sem
   se invadir (290-334 e 334-378 em 390px), então nenhum dedo acerta o vizinho. */
.icon-btn, .avatar-button { position: relative; }
.icon-btn::after, .avatar-button::after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  width: 44px; height: 44px;
  transform: translate(-50%, -50%);
}
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 550; color: var(--muted); }
.field input, textarea.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
.field input::placeholder, textarea.input::placeholder { color: var(--faint); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 620;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge.green { background: rgba(52, 211, 153, 0.12); color: var(--success); border-color: transparent; }
.badge.indigo { background: rgba(129, 140, 248, 0.14); color: var(--primary-bright); border-color: transparent; }

.toast {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f1f3f8;
  color: #14161c;
  font-size: 13.5px;
  font-weight: 550;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s;
}
.toast.show { opacity: 1; transform: none; }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- login ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(720px 420px at 20% -5%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(600px 380px at 90% 10%, rgba(139, 92, 246, 0.12), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  padding: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.login-eyebrow { margin: 18px 0 4px; color: var(--primary-bright); font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.login-card h1 { font-size: 26px; }
.login-sub { margin-top: 6px; color: var(--muted); }
.login-form { display: grid; gap: 14px; margin: 24px 0 4px; }
.login-alt { display: inline-block; margin-top: 16px; font-weight: 550; font-size: 13.5px; }
.brand-mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.4);
}
.brand-mark .icon { width: 24px; height: 24px; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; }
.brand-mark.small .icon { width: 20px; height: 20px; }

/* ---------- estrutura ---------- */
.student-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 66px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(12, 13, 17, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; }
.sidebar-brand strong { display: block; font-size: 15px; }
.sidebar-brand span { display: block; font-size: 11.5px; color: var(--muted); }
.header-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), oklch(0.72 0.16 300));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}
.user-name { font-size: 13.5px; font-weight: 550; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Perfil (Fase 4): a foto no topo é um botão de trocar imagem. */
.avatar-button { position: relative; border: 0; padding: 0; background: none; cursor: pointer; flex: none; border-radius: 50%; }
.avatar.has-photo { background-size: cover; background-position: center; }
.avatar-camera {
  position: absolute; right: -3px; bottom: -3px;
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2, #1b1d26);
  border: 1px solid var(--border);
  color: var(--muted);
}
.avatar-camera .icon { width: 9px; height: 9px; }
.avatar-button:hover .avatar-camera { color: var(--primary-bright); }
.avatar-img { object-fit: cover; width: 32px; height: 32px; border-radius: 50%; flex: none; }
.avatar.sm, .avatar-img.sm { width: 26px; height: 26px; font-size: 11px; }
.student-main { width: min(1180px, calc(100% - 40px)); margin: 36px auto 80px; }

/* ---------- biblioteca: prateleiras estilo Hotmart ----------
   Uma fileira por CURSO, um cartão de capa em RETRATO por MÓDULO, com rolagem
   horizontal DENTRO da fileira (a página nunca rola de lado) e setas só no
   desktop. O curso não comprado usa os mesmos cartões, esmaecidos e com
   cadeado — é vitrine de venda dentro da área de membros. */
#library h1 { font-size: clamp(26px, 4vw, 34px); }
.library-sub { margin: 6px 0 22px; color: var(--muted); }
.progress-track { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #a78bfa); }

/* Continue de onde parou */
.continue-card { margin: 0 0 30px; }
.continue-go {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(129, 140, 248, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.16), rgba(139, 92, 246, 0.06)), var(--surface);
  color: var(--ink);
  transition: border-color 0.16s, transform 0.06s;
}
.continue-go:hover { border-color: var(--primary); }
.continue-go:active { transform: translateY(1px); }
.continue-thumb {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 148px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
.continue-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.continue-text { display: grid; gap: 5px; flex: 1; min-width: 0; }
.continue-eyebrow { color: var(--primary-bright); font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.continue-text strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-lesson { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-card .progress-track { display: block; width: 100%; max-width: 420px; }
.continue-card .progress-fill { display: block; }
.continue-percent { color: var(--faint); font-size: 12px; }

/* Prateleiras */
.course-shelves { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }
.shelf { min-width: 0; }
.shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.shelf-head-text { min-width: 0; }
.shelf-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.shelf-head-text h2 { margin-top: 2px; font-size: 19px; }
.shelf-meta { margin-top: 3px; color: var(--faint); font-size: 12.5px; }
.shelf-locked .shelf-eyebrow { color: var(--warn); }
.shelf-head-actions { display: flex; align-items: center; gap: 8px; }
.shelf-head-actions .btn { min-height: 44px; }
.shelf-arrows { display: none; gap: 6px; }
.shelf.has-overflow .shelf-arrows { display: flex; }
.rail-arrow {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
}
.rail-arrow:hover:not(:disabled) { background: var(--surface-2); }
.rail-arrow:disabled { opacity: 0.34; cursor: not-allowed; }
/* Sem mouse não há seta: a fileira rola no dedo. */
@media (hover: none) { .shelf-arrows { display: none !important; } }

.shelf-rail {
  display: flex;
  gap: 14px;
  padding: 2px 2px 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.shelf-rail.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.shelf-empty { color: var(--faint); font-size: 13px; }

.cover-card { flex: 0 0 152px; display: grid; gap: 7px; scroll-snap-align: start; cursor: pointer; }
.cover-card .cover-art {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  transition: border-color 0.16s;
}
.cover-card .cover-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 38px;
  font-weight: 760;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.92);
}
/* Duas linhas SEMPRE reservadas: sem isso o "0/3 aulas" de um cartão de título
   curto sobe e fica desalinhado do vizinho de título longo. */
.cover-card h3 { font-size: 13.5px; font-weight: 600; line-height: 1.35; min-height: 2.7em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cover-card small { color: var(--faint); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; }
.cover-card:hover .cover-art { border-color: var(--primary); }
.cover-card:focus-visible { outline: 2px solid var(--primary-bright); outline-offset: 3px; border-radius: 12px; }
.cover-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 11, 15, 0.4); opacity: 0; transition: opacity 0.18s; }
.cover-play .icon { box-sizing: content-box; width: 18px; height: 18px; padding: 12px; margin-left: 2px; border-radius: 50%; background: rgba(255, 255, 255, 0.94); color: #14161c; }
.cover-card:hover .cover-play, .continue-go:hover .cover-play { opacity: 1; }
.cover-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0, 0, 0, 0.5); }
.cover-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #a78bfa); }
/* Bloqueado é bloqueado também no olho: capa esmaecida e cadeado por cima. */
.cover-card.locked-course .cover-art img, .cover-card.locked-module .cover-art img,
.cover-card.locked-course .cover-initials, .cover-card.locked-module .cover-initials { filter: grayscale(0.7) brightness(0.5); }
.cover-lock { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.cover-lock .icon { box-sizing: content-box; width: 18px; height: 18px; padding: 11px; border-radius: 50%; background: rgba(12, 13, 17, 0.7); border: 1px solid rgba(255, 255, 255, 0.2); }
.cover-card.locked-module small { color: var(--warn); }
.course-shelves .empty { grid-column: 1 / -1; }
.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 56px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}
.empty strong { color: var(--ink); font-size: 15px; }

/* ---------- sala do curso ---------- */
.room-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.room-topbar .back { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--surface); color: var(--muted); font-weight: 550; font-size: 13px; }
.room-topbar .back:hover { color: var(--ink); background: var(--surface-2); }
.room-topbar h1 { font-size: clamp(19px, 3vw, 24px); flex: 1; min-width: 200px; }
.room-progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.room-progress .progress-track { width: 130px; }

.room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }

/* player e conteúdo da aula */
.lesson-stage { display: grid; gap: 20px; min-width: 0; }
/* Aulas gravadas na VERTICAL (9/16). O limite é a ALTURA da janela, não a
   largura da coluna: sem o max-width derivado da altura, um 9/16 em coluna
   larga viraria um player gigante que não cabe na tela. */
.player-shell {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
  width: 100%;
  max-width: 420px; /* fallback para navegador sem `svh`: a linha abaixo cai inteira */
  max-width: min(100%, calc(78svh * 9 / 16));
  margin-inline: auto;
}
.lesson-player { display: block; width: 100%; aspect-ratio: 9 / 16; background: #000; }
.player-message {
  aspect-ratio: 9 / 16;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: linear-gradient(135deg, #14161e, #1a1626);
  color: var(--muted);
}
.lesson-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lesson-head-info { display: grid; gap: 5px; min-width: 0; }
.lesson-head-info .lesson-module { color: var(--primary-bright); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.lesson-head h2 { font-size: 21px; }
.lesson-head-info .desc { color: var(--muted); }
/* Capa do módulo no cabeçalho da aula (Onda 4 / Fase 5). O seletor com `~`
   é de propósito: sem capa, NADA muda no cabeçalho que já existia. */
.lesson-head-cover {
  flex: 0 0 auto;
  width: 64px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.lesson-head-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* A base em 55% mantém capa e texto na MESMA linha em painel estreito (o
   preview do editor tem ~440px): sem ela a miniatura quebrava sozinha para
   uma linha só dela. */
.lesson-head-cover ~ .lesson-head-info { flex: 1 1 55%; }
.complete-lesson { flex: none; }
.complete-lesson.done { background: rgba(52, 211, 153, 0.12); color: var(--success); border-color: transparent; box-shadow: none; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; }
.lesson-body-text { color: #c9cede; white-space: pre-wrap; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.lesson-extras { display: flex; flex-wrap: wrap; gap: 10px; }
.material-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 550;
  text-decoration: none !important;
}
.material-btn:hover { background: var(--surface-2); }
.material-btn .icon { color: var(--primary-bright); width: 16px; height: 16px; }

/* certificado */
.certificate-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.18), rgba(139, 92, 246, 0.12));
  border: 1px solid rgba(129, 140, 248, 0.35);
}
.certificate-panel .cert-info { display: flex; align-items: center; gap: 14px; }
.certificate-panel .cert-info .icon { width: 26px; height: 26px; color: var(--primary-bright); }
.certificate-panel strong { display: block; }
.certificate-panel p { color: var(--muted); font-size: 13px; }

/* comentários */
.lesson-comments { display: grid; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.lesson-comments h3 { font-size: 16px; }
.comment-form { display: grid; gap: 10px; }
.comment-form textarea { min-height: 84px; resize: vertical; }
.comment-form .btn { justify-self: end; }
.comment-list { display: grid; gap: 10px; }
.student-comment { display: grid; gap: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.student-comment header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.student-comment header strong { font-size: 13.5px; }
.student-comment header small { color: var(--faint); font-size: 12px; }
.student-comment p { color: #c9cede; white-space: pre-wrap; font-size: 13.5px; }
/* Fase 4: fio da conversa — avatar, resposta aninhada e coração do autor. */
.comment-main { display: flex; align-items: flex-start; gap: 10px; }
.comment-main-body { display: grid; gap: 5px; min-width: 0; }
.author-badge {
  padding: 1.5px 8px;
  border-radius: 99px;
  background: rgba(129, 140, 248, 0.14);
  color: var(--primary-bright);
  font-size: 11px;
  font-weight: 700;
}
.author-like { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; color: #f472b6; font-size: 12px; font-weight: 600; }
.author-like .icon { width: 13px; height: 13px; fill: currentColor; }
.comment-replies { display: grid; gap: 10px; margin-left: 20px; padding-left: 14px; border-left: 2px solid var(--border); }
.comment-reply { display: flex; align-items: flex-start; gap: 9px; }
.comment-reply-body { display: grid; gap: 4px; min-width: 0; }
.comment-reply-body p { color: #c9cede; white-space: pre-wrap; font-size: 13px; }

/* currículo lateral */
.curriculum {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 106px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.curriculum-head { padding: 15px 17px; border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.module-group { border-bottom: 1px solid var(--border); }
.module-group:last-child { border-bottom: 0; }
.module-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 17px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 600;
  font-size: 13.5px;
}
.module-toggle:hover { background: var(--surface-2); }
.module-toggle .module-meta { display: block; color: var(--faint); font-size: 11.5px; font-weight: 500; }
/* Capa do módulo no currículo (Onda 4 / Fase 5): só existe quando há imagem
   (própria do módulo ou herdada do curso). Módulo sem capa nenhuma nem cria
   este nó — a linha continua idêntica à de antes desta fase. */
.module-cover {
  flex: 0 0 auto;
  width: 52px;
  height: 34px;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.module-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.module-toggle > div { flex: 1; min-width: 0; }
.module-toggle .chev { transition: transform 0.18s; color: var(--faint); }
.module-group.open .module-toggle .chev { transform: rotate(180deg); }
.module-group.locked .module-toggle { color: var(--faint); cursor: default; }
.locked-note { padding: 0 17px 13px 17px; color: var(--faint); font-size: 12.5px; }
.module-lessons { display: none; padding: 2px 8px 10px; }
.module-group.open .module-lessons { display: grid; gap: 2px; }
.lesson-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  transition: background 0.12s, color 0.12s;
}
.lesson-button:hover { background: var(--surface-2); color: var(--ink); }
.lesson-button.active { background: rgba(99, 102, 241, 0.15); color: var(--ink); }
.lesson-button.active .lesson-state { color: var(--primary-bright); }
.lesson-state {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  color: var(--faint);
  flex: none;
}
.lesson-state .icon { width: 12px; height: 12px; }
.lesson-button.done .lesson-state { background: var(--success); border-color: var(--success); color: #0c221a; }
.lesson-button span.title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- responsivo ---------- */
@media (max-width: 960px) {
  .room-layout { grid-template-columns: 1fr; }
  .curriculum { position: static; max-height: none; order: 2; }
  .lesson-stage { order: 1; }
}
@media (max-width: 620px) {
  .student-header { padding: 0 16px; }
  .student-main { width: calc(100% - 28px); margin-top: 24px; }
  .user-name { display: none; }
  /* Prateleiras no celular: cartão mais estreito (cabem dois e meio na tela,
     o que já mostra que a fileira rola), botão da linha ocupando a largura e
     alvo de toque acima de 44px. A rolagem lateral continua sendo só a da
     fileira — a página não rola de lado. */
  .course-shelves { gap: 26px; }
  .cover-card { flex: 0 0 128px; }
  .shelf-head { align-items: flex-start; }
  .shelf-head-actions { width: 100%; }
  .shelf-head-actions .btn { flex: 1; }
  /* Nada de seta em tela estreita: a fileira se rola no dedo e o botão da
     linha usa a largura toda. */
  .shelf-arrows { display: none !important; }
  /* Miniatura deitada e BAIXA: em retrato ela comia a primeira dobra inteira. */
  .continue-go { flex-direction: column; align-items: stretch; }
  .continue-thumb { width: 100%; aspect-ratio: auto; height: 112px; }
  .room-topbar h1 { min-width: 0; width: 100%; order: 3; }
  .room-progress { width: 100%; justify-content: space-between; order: 4; }
  .room-progress .progress-track { flex: 1; width: auto; }
  .lesson-head { flex-direction: column; }
  /* Em coluna o eixo principal é a ALTURA: a base de 55% da linha acima não
     pode virar altura. Volta para auto. */
  .lesson-head-cover ~ .lesson-head-info { flex: 0 0 auto; }
  .complete-lesson { width: 100%; }
  .certificate-panel { flex-direction: column; align-items: stretch; text-align: center; }
  .certificate-panel .cert-info { flex-direction: column; }
  .login-card { padding: 28px 22px; }
}

/* Primeiro acesso por link */
.login-hint { margin: -4px 0 2px; font-size: 12px; color: var(--muted); }
