/* ===== Área do aluno ===== */

/* ---------- Cabeçalho ---------- */
.header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  display: flex; align-items: center; gap: 26px; padding: 0 26px;
  background: rgba(11, 11, 13, .88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -.2px; }
.header-logo img { max-height: 30px; }
.header-nav { display: flex; align-items: center; gap: 22px; flex: 1; }
.header-nav a { font-size: 13.5px; color: var(--muted); transition: color .15s; }
.header-nav a:hover, .header-nav a.active { color: var(--text); }
.header-nav a.active { color: var(--accent); }
.header-right { display: flex; align-items: center; gap: 6px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--muted);
  overflow: hidden; border: 1px solid var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.menu-pop {
  position: absolute; top: calc(var(--header-h) - 6px); right: 20px; z-index: 200;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  min-width: 210px; padding: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55);
}
.menu-pop .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-pop .who b { display: block; font-size: 13px; }
.menu-pop .who span { font-size: 11.5px; color: var(--muted); word-break: break-all; }
.menu-pop a {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text);
}
.menu-pop a:hover { background: var(--surface-2); }
.menu-pop a svg { width: 15px; height: 15px; opacity: .6; }

/* ---------- Busca ---------- */
.search-panel {
  position: absolute; top: var(--header-h); left: 0; right: 0; z-index: 150;
  background: var(--surface); border-bottom: 1px solid var(--border); padding: 18px 26px;
}
.search-panel input { max-width: 620px; margin: 0 auto; display: block; }
.search-results { max-width: 620px; margin: 14px auto 0; }
.search-item { display: flex; gap: 11px; align-items: center; padding: 9px; border-radius: 9px; cursor: pointer; }
.search-item:hover { background: var(--surface-2); }
.search-item .thumb { width: 54px; height: 32px; border-radius: 5px; background: #000 center/cover; flex: none; }
.search-item b { display: block; font-size: 13px; font-weight: 500; }
.search-item span { font-size: 11.5px; color: var(--muted); }

/* ---------- Carrossel de banners ---------- */
.carousel { position: relative; width: 100%; overflow: hidden; background: #000; }
.carousel-track { display: flex; transition: transform .5s cubic-bezier(.4, 0, .2, 1); }
.carousel-slide { min-width: 100%; position: relative; }
/* --banner-ar vem das configurações (Aparência › carrossel). Sem ela, a tira
   fina de sempre. Quem desenha banner 16:9 troca lá e a arte entra inteira. */
.carousel-slide img { width: 100%; aspect-ratio: var(--banner-ar, 21/7); object-fit: cover; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .5); color: #fff; display: grid; place-items: center;
  opacity: 0; transition: opacity .2s;
}
.carousel:hover .carousel-arrow { opacity: 1; }
.carousel-arrow:hover { background: rgba(0, 0, 0, .8); }
.carousel-arrow.prev { left: 14px; } .carousel-arrow.next { right: 14px; }
.carousel-arrow svg { width: 18px; height: 18px; }
.carousel-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; z-index: 3; }
.carousel-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .4);
  cursor: pointer; transition: .2s; display: block;
}
.carousel-dots i.on { background: #fff; width: 20px; border-radius: 4px; }

/* ---------- Conteúdo ---------- */
.page { padding: 30px 26px 70px; max-width: 1600px; margin: 0 auto; }
.section { margin-bottom: 38px; }
.section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.section-head h2 { font-size: 14px; font-weight: 500; margin: 0; color: #c8c8d0; letter-spacing: .1px; }
.section-head span { font-size: 12px; color: var(--muted); }

.grid { display: grid; gap: 16px; }
.rail { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.rail::-webkit-scrollbar { height: 6px; }
/* Sem largura o card do trilho encolheria pro tamanho do título — cada um de um
   jeito. A largura sai das colunas da linha: é quanto cabe antes de rolar. */
.rail > * { scroll-snap-align: start; flex: none; width: calc((100% - (var(--cols, 5) - 1) * 16px) / var(--cols, 5)); }

/* Card de produto/módulo */
.tile { cursor: pointer; }
.tile-art {
  position: relative; width: 100%; border-radius: 10px; overflow: hidden;
  background: #101014 center/cover no-repeat; border: 1px solid var(--border);
  transition: transform .2s, border-color .2s;
}
.tile:hover .tile-art { transform: translateY(-3px); border-color: #3a3a45; }
.tile-art.portrait { aspect-ratio: 2/3; }
.tile-art.tall { aspect-ratio: 3/5; }
.tile-art.story { aspect-ratio: 9/16; }
.tile-art.landscape { aspect-ratio: 16/9; }
.tile-art.square { aspect-ratio: 1/1; }
.tile-art.wide { aspect-ratio: 21/9; }
.tile-art .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #3a3a45; font-size: 26px; font-weight: 700; }
/* A barra agora é o único indicador do módulo — some o "N aulas" embaixo.
   O degradê é o que garante que ela apareça também sobre arte clara. */
.tile-art .prog {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 9px 7px;
  background: linear-gradient(to top, rgba(0, 0, 0, .6), transparent);
}
.tile-art .prog .bar { background: rgba(255, 255, 255, .3); }
.tile-art .lock {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .66); display: grid; place-items: center;
  color: #fff; backdrop-filter: blur(1px);
}
.tile-art .lock svg { width: 22px; height: 22px; opacity: .85; }
.tile-art .flag {
  position: absolute; top: 8px; left: 8px; font-size: 10px; padding: 3px 7px;
  border-radius: 5px; background: rgba(0, 0, 0, .7); color: #facc15; font-weight: 600;
}
.tile-title { font-size: 12.5px; margin-top: 9px; color: #d4d4d8; text-align: center; line-height: 1.4; }
.tile-sub { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; }

/* ---------- Página do produto ---------- */
.hero { position: relative; width: 100%; background: #000; }
.hero img { width: 100%; aspect-ratio: var(--banner-ar, 21/6); object-fit: cover; }
.hero-fallback {
  aspect-ratio: var(--banner-ar, 21/6); display: grid; place-items: center;
  background: linear-gradient(120deg, #16161c, #0f0f13);
}
.hero-fallback h1 { font-size: 30px; margin: 0; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, var(--bg)); pointer-events: none; }

.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); margin-bottom: 22px; }
.crumb a { cursor: pointer; }
.crumb a:hover { color: var(--text); }
.crumb svg { width: 13px; height: 13px; }

.group-label {
  font-size: 11px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px; display: flex; align-items: center; gap: 12px;
}
.group-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.prod-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; font-size: 12.5px; color: var(--muted); }
.prod-progress .bar { flex: 1; max-width: 280px; }

/* ---------- Página da aula ---------- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px; align-items: start; }
.lesson-title { font-size: 20px; margin: 18px 0 14px; font-weight: 600; letter-spacing: -.2px; }
.lesson-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.lesson-actions .spacer { flex: 1; }
.lesson-desc { color: #b8b8c2; font-size: 13.5px; line-height: 1.7; margin: 18px 0; white-space: pre-wrap; }

.materials { margin: 20px 0; }
.materials h3 { font-size: 13px; margin: 0 0 10px; color: #c8c8d0; font-weight: 600; }
.material {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border); margin-bottom: 7px; transition: .15s;
}
.material:hover { border-color: #3a3a45; background: var(--surface-2); }
.material svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.material b { font-size: 13px; font-weight: 500; }
.material span { font-size: 11.5px; color: var(--muted); }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin: 24px 0 18px; }
.tab {
  padding: 0 0 11px; font-size: 13.5px; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: .15s;
}
.tab.on { color: var(--accent); border-bottom-color: var(--accent); }

.comment-box { display: flex; gap: 10px; margin-bottom: 22px; }
.comment-box .textarea { min-height: 46px; }
.comment { display: flex; gap: 11px; margin-bottom: 18px; }
.comment .avatar { flex: none; width: 34px; height: 34px; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment-head b { font-size: 13px; font-weight: 600; }
.comment-head time { font-size: 11px; color: var(--muted); }
.comment-text { font-size: 13.5px; line-height: 1.65; color: #cfcfd8; white-space: pre-wrap; word-break: break-word; }
.comment-foot { display: flex; gap: 14px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.comment-foot a { cursor: pointer; }
.comment-foot a:hover { color: var(--text); }
.comment-replies { margin-top: 14px; padding-left: 16px; border-left: 2px solid var(--border); }

/* Sidebar de módulos */
.side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); display: flex; flex-direction: column; }
.side-head { padding: 15px 16px; border-bottom: 1px solid var(--border); }
.side-head b { font-size: 13px; display: block; margin-bottom: 8px; }
.side-head span { font-size: 11.5px; color: var(--muted); }
.side-list { overflow-y: auto; flex: 1; }
.side-mod { border-bottom: 1px solid var(--border); }
.side-mod-head {
  display: flex; align-items: center; gap: 11px; padding: 13px 16px; cursor: pointer; transition: background .15s;
}
.side-mod-head:hover { background: var(--surface-2); }
.side-mod-head .ring { flex: none; }
.side-mod-head b { font-size: 12.5px; font-weight: 500; display: block; line-height: 1.35; }
.side-mod-head span { font-size: 11px; color: var(--muted); }
.side-mod-head .chev { margin-left: auto; width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.side-mod.open .chev { transform: rotate(180deg); }
.side-lessons { display: none; padding: 0 16px 12px 44px; }
.side-mod.open .side-lessons { display: block; }
.side-lesson {
  display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; font-size: 12.5px;
  color: #a8a8b4; cursor: pointer; line-height: 1.45;
}
.side-lesson:hover { color: var(--text); }
.side-lesson.on { color: var(--accent); }
.side-lesson .dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #43434f; flex: none; margin-top: 5px; }
.side-lesson.done .dot { background: var(--accent); border-color: var(--accent); }
.side-lesson .lock { width: 12px; height: 12px; flex: none; margin-top: 3px; opacity: .5; }

/* Anel de progresso do módulo */
.ring { width: 22px; height: 22px; position: relative; }
.ring svg { transform: rotate(-90deg); width: 22px; height: 22px; }
.ring circle { fill: none; stroke-width: 2.5; }
.ring .track { stroke: #34343f; }
.ring .fill { stroke: var(--accent); transition: stroke-dashoffset .4s; }

/* ---------- Rodapé ---------- */
.footer {
  border-top: 1px solid var(--border); padding: 20px 26px; display: flex;
  justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted);
}
.footer a:hover { color: var(--text); text-decoration: underline; }
.footer-links { display: flex; gap: 16px; }

/* ---------- Responsivo ---------- */
@media (max-width: 1080px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .header { padding: 0 14px; gap: 14px; }
  .header-nav { display: none; }
  .page { padding: 20px 14px 50px; }
  .carousel-slide img { aspect-ratio: var(--banner-ar-m, 16/9); }
  .hero img, .hero-fallback { aspect-ratio: var(--banner-ar-m, 16/7); }
  .grid { gap: 11px; }
  /* No celular, 5 por tela viraria selo. Mostra 2 e meio — o meio card é o que
     avisa o aluno de que a linha rola pro lado. */
  .rail { gap: 11px; }
  .rail > * { width: calc((100% - 11px) / 2.3); }
  .lesson-title { font-size: 17px; }
}

/* ---------- Tokens no cabeçalho ---------- */
.token-chip {
  display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12.5px; cursor: pointer;
  border: 1px solid transparent; transition: .15s;
}
.token-chip:hover { border-color: var(--accent); }
.token-chip svg { width: 15px; height: 15px; }
.token-chip b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Sino de avisos ---------- */
.bell-btn { position: relative; }
.bell-dot {
  position: absolute; top: 1px; right: 0; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 700;
  display: grid; place-items: center; font-style: normal; line-height: 1;
}
.notif-pop {
  position: absolute; top: calc(var(--header-h) - 6px); right: 20px; z-index: 200; width: 330px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .55); overflow: hidden;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--border); }
.notif-head b { font-size: 13px; }
.notif-list { max-height: 380px; overflow-y: auto; }
.notif { padding: 12px 15px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s; }
.notif:hover { background: var(--surface-2); }
.notif.unread { border-left: 2px solid var(--accent); }
.notif b { font-size: 12.5px; display: block; font-weight: 500; }
.notif p { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.notif time { font-size: 10.5px; color: var(--muted); display: block; margin-top: 5px; }

.level-chip {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 9px;
  padding: 4px 9px; border-radius: 999px; background: var(--accent-soft);
  color: var(--accent); font-size: 11px; font-weight: 600;
}
.level-chip svg { width: 13px; height: 13px; }

/* ---------- Ranking ---------- */
.token-card { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.token-big { display: flex; align-items: center; gap: 8px; font-size: 30px; font-weight: 600; color: var(--accent); letter-spacing: -1px; }
.token-big svg { width: 26px; height: 26px; }
.token-card span { font-size: 12.5px; color: var(--muted); }
.rank-row { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .pos { width: 28px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rank-row .avatar { width: 28px; height: 28px; }
.rank-row b { flex: 1; font-size: 13px; font-weight: 500; }
.rank-row span { font-size: 12px; color: var(--muted); }
.rank-row.me { background: var(--accent-soft); margin: 0 -10px; padding: 9px 10px; border-radius: 8px; border-bottom: 0; }
.rank-row.me b { color: var(--accent); }

/* ---------- Link do menu aberto por dentro ---------- */
.embed-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - 62px); }
.embed-bar { display: flex; align-items: center; gap: 12px; padding: 11px 22px; border-bottom: 1px solid var(--border); }
.embed-bar b { font-size: 13.5px; }
.embed-bar .spacer { flex: 1; }
.embed-wrap iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.embed-fallback { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 13.5px; }

/* ---------- Detalhes de card e aula ---------- */
.ext-flag { position: absolute; top: 8px; right: 8px; color: rgba(255, 255, 255, .75); }
.ext-flag svg { width: 14px; height: 14px; }
.row-sub { margin: -8px 0 14px; font-size: 12.5px; color: var(--muted); }
.done-locked { opacity: .45; cursor: not-allowed; }
.done-ready { animation: donePulse 1.6s ease-in-out 2; }
@keyframes donePulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 6px transparent; }
}
