/* ============================================================
   APP.CSS — Estilos específicos da área de membros (membro)
   ============================================================ */

/* ---- Ícone do módulo antes do título ---- */
.module-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 8px;
}

.module-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--control-bg);
  border: 1px solid var(--glass-border-inner);
  border-radius: 9px;
  font-size: 19px;
  color: var(--accent);
  flex-shrink: 0;
}

/* Icon chip smaller for legacy module card */
.course-detail-header .module-icon-chip {
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 17px;
}

/* ---- Markdown rendered content ---- */
.content-md {
  line-height: 1.7;
}

.content-md h1,
.content-md h2,
.content-md h3 {
  margin-bottom: 10px;
  margin-top: 20px;
  font-weight: 600;
}

.content-md p {
  margin-bottom: 12px;
  color: var(--text-primary);
}

.content-md a {
  color: var(--accent);
}

.content-md ul,
.content-md ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.content-md li {
  margin-bottom: 5px;
}

.content-md strong {
  font-weight: 600;
}

.content-md em {
  font-style: italic;
}

.content-md code {
  background: var(--control-bg);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.88em;
}

.content-md pre {
  background: var(--control-bg);
  border-radius: 12px;
  padding: 14px;
  overflow-x: auto;
  margin-bottom: 14px;
}

.content-md pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.content-md blockquote {
  border-left: 1px solid var(--accent);
  padding-left: 14px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.content-md img {
  max-width: 100%;
  border-radius: 12px;
}

/* Reset: inline-code style must not leak into code blocks */
.content-md pre code,
.content-html pre code,
.code-block-wrap code {
  background: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-size: inherit !important;
  border: none !important;
}

/* ---- Syntax-highlighted code block ---- */
.code-block-wrap {
  position: relative;
  background: #1a1b26;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin: 1em 0;
  overflow: hidden;
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 16px;
  height: 38px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
}

.code-block-lang {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.32);
  text-transform: lowercase;
  letter-spacing: 0.05em;
  flex: 1;
}

.code-block-copy {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-family: inherit;
  color: rgba(255, 255, 255, 0.38);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 9px;
  border-radius: 9px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
  flex-shrink: 0;
}

.code-block-copy:hover {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
}

.code-block-copy .icon-check {
  display: none;
}

.code-block-copy.copied {
  color: #4ade80;
}

.code-block-copy.copied .icon-copy {
  display: none;
}

.code-block-copy.copied .icon-check {
  display: block;
}

pre.code-block {
  margin: 0;
  padding: 16px 18px;
  max-height: 230px;
  overflow-y: auto;
  overflow-x: auto;
  background: none;
}

pre.code-block::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

pre.code-block::-webkit-scrollbar-track {
  background: transparent;
}

pre.code-block::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}

pre.code-block::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.26);
}

pre.code-block code {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.875em;
  line-height: 1.65;
  white-space: pre;
  color: #c0caf5;
}

/* ---- Highlight.js token colors (Tokyo Night palette) ---- */
.hljs {
  color: #c0caf5;
  background: transparent;
}

.hljs-comment,
.hljs-quote {
  color: #565f89;
  font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal {
  color: #bb9af7;
}

.hljs-built_in {
  color: #7dcfff;
}

.hljs-string,
.hljs-doctag,
.hljs-template-tag {
  color: #9ece6a;
}

.hljs-number,
.hljs-regexp,
.hljs-symbol {
  color: #ff9e64;
}

.hljs-title,
.hljs-section {
  color: #7aa2f7;
}

.hljs-title.class_,
.hljs-class .hljs-title {
  color: #2ac3de;
}

.hljs-variable,
.hljs-template-variable,
.hljs-attr {
  color: #73daca;
}

.hljs-tag {
  color: #f7768e;
}

.hljs-name {
  color: #7aa2f7;
}

.hljs-attribute {
  color: #9ece6a;
}

.hljs-operator,
.hljs-punctuation {
  color: #89ddff;
}

.hljs-meta {
  color: #41a6b5;
}

.hljs-deletion {
  color: #f7768e;
}

.hljs-addition {
  color: #9ece6a;
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 600;
}

/* ---- Page header — padrão shadcn/ui, left-aligned ---- */
.courses-page-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Um seletor de classe vence o estilo de user-agent do [hidden], então sem
   esta regra o atributo hidden no HTML não esconde nada. */
.courses-page-header[hidden] {
  display: none;
}

.courses-page-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.045em;
  color: var(--text-primary);
  line-height: 1.15;
}

.courses-page-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Mantido para compatibilidade — oculto */
.courses-page-divider {
  display: none;
}

/* ---- Views com gap específico ---- */
#view-courses {
  gap: 24px;
}

#view-home {
  gap: 24px;
}

/* ---- Course grid ---- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ---- Course card ---- */
.course-card {
  background: var(--glass-bg-card);
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.1s ease, transform 0.18s var(--ease-smooth),
              box-shadow 0.18s var(--ease-smooth);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-md);
}

.course-card:hover {
  background: var(--control-bg-hover);
}

/* elevação no hover — vale também para bloqueados: o clique é o objetivo */
.course-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.course-card:hover .course-thumb,
.course-card:hover .generated-cover {
  transform: scale(1.03);
}

.course-card:active {
  transform: translateY(-1px);
  background: var(--fill-secondary);
}

/* Portrait thumbnail (4/5) */
/* Blur-behind thumbnail technique — blurred image fills container, real img uses contain */
.tb-blur {
  position: absolute;
  inset: -10%;
  background-size: cover;
  background-position: center;
  filter: blur(12px) saturate(1.3) brightness(0.85);
  z-index: 0;
  /* Promove para camada própria: evita repaint dos vizinhos e acelera scroll em grids grandes */
  transform: translateZ(0);
}

.course-thumb-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--fill-secondary);
  flex-shrink: 0;
}

/* Bottom gradient fade to blend thumb into card body */
.course-thumb-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 25%;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.14));
  pointer-events: none;
  z-index: 2;
}

.course-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  transition: transform 0.35s ease;
}

/* Bloqueado NÃO borra a capa: o conteúdo aparece igual, o aviso é o selo do canto */

.course-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.7;
  background: var(--control-bg);
}

.course-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}

/* badges (preço / concluído) não esticam na largura do card */
.course-body > .badge {
  align-self: flex-start;
}

.course-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.course-description * {
  margin: 0;
  padding: 0;
}

.course-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
}

/* ---- Course detail ---- */
.course-detail-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 0;
  overflow: hidden;
}

.course-detail-banner {
  width: 180px;
  min-width: 140px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
  border: 1px solid var(--glass-border-outer);
}

.course-detail-banner-placeholder {
  width: 180px;
  min-width: 140px;
  aspect-ratio: 2/3;
  border-radius: 12px;
  background: var(--fill-secondary);
  border: 1px solid var(--glass-border-outer);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  flex-shrink: 0;
}

.course-detail-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 4px;
}

.course-detail-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: 0;
}

.course-hero-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0;
}

/* ---- Module accordion ---- */
.modules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.module-accordion {
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  overflow: hidden;
}

.module-accordion-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
  position: relative;
}

.module-accordion-header:hover {
  background: var(--row-hover);
}

.module-accordion-thumb-wrap {
  flex-shrink: 0;
  width: 50px;
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  background: var(--control-bg);
  border: 1px solid var(--glass-border-inner);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.module-accordion-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.module-accordion-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.module-accordion-info {
  flex: 1;
  min-width: 0;
}

.module-accordion-title {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.module-accordion-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.module-pct-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 2px 9px;
  border-radius: 20px;
  border: 1px solid var(--control-border);
  background: transparent;
  flex-shrink: 0;
  white-space: nowrap;
}

.module-pct-badge.complete {
  color: var(--color-green);
  border-color: rgba(var(--color-green-rgb), 0.3);
}

/* Progress track at the bottom of the accordion header */
.module-acc-prog {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--glass-border-inner);
}

.module-acc-prog-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.module-acc-prog-fill.complete {
  background: var(--color-green);
}

.accordion-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.accordion-chevron.rotated {
  transform: rotate(180deg);
}

.module-accordion-body {
  border-top: 1px solid var(--glass-border-inner);
}

/* ---- Lesson rows ---- */
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border-inner);
  transition: background 0.15s;
  position: relative;
}

.lesson-row:last-child {
  border-bottom: none;
}

.lesson-row:hover:not(.locked) {
  background: var(--row-hover);
}

.lesson-row.active {
  background: var(--row-hover);
}

.lesson-row.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--text-tertiary);
  border-radius: 0 2px 2px 0;
}

.lesson-row.locked {
  opacity: 0.45;
  cursor: default;
}

.lesson-row.completed .lesson-row-title {
  color: var(--text-secondary);
}

.lesson-num {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
}

.lesson-type-icon {
  color: var(--text-secondary);
  flex-shrink: 0;
  display: flex;
}

.lesson-row-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.lesson-duration {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.lesson-row-empty {
  padding: 16px 18px;
  font-size: 13px;
  color: var(--text-secondary);
}

.lesson-progress-mini {
  width: 52px;
  height: 3px;
  background: var(--control-border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.lesson-progress-mini>div {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}

/* ---- Botão concluir aula ---- */
.lesson-complete-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .lesson-complete-row .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ---- Lesson detail nav ----
   Anterior à esquerda, Próximo à direita; largura natural no desktop,
   dividem a linha no mobile. */
.lesson-nav-btns {
  display: flex;
  width: 100%;
  margin-top: 12px;
  justify-content: space-between;
  gap: 12px;
}

.lesson-nav-btns .btn {
  flex: 0 1 auto;
  min-width: 150px;
  justify-content: center;
}

.lesson-nav-btns #btn-next-lesson {
  margin-left: auto;
}

@media (max-width: 600px) {
  .lesson-nav-btns .btn {
    flex: 1;
    min-width: 0;
  }
}

/* ---- Admin: upload widget ---- */
.upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-row .btn {
  flex-shrink: 0;
}

/* ---- Views (páginas da SPA) ---- */
.view {
  display: none;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.view.active {
  display: flex;
}

/* ---- Boas-vindas / Home ---- */
/* Hero tipográfico: sem caixa, sem cor de fundo. A hierarquia vem do corpo
   do texto e do espaço — o único azul da dobra é o botão de ação. */
.welcome-banner {
  background: none;
  border-radius: 0;
  padding: 18px 0 26px;
  color: var(--text-primary);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  border-bottom: 1px solid var(--divider);
}

.welcome-text {
  position: relative;
  z-index: 1;
}

.welcome-text h2 {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: -0.045em;
  margin-bottom: 8px;
  line-height: 1.1;
  color: var(--text-primary);
}

.welcome-text p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 46ch;
}

.welcome-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.welcome-actions .btn {
  background: var(--accent);
  background-image: linear-gradient(rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 48%);
  border-color: transparent;
  color: var(--on-accent);
  font-weight: 500;
  box-shadow: var(--accent-glow);
}

.welcome-actions .btn:hover {
  background-color: var(--accent-hover);
  border-color: transparent;
}

@media (max-width: 600px) {
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 6px 0 20px;
    gap: 14px;
  }

  .welcome-text h2 {
    font-size: 27px;
  }

  .welcome-actions {
    width: 100%;
  }

  .welcome-actions .btn {
    flex: 1;
    justify-content: center;
  }

  /* Course grid: two columns on mobile */
  .course-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Course detail: stack banner */
  .course-detail-header {
    flex-direction: column;
  }

  .course-detail-banner,
  .course-detail-banner-placeholder {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16/10;
  }

  .course-detail-title {
    font-size: 22px;
  }

  .course-hero-desc {
    font-size: 14px;
  }

  /* Module accordion */
  .module-accordion-header {
    padding: 14px 16px;
    gap: 12px;
  }

  .lesson-row {
    padding: 12px 16px;
    font-size: 14px;
  }

  .welcome-text h2 {
    font-size: 20px;
  }

  .welcome-text p {
    font-size: 14px;
  }

  .cta-glow {
    min-width: 0;
    width: 100%;
  }

  .cta-glow-inner {
    padding: 15px 22px;
    font-size: 15px;
  }

  .cta-glow-label {
    font-size: 15px;
  }
}

/* ---- Module detail view ---- */
.module-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

/* ---- Back button — ghost, tamanho sm ---- */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  height: 36px;
  padding: 0 12px;
  margin-left: -12px;
  border-radius: 9px;
  background: transparent;
  border: none;
  transition: background-color 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  font-family: inherit;
}

.back-btn:hover {
  background: var(--row-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.back-btn:active {
  opacity: 0.7;
}

/* ---- Lesson top bar ---- */
.lesson-top-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lesson-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.theater-toggle-btn.is-active {
  background: var(--fill-primary);
  color: var(--accent);
}

/* Modo teatro — solta a largura máxima de 1100px herdada de .page-content>*
   (layout.css) só para a página de aula, deixando o vídeo/embed/pdf esticar.
   O filho direto de .page-content é #view-lesson-detail (não .lesson-page-wrapper). */
body.theater-mode #view-lesson-detail {
  max-width: none;
}

/* ---- Lesson page layout ---- */
.lesson-page-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lesson-body-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.lesson-body-layout.has-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.lesson-main-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* ---- Lesson sidebar panel ---- */
.lesson-sidebar-panel {
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  overflow: hidden;
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 112px);
  display: flex;
  flex-direction: column;
}

.lesson-sidebar-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--glass-border-inner);
  flex-shrink: 0;
}

.lesson-sidebar-module-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-sidebar-progress-text {
  font-size: 11px;
  color: var(--text-secondary);
}

.lesson-sidebar-list {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.lesson-sidebar-list::-webkit-scrollbar {
  width: 3px;
}

.lesson-sidebar-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.lesson-sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border-inner);
  border-left: 1px solid transparent;
  transition: background 0.15s;
}

.lesson-sidebar-item:last-child {
  border-bottom: none;
}

.lesson-sidebar-item:hover:not(.active) {
  background: var(--row-hover);
}

.lesson-sidebar-item.active {
  background: var(--row-hover);
  border-left-color: var(--text-secondary);
}

.lesson-sidebar-num {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  width: 18px;
  text-align: right;
  font-weight: 500;
}

.lesson-sidebar-item.active .lesson-sidebar-num {
  color: var(--text-secondary);
}

.lesson-sidebar-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.lesson-sidebar-item.active .lesson-sidebar-title {
  color: var(--text-primary);
  font-weight: 500;
}

.lesson-sidebar-item.completed .lesson-sidebar-title {
  color: var(--text-secondary);
}

.lesson-sidebar-duration {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.lesson-sidebar-icon {
  flex-shrink: 0;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}

.lesson-sidebar-item.completed .lesson-sidebar-icon {
  color: var(--color-green);
}

.lesson-sidebar-item.active .lesson-sidebar-icon {
  color: var(--text-secondary);
}

.lesson-sidebar-item.drip-locked {
  opacity: 0.5;
  cursor: pointer;
}

/* Sidebar: agrupamento por tópico */
.lesson-sidebar-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 10px 12px 6px;
  border-top: 1px solid var(--glass-border-inner);
}

.lesson-sidebar-section:first-child .lesson-sidebar-section-title {
  border-top: none;
}

/* Aula de texto */
.lesson-text-content {
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  padding: 28px 32px;
  line-height: 1.8;
  font-size: 15px;
  color: var(--text-primary);
}

.lesson-text-content>*:first-child {
  margin-top: 0 !important;
}

.lesson-text-content>*:last-child {
  margin-bottom: 0 !important;
}

.lesson-text-content h1 {
  font-size: 1.55em;
  margin: 1.3em 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.lesson-text-content h2 {
  font-size: 1.25em;
  margin: 1.3em 0 0.45em;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.lesson-text-content h3 {
  font-size: 1.05em;
  margin: 1.2em 0 0.4em;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lesson-text-content p {
  margin: 0 0 0.9em;
  color: var(--text-primary);
}

.lesson-text-content ul,
.lesson-text-content ol {
  padding-left: 1.6em;
  margin: 0 0 0.9em;
}

.lesson-text-content li {
  margin: 0.35em 0;
  line-height: 1.7;
}

.lesson-text-content li>p {
  margin-bottom: 0.3em;
}

.lesson-text-content strong {
  font-weight: 600;
}

.lesson-text-content em {
  font-style: italic;
}

.lesson-text-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lesson-text-content hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: 1.5em 0;
}

.lesson-text-content code {
  background: var(--control-bg);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.875em;
  font-family: "SF Mono", Menlo, monospace;
}

.lesson-text-content pre {
  background: var(--control-bg);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 1em;
}

.lesson-text-content pre code {
  background: none;
  padding: 0;
  font-size: 0.875em;
}

.lesson-text-content blockquote {
  border-left: 1px solid var(--accent);
  margin: 0 0 1em;
  padding: 8px 16px;
  color: var(--text-secondary);
  font-style: italic;
  border-radius: 0 6px 6px 0;
  background: var(--control-bg);
}

.lesson-text-content blockquote p {
  margin-bottom: 0;
}

.lesson-text-content img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
  margin: 1.4em auto;
  border: 1px solid var(--glass-border-outer);
}

.lesson-text-content video {
  max-width: 100%;
  border-radius: 12px;
  display: block;
  margin: 1.4em auto;
}

.lesson-text-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1em;
  font-size: 0.92em;
}

.lesson-text-content th,
.lesson-text-content td {
  padding: 8px 12px;
  border: 1px solid var(--divider);
  text-align: left;
}

.lesson-text-content th {
  background: var(--control-bg);
  font-weight: 600;
}

/* Anexos */
.lesson-attachments {
  margin-top: 16px;
}

/* Anexos agora vivem no próprio container (separado da descrição) */
.lesson-attachments-card .lesson-attachments {
  margin-top: 0;
}

.lesson-attachments-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.lesson-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-attachment-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.lesson-attachment-item:hover {
  background: var(--control-bg-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.lesson-attachment-icon {
  color: var(--accent);
  flex-shrink: 0;
}

.lesson-attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lesson-attachment-dl {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* Drip-lock content block (ocupa o lugar do vídeo/conteúdo) */
.drip-lock-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  aspect-ratio: 16/9;
  justify-content: center;
  gap: 14px;
  background: var(--control-bg);
  border-radius: 12px;
  border: 1px solid var(--glass-border-inner);
}

.drip-lock-icon {
  color: var(--text-tertiary);
  opacity: 0.5;
}

.drip-lock-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.drip-lock-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 360px;
  line-height: 1.6;
}

.drip-lock-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 14px;
  padding: 8px 20px;
}

.video-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.video-container iframe,
.video-container video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ---- Proteção de vídeo + marca d'água ---- */
.video-protected {
  user-select: none;
  -webkit-user-select: none;
}

.video-protected video {
  object-fit: contain;
  background: #000;
  pointer-events: none;
}

/* ---- Video Loading Indicator ---- */
.vp-loading {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 11;
  gap: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.vp-spinner {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-top-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.vp-loading-text {
  font-weight: 500;
  letter-spacing: 0.3px;
}

/* ---- Custom Video Player ---- */
.vp-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}

.vp-big-play {
  width: 62px;
  height: 62px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.18s;
  pointer-events: none;
  flex-shrink: 0;
}

.vp-big-play svg {
  margin-left: 3px;
}

.vp-overlay.paused .vp-big-play {
  opacity: 1;
}

.vp-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 44px 14px 11px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
  border-radius: 0 0 14px 14px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.vp-overlay:hover .vp-controls,
.vp-overlay.paused .vp-controls,
.vp-overlay.show-controls .vp-controls {
  opacity: 1;
  pointer-events: all;
}

.vp-seekbar {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 99px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: height 0.12s;
}

.vp-seekbar:hover {
  height: 6px;
}

.vp-seekbar-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 99px;
  pointer-events: none;
  width: 0;
}

.vp-seekbar-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  pointer-events: none;
  width: 0;
}

.vp-seekbar-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px;
  height: 13px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.13s;
}

.vp-seekbar:hover .vp-seekbar-thumb {
  opacity: 1;
}

.vp-btns-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vp-btns-left,
.vp-btns-right {
  display: flex;
  align-items: center;
  gap: 1px;
}

.vp-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
  font-family: inherit;
}

.vp-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.vp-btn.is-active {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.vp-time {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  padding: 0 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.vp-speed-btn {
  font-size: 11.5px;
  font-weight: 600;
  min-width: 32px;
  letter-spacing: 0.01em;
}

.vp-volume-slider {
  width: 62px;
  height: 3px;
  cursor: pointer;
  accent-color: rgba(255, 255, 255, 0.88);
  margin: 0 2px;
  vertical-align: middle;
}

.vp-speed-wrap {
  position: relative;
}

.vp-speed-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: rgba(14, 14, 14, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 4px;
  display: none;
  flex-direction: column;
  gap: 1px;
  min-width: 72px;
  z-index: var(--z-video-controls);
}

.vp-speed-menu.open {
  display: flex;
}

.vp-speed-option {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9px;
  text-align: center;
  font-family: inherit;
  transition: background 0.1s;
}

.vp-speed-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.vp-speed-option.active {
  color: var(--accent);
  font-weight: 600;
}

/* ---- YouTube iframe: posicionamento absoluto e remoção de branding ---- */
#yt-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


/* Shield de topo: gradiente sutil que cobre o logo do YouTube (canto superior) */
.vp-yt-top-shield {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, transparent 100%);
  pointer-events: none;
  z-index: 11;
}

.vp-yt-bottom-shield {
  display: none;
}

/* Últimos 21s: bloqueia o end-screen do YouTube sem mostrar o botão de replay */
.vp-overlay.yt-block-endscreen {
  background: rgba(0, 0, 0, 0.92);
}

/* Após ENDED: cobre completamente as recomendações do YouTube */
.vp-overlay.yt-ended {
  background: rgba(0, 0, 0, 0.92);
  cursor: default;
}

.vp-overlay.yt-ended .vp-big-play {
  display: none;
}

/* Mensagem de vídeo encerrado */
.vp-ended-msg {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.vp-overlay.yt-ended .vp-ended-msg {
  display: flex;
  pointer-events: auto;
}

.vp-ended-replay-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: #fff;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.vp-ended-replay-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ---- Card de preview de vídeo do YouTube (admin — formulário de aula) ---- */
.yt-preview-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--fill-secondary);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
}

.yt-preview-thumb {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 9px;
  flex-shrink: 0;
  background: var(--control-bg);
}

.yt-preview-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.yt-preview-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-preview-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Fake fullscreen para YouTube — evita que o YouTube ative fullscreen-controls-always-on
   (o player nativo do YouTube detecta requestFullscreen e exibe sua própria UI fullscreen) */
#video-player-wrap.yt-fake-fullscreen {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(100vw, calc(100vh * 16 / 9)) !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  z-index: 99998 !important;
  border-radius: 0 !important;
}

body.yt-fake-fullscreen-active {
  overflow: hidden;
}

body.yt-fake-fullscreen-active::before {
  content: '';
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99997;
}

/* ---- Quality selector (YouTube IFrame player) ---- */
.vp-quality-wrap {
  position: relative;
}

.vp-quality-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: rgba(14, 14, 14, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 4px;
  display: none;
  flex-direction: column;
  gap: 1px;
  min-width: 80px;
  z-index: var(--z-video-controls);
}

.vp-quality-menu.open {
  display: flex;
}

.vp-quality-option {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 9px;
  text-align: center;
  font-family: inherit;
  transition: background 0.1s;
}

.vp-quality-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.vp-quality-option.active {
  color: var(--accent);
  font-weight: 600;
}

.video-watermark {
  position: absolute;
  display: none;
  padding: 5px 12px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.70);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  pointer-events: none;
  z-index: var(--z-video-overlay);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Marca d'água permanente — canto inferior esquerdo, muito discreta */
.video-watermark-perm {
  position: absolute;
  bottom: 48px;
  left: 12px;
  display: none;
  padding: 3px 8px;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.12);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  pointer-events: none;
  z-index: calc(var(--z-video-overlay) - 1);
  white-space: nowrap;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  -webkit-user-select: none;
  mix-blend-mode: screen;
}

.video-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--control-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--glass-border-inner);
}

.pdf-container {
  width: 100%;
  min-height: 600px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border-inner);
}

.pdf-container iframe {
  width: 100%;
  height: 100%;
  min-height: 600px;
  border: none;
}

.content-html {
  line-height: 1.7;
}

.content-html h1,
.content-html h2,
.content-html h3 {
  margin-bottom: 12px;
  margin-top: 24px;
}

.content-html p {
  margin-bottom: 14px;
  color: var(--text-primary);
}

.content-html a {
  color: var(--accent);
}

.content-html ul,
.content-html ol {
  padding-left: 20px;
  margin-bottom: 14px;
}

.content-html li {
  margin-bottom: 6px;
}

.content-html code {
  background: var(--control-bg);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 0.9em;
}

.content-html pre {
  background: var(--control-bg);
  border-radius: 12px;
  padding: 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.content-html pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}

.content-html blockquote {
  border-left: 1px solid var(--accent);
  padding-left: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.content-html img {
  max-width: 100%;
  border-radius: 12px;
}

/* ---- Lesson info card ---- */
.lesson-info-card {
  gap: 10px;
  display: flex;
  flex-direction: column;
}

.lesson-info-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.lesson-info-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0;
}

/* ---- Progress tracker (module detail) ---- */
.progress-tracker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--control-bg);
  border-radius: 12px;
  border: 1px solid var(--glass-border-inner);
}

.progress-tracker label {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.progress-tracker .progress {
  flex: 1;
}

.progress-tracker .pct {
  font-size: 12px;
  font-weight: 500;
  min-width: 32px;
  text-align: right;
}

/* ---- Profile view ---- */
#view-profile > * {
  /* Largura de leitura para o formulário, mas alinhado à esquerda como as
     demais telas. Antes o #view-profile inteiro tinha max-width e ficava
     centralizado: o conteúdo saltava 270px ao sair de qualquer outra aba. */
  max-width: 680px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  margin-bottom: 14px;
}

.profile-avatar-wrap {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  display: block;
}

.profile-avatar-wrap:hover .profile-avatar-overlay {
  opacity: 1;
}

.profile-avatar-img {
  display: block;
  object-fit: cover;
}

.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.52);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.18s ease;
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
}

.profile-avatar-wrap:hover .profile-avatar-overlay {
  opacity: 1;
  pointer-events: auto;
}

.profile-hero-info {
  flex: 1;
  min-width: 0;
}

.profile-hero-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-hero-email {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-section {
  margin-bottom: 14px;
}

.profile-section-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 20px;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.profile-form-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--glass-border-inner);
  margin-top: 4px;
}

/* ---- View section header (reutilizável) ---- */
.view-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.view-section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.3;
}

/* ============================================================
   NOTIFICATIONS — bell, popup, list, detail
   ============================================================ */

/* ---- Bell indicator ---- */
.notif-btn { position: relative; }
.notif-ring-3 { display: none; }

.notif-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--color-red);
  border-radius: 50%;
  border: 1.5px solid var(--glass-bg-toolbar);
  pointer-events: none;
}

/* ---- Popup ---- */
.notif-popup {
  position: fixed;
  width: 360px;
  max-height: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Animate in/out */
  opacity: 0;
  transform: translateY(-6px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.05);
}

.notif-popup.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.notif-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--glass-border-inner);
  flex-shrink: 0;
  gap: 8px;
}

.notif-popup-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  flex: 1;
}

.notif-popup-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.notif-popup-scroll {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.notif-popup-footer {
  border-top: 1px solid var(--glass-border-inner);
  flex-shrink: 0;
}

.notif-see-all-btn {
  display: block;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  transition: color 0.1s, background 0.1s;
}

.notif-see-all-btn:hover {
  color: var(--text-primary);
  background: var(--row-hover);
}

/* ---- Popup empty state ---- */
.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 36px 16px;
  color: var(--text-tertiary);
  font-size: 12px;
}

.notif-empty-icon { font-size: 26px; }

/* ---- Shared list container ---- */
.notif-list {
  display: flex;
  flex-direction: column;
}

/* On the full page: card-like bordered wrapper around items only */
.notif-items-wrap {
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  overflow: hidden;
  background: var(--glass-bg-card);
}

/* ---- Notification item ---- */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--glass-border-inner);
  position: relative;
  transition: background 0.1s;
  outline: none;
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-item:hover {
  background: var(--row-hover);
}

.notif-item.unread {
  background: rgba(var(--accent-rgb), 0.04);
}

.notif-item.unread:hover {
  background: var(--row-hover);
}

/* Slightly more breathing room on the full page */
#view-notifications .notif-item {
  padding: 14px 20px;
}

/* Emoji chip */
.notif-item-emoji {
  font-size: 15px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--fill-secondary);
  border-radius: 9px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Body */
.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.notif-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.notif-item.unread .notif-title {
  font-weight: 600;
}

.notif-time {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  white-space: nowrap;
}

.notif-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Unread dot — right side */
.notif-unread-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
  align-self: flex-start;
}

/* ---- Detail modal ---- */
/* Estrutura (overlay/card/header) agora vem do componente Modal
   compartilhado (components.css); .modal-body some o padding padrão
   pois a imagem/vídeo precisa ficar rente às bordas — o padding volta
   em .notif-detail-body, que envolve o resto do conteúdo. */
.notif-detail-modal .modal-body {
  padding: 0;
}

.notif-detail-img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.notif-detail-video {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
  background: #000;
}

.notif-detail-body {
  padding: 20px;
}

.notif-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.notif-detail-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid var(--glass-border-outer);
  background: var(--fill-secondary);
  color: var(--text-secondary);
}

.notif-detail-badge.success {
  background: var(--badge-success-bg);
  color: var(--color-green);
  border-color: transparent;
}

.notif-detail-badge.warning {
  background: var(--badge-warning-bg);
  color: var(--color-yellow);
  border-color: transparent;
}

.notif-detail-badge.promo {
  background: var(--badge-promo-bg);
  color: var(--color-purple);
  border-color: transparent;
}

.notif-detail-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.notif-detail-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.notif-detail-content h1,
.notif-detail-content h2,
.notif-detail-content h3 {
  color: var(--text-primary);
  margin: 1em 0 0.4em;
}

.notif-detail-content p { margin-bottom: 0.8em; }
.notif-detail-content a { color: var(--accent); }

.notif-detail-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border-inner);
}

/* ---- Push opt-in banner ---- */
.push-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--fill-secondary);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  margin-bottom: 12px;
}

.push-banner-icon { font-size: 20px; flex-shrink: 0; }
.push-banner-text { flex: 1; }

.push-banner-text p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-top: 2px;
}

.push-banner-text strong {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.push-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .notif-popup {
    width: calc(100vw - 32px);
    right: 16px !important;
  }

  .modal-overlay:has(.notif-detail-modal) {
    padding: 0;
    align-items: flex-end;
  }

  .notif-detail-modal {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
  }

  .push-banner { flex-wrap: wrap; }
  .push-banner-actions { width: 100%; }
}

/* ----------------------------------------------------------------
   Estado bloqueado do course-card
   Princípio: nunca esconder o conteúdo (sem blur, sem cadeado no
   meio do banner). A capa fica nítida e o aviso é honesto porém
   discreto — selo no canto, moldura âmbar e uma faixa de CTA que
   acende no hover.
   ---------------------------------------------------------------- */

/* A capa bloqueada usa o mesmo gradiente-base do rodapé (sem tint escuro) */

/* Cadeado no canto: só o ícone, sem texto e sem tapar a arte */
.course-lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(10, 12, 16, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  pointer-events: none;
  transition: background 0.18s var(--ease-smooth),
              border-color 0.18s var(--ease-smooth);
}

.course-lock-badge svg {
  opacity: 0.9;
  flex-shrink: 0;
}

.course-card.locked:hover .course-lock-badge {
  background: rgba(var(--color-orange-rgb), 0.92);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Moldura âmbar de baixo contraste — diferencia sem rebaixar o card */
.course-card.locked {
  border-color: rgba(var(--color-orange-rgb), 0.24);
}

.course-card.locked:hover {
  background: var(--control-bg-hover);
  border-color: rgba(var(--color-orange-rgb), 0.5);
  box-shadow: var(--shadow-lg), 0 6px 22px -10px rgba(var(--color-orange-rgb), 0.55);
}

/* Ícone da capa concluída (100%) continua usando .lock-overlay */
.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
}

.lock-icon-wrap {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.52);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ---- Upsell Modal ---- */
.upsell-modal-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.upsell-course-card {
  display: flex;
  gap: 14px;
  background: var(--control-bg);
  border: 1px solid var(--glass-border-inner);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.1s ease;
}

.upsell-course-card:hover {
  background: var(--control-bg-hover);
}

.upsell-course-thumb {
  width: 100px;
  aspect-ratio: 4/5;
  object-fit: cover;
  flex-shrink: 0;
}

.upsell-course-placeholder {
  width: 100px;
  aspect-ratio: 4/5;
  background: var(--control-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.upsell-course-info {
  padding: 12px 14px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.upsell-course-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.upsell-course-price {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* ---- Inline upsell banner (dentro do detalhe do curso) ---- */
.upsell-inline-banner {
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border-inner);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.upsell-inline-thumb {
  width: 80px;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.upsell-inline-placeholder {
  width: 80px;
  aspect-ratio: 4/5;
  background: var(--control-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.upsell-inline-info {
  flex: 1;
  min-width: 0;
}

.upsell-inline-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 3px;
}

.upsell-inline-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upsell-inline-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 600px) {
  .upsell-inline-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .upsell-inline-thumb,
  .upsell-inline-placeholder {
    width: 100%;
    aspect-ratio: 4/5;
  }
}

/* ---- Search bar (modules) ---- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Quando a search-bar não usa classe .card, não deve ter espaço extra */
#courses-search-bar {
  padding: 2px 0;
}

.category-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.category-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.category-pill:hover {
  color: var(--text-primary);
}

.category-pill.active {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
}

/* ---- Responsividade: module detail ---- */
@media (max-width: 600px) {
  .module-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .progress-tracker {
    flex-wrap: wrap;
    gap: 8px;
  }

  .progress-tracker input[type="range"] {
    width: 100%;
    max-width: 100% !important;
    order: 3;
  }

  .profile-form {
    gap: 14px;
  }

  .profile-hero {
    flex-direction: column;
    text-align: center;
  }

  .profile-hero-info {
    text-align: center;
    width: 100%;
  }

  .profile-fields-grid {
    grid-template-columns: 1fr;
  }

  .profile-form-footer {
    justify-content: stretch;
  }

  .profile-form-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .avatar-upload {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---- Responsividade: lesson sidebar ---- */
@media (max-width: 1100px) {
  .lesson-body-layout.has-sidebar {
    grid-template-columns: 1fr 240px;
  }
}

@media (max-width: 900px) {
  .lesson-body-layout.has-sidebar {
    grid-template-columns: 1fr;
  }

  .lesson-sidebar-panel {
    position: static;
    max-height: 360px;
    order: 2;
  }

  .lesson-main-col {
    order: 1;
  }
}

/* ---- Course detail improvements ---- */
.course-detail-header.card {
  padding: 20px 24px;
  overflow: hidden;
  gap: 20px;
  align-items: flex-start;
}

.course-detail-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.course-hero-thumb-wrap {
  width: 130px;
  min-width: 100px;
  aspect-ratio: 1;
  flex-shrink: 0;
  border-radius: 12px;
  border: 1px solid var(--glass-border-inner);
  overflow: hidden;
  position: relative;
  background: var(--control-bg);
}

.course-hero-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.course-hero-placeholder {
  width: 130px;
  min-width: 100px;
  aspect-ratio: 1;
  background: var(--control-bg);
  border: 1px solid var(--glass-border-inner);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  flex-shrink: 0;
}


@media (max-width: 600px) {
  .course-detail-header.card {
    padding: 14px;
    gap: 14px;
  }

  .course-hero-thumb-wrap,
  .course-hero-placeholder {
    width: 90px;
    min-width: 80px;
  }

  .course-detail-header.card {
    flex-direction: row;
    align-items: flex-start;
  }
}

/* ============================================================
   LOCKED COURSE PREVIEW PAGE
   ============================================================ */
.locked-course-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Hero card — reuses .course-hero-thumb / .course-hero-placeholder from course detail */
.locked-hero-card.card {
  padding: 18px;
  gap: 18px;
  align-items: flex-start;
}

.locked-hero-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.locked-hero-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text-primary);
}

.locked-hero-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.locked-hero-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.locked-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.locked-price {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.locked-no-link {
  font-size: 12px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ============================================================
   CTA — botão "Adquirir Acesso" padronizado com btn-primary
   ============================================================ */
.cta-glow {
  display: inline-flex;
  text-decoration: none;
  min-width: 240px;
}

.cta-glow-inner {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s ease;
  position: relative;
  overflow: hidden;
}

.cta-glow-inner:hover {
  background: var(--accent-hover);
}

.cta-glow-inner:active {
  opacity: 0.9;
}

.cta-glow-inner>svg {
  color: var(--on-accent);
}

/* Seta anima, resto fica quieto */

.cta-glow-label {
  font-size: 15px;
  font-weight: 600;
}

.cta-glow:focus-visible .cta-glow-inner {
  outline: 3px solid var(--accent-ring);
  outline-offset: 3px;
}

/* Mobile: full-width */
@media (max-width: 700px) {
  .cta-glow {
    width: 100%;
    min-width: 0;
  }

  .cta-glow-inner {
    padding: 13px 20px;
  }
}

/* Buy button — legacy reset */
.locked-buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

/* Buy footer — below the modules card */
.locked-buy-footer {
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border-inner);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.locked-buy-footer-text {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

.locked-course-badges {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* Module list section */
.locked-modules-section {
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  overflow: hidden;
}

.locked-modules-header {
  padding: 16px 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border-inner);
}

.locked-module-item {
  border-bottom: 1px solid var(--glass-border-inner);
}

.locked-module-item:last-child {
  border-bottom: none;
}

.locked-module-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.locked-module-header:hover {
  background: var(--row-hover);
}

.locked-module-num {
  min-width: 22px;
  height: 22px;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  padding: 0 5px;
}

.locked-module-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locked-module-count {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.locked-module-chevron {
  transition: transform 0.22s ease;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.locked-module-chevron.open {
  transform: rotate(180deg);
}

.locked-lessons-list {
  display: none;
  border-top: 1px solid var(--glass-border-inner);
}

.locked-lessons-list.open {
  display: block;
}

.locked-lesson-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 44px;
  border-top: 1px solid var(--glass-border-inner);
}

.locked-lesson-row:first-child {
  border-top: none;
}

.locked-lesson-icon {
  color: var(--text-tertiary);
  display: flex;
  flex-shrink: 0;
}

.locked-lesson-title {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.locked-lesson-type {
  color: var(--text-tertiary);
  display: flex;
  flex-shrink: 0;
}

.locked-lesson-dur {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* Sticky CTA bar */
.locked-cta-bar {
  position: fixed;
  bottom: 0;
  left: 240px;
  right: 0;
  padding: 14px 28px;
  background: var(--glass-bg-toolbar);
  border-top: 1px solid var(--glass-border-inner);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  z-index: var(--z-dropdown);
}

.locked-cta-bar .btn-buy {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 12px;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.1s;
}

.locked-cta-bar .btn-buy:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.locked-cta-bar .btn-back {
  background: var(--control-bg);
  color: var(--text-secondary);
  border: 1px solid var(--control-border);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}

.locked-cta-bar .btn-back:hover {
  background: var(--control-bg-hover);
  color: var(--text-primary);
}

@media (max-width: 900px) {
  .locked-cta-bar {
    left: 0;
    padding: 12px 18px;
  }
}

@media (max-width: 600px) {
  .locked-hero-card.card {
    flex-direction: column;
    gap: 14px;
    padding: 14px;
  }

  .locked-hero-card.card .course-hero-thumb-wrap,
  .locked-hero-card.card .course-hero-placeholder {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16/9;
    border-radius: 14px;
  }
}

/* ============================================================
   COURSE DETAIL PAGE — flat (sem card-wrapper no cabeçalho)
   ============================================================ */

/* Wrapper da página */
.course-page {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Back button row */
.course-back-row {
  padding: 0;
}

/* Hero — título/desc inline, sem borda/card */
.course-page-hero {
  padding: 4px 0 0;
}

.course-page-hero-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}

.course-page-hero-text {
  flex: 1;
  min-width: 0;
}

.course-page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin-bottom: 0;
  color: var(--text-primary);
}

.course-page-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 4px;
}

.course-page-desc.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-page-desc-toggle {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  display: block;
}

.course-page-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: var(--text-tertiary);
  flex-wrap: wrap;
  margin-top: 8px;
  align-items: center;
}

.course-page-thumb-wrap {
  width: 130px;
  aspect-ratio: 4/5;
  flex-shrink: 0;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border-inner);
  background: var(--control-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-page-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.course-page-thumb-icon-badge {
  position: absolute;
  bottom: 7px;
  left: 7px;
  background: rgba(0, 0, 0, 0.60);
  border-radius: 9px;
  padding: 5px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.course-page-thumb-wrap .course-page-thumb-icon-center {
  color: var(--accent);
  opacity: 0.7;
}

/* Seção heading reutilizável */
.course-section-heading {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* Cabeçalho da seção "Conteúdo" */
.course-outline-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.course-outline-header-left {}

.course-outline-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* Outline container — envolvente de todos os módulos */
.course-outline {
  background: var(--glass-bg-card);
  border: 1px solid var(--glass-border-outer);
  border-radius: 12px;
  overflow: hidden;
}

/* Seção (módulo) */
.course-outline-section+.course-outline-section {
  border-top: 1px solid var(--glass-border-inner);
}

/* Header da seção */
.course-outline-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--control-bg);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.course-outline-section-header:hover {
  background: var(--control-bg-hover);
}

.course-outline-chevron {
  transition: transform 0.2s;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.course-outline-chevron.open {
  transform: rotate(180deg);
}

.course-outline-section-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 22px;
}

.course-outline-section-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.course-outline-section-stats {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}

/* Descrição do módulo — sempre pública (aparece mesmo com drip/sem acesso) */
.course-outline-section-desc {
  padding: 12px 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  border-top: 1px solid var(--glass-border-inner);
  background: var(--bg-elevated);
}
.course-outline-section-desc > :last-child { margin-bottom: 0; }
.course-outline-section-desc > :first-child { margin-top: 0; }

/* Lista de aulas */
.course-outline-lessons {
  border-top: 1px solid var(--glass-border-inner);
}

/* Linha de aula */
.course-outline-lesson {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px 11px 44px;
  border-bottom: 1px solid var(--glass-border-inner);
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}

.course-outline-lesson:last-child {
  border-bottom: none;
}

.course-outline-lesson:hover:not(.locked) {
  background: var(--row-hover);
}

.course-outline-lesson.active {
  background: var(--row-hover);
}

.course-outline-lesson.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.course-outline-lesson.locked {
  opacity: 0.4;
  cursor: default;
}

.course-outline-lesson.completed .course-outline-lesson-title {
  color: var(--text-secondary);
}

/* Indicador circular de status */
.lesson-status-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--control-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}

.lesson-status-dot.completed {
  background: var(--color-green);
  border-color: var(--color-green);
}

.lesson-status-dot.in-progress {
  border-color: var(--accent);
}

.course-outline-lesson-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
}

.course-outline-lesson-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.course-outline-lesson-dur {
  font-size: 11px;
  color: var(--text-tertiary);
}

.course-outline-lesson-type {
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
}

/* Ícone do TIPO de conteúdo — no início da row (antes do título) */
.course-outline-lesson > .lesson-type-icon {
  width: 20px;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.course-outline-lesson.completed > .lesson-type-icon { color: var(--color-green); }

/* Status no FINAL da row (concluída / progresso / bloqueada / drip) */
.lesson-end-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.lesson-end-status.completed   { color: var(--color-green); }
.lesson-end-status.in-progress { color: var(--accent); }
.lesson-end-status.locked      { color: var(--text-tertiary); }
.lesson-end-status.drip        { color: var(--color-orange); }

/* Seção drip-locked no outline */
.course-outline-drip-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--control-bg);
  border-bottom: 1px solid var(--glass-border-inner);
  opacity: 0.7;
}

.course-outline-drip-row:last-child {
  border-bottom: none;
}

.course-outline-drip-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--badge-warning-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-yellow);
  flex-shrink: 0;
}

.course-outline-drip-info {
  flex: 1;
  min-width: 0;
}

.course-outline-drip-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.course-outline-drip-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Locked page: hero com actions */
.locked-hero-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border-inner);
}

.locked-price-inline {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

/* Mobile: empilha thumbnail abaixo do texto */
@media (max-width: 700px) {
  .course-page-hero-inner {
    flex-direction: column;
    gap: 16px;
  }

  .course-page-thumb-wrap {
    width: 100%;
    aspect-ratio: 16/9;
  }
}

/* ---- Course detail navigation bar ---- */
.course-detail-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}

.course-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.course-breadcrumb-sep {
  flex-shrink: 0;
  opacity: 0.5;
}

.course-breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-nav-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ---- Modules list header ---- */
.modules-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 2px;
}

.modules-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modules-list-meta {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---- Drip-locked module accordion ---- */
.module-accordion.drip-locked {
  opacity: 1;
  border-color: var(--glass-border-inner);
}

.module-accordion.drip-locked .module-accordion-header {
  cursor: default;
}

.module-accordion.drip-locked .module-accordion-header:hover {
  background: transparent;
}

.drip-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--badge-warning-bg);
  border: 1px solid var(--glass-border-inner);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-yellow);
  flex-shrink: 0;
}

.drip-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drip-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-yellow);
  background: var(--badge-warning-bg);
  border: 1px solid rgba(var(--color-orange-rgb), 0.25);
  border-radius: 20px;
  padding: 2px 9px;
}

.drip-release-date {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Admin: drip indicator in module list */
.drip-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--color-yellow);
  background: var(--badge-warning-bg);
  border-radius: 12px;
  padding: 2px 7px;
}

/* ---- Course section separators (inserted between course cards in the grid) ---- */
.course-section-title {
  padding: 12px 0 6px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.3;
}

.course-section-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}

.course-section-divider::before,
.course-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--divider) 0%, transparent 100%);
}

.course-section-divider::after {
  background: linear-gradient(270deg, var(--divider) 0%, transparent 100%);
}

.course-section-divider-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-tertiary);
  flex-shrink: 0;
  background: var(--glass-bg-card);
  padding: 2px 10px;
  border-radius: 20px;
  border: 1px solid var(--glass-border-inner);
}

/* Divider with no label: just a line */
.course-section-divider:empty::after {
  display: none;
}

.course-section-divider:not(:has(.course-section-divider-label))::before {
  flex: 1;
}

.course-section-divider:not(:has(.course-section-divider-label))::after {
  display: none;
}

/* ---- Product section headers (new hierarchy: Product → Module → Topic → Lesson) ---- */
.product-section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 12px;
  margin-top: 12px;
}

/* Line extending to the right of the title */
.product-section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--divider) 0%, transparent 100%);
}

/* First product section gets no top margin */
.product-section-header:first-child {
  margin-top: 0;
  padding-top: 4px;
}

.product-section-photo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  border: 1px solid var(--glass-border-inner);
  background: var(--control-bg);
  position: relative;
  overflow: hidden;
}

.product-section-photo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
}

.product-section-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--control-bg);
  border: 1px solid var(--glass-border-inner);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.product-section-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
  flex-shrink: 0;
}

/* "Outros módulos" section — slightly muted */
.product-section-orphan .product-section-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ============================================================
   GENERATED COVER — capa sofisticada quando não há foto
   Mesh gradient sóbrio + monograma tipográfico + ícone marca-d'água
   Funciona em qualquer container (grid card, accordion thumb, hero).
   ============================================================ */
.generated-cover {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--gc-base, #18181b);
  color: rgba(255, 255, 255, 0.96);
  transition: transform 0.35s ease;
}

/* Mesh gradient — quatro blobs de cor nas quatro quinas */
.generated-cover::before {
  content: '';
  position: absolute;
  inset: -15%;
  background:
    radial-gradient(ellipse at 18% 12%, var(--gc-c1), transparent 58%),
    radial-gradient(ellipse at 82% 18%, var(--gc-c2), transparent 58%),
    radial-gradient(ellipse at 78% 88%, var(--gc-c3), transparent 58%),
    radial-gradient(ellipse at 22% 92%, var(--gc-c4), transparent 58%);
  filter: blur(24px) saturate(120%);
  z-index: 0;
}

/* Textura de grain sutil + vinheta — sobreposição fina de sofisticação */
.generated-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.28) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/></svg>");
  mix-blend-mode: overlay;
  opacity: 0.55;
  z-index: 2;
  pointer-events: none;
}

.gc-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px;
  text-align: center;
  width: 100%;
  height: 100%;
}

.gc-monogram {
  font-family: var(--font-system);
  font-size: clamp(54px, 28cqw, 140px);
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 0.85;
  color: rgba(255, 255, 255, 0.96);
  text-shadow:
    0 2px 24px rgba(0, 0, 0, 0.35),
    0 0 1px rgba(255, 255, 255, 0.3);
  font-feature-settings: "ss01";
  user-select: none;
  display: flex;
  align-items: baseline;
  gap: 0.02em;
}

.gc-icon {
  color: rgba(255, 255, 255, 0.72);
  opacity: 0.85;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
}

/* Marca no canto — pequena badge tipo selo */
.gc-mark {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

/* Usa container queries quando o pai permitir */
.course-thumb-wrapper,
.module-accordion-thumb-wrap,
.course-hero-thumb-wrap,
.course-page-thumb-wrap,
.product-section-photo {
  container-type: inline-size;
}

/* ---- Variantes sóbrias (6 paletas derivadas do hash do título) ---- */
.generated-cover.gc-v1 {
  --gc-base: #0b1220;
  --gc-c1: #1e3a8a;
  --gc-c2: #007aff;
  --gc-c3: #0f172a;
  --gc-c4: #1e293b;
}

.generated-cover.gc-v2 {
  --gc-base: #0f1a14;
  --gc-c1: #0f766e;
  --gc-c2: #065f46;
  --gc-c3: #0b1f17;
  --gc-c4: #134e4a;
}

.generated-cover.gc-v3 {
  --gc-base: #16101e;
  --gc-c1: #5b21b6;
  --gc-c2: #7c3aed;
  --gc-c3: #1f1234;
  --gc-c4: #4c1d95;
}

.generated-cover.gc-v4 {
  --gc-base: #1a1008;
  --gc-c1: #b45309;
  --gc-c2: #9a3412;
  --gc-c3: #1c1206;
  --gc-c4: #78350f;
}

.generated-cover.gc-v5 {
  --gc-base: #1a0e0e;
  --gc-c1: #991b1b;
  --gc-c2: #7f1d1d;
  --gc-c3: #1a0909;
  --gc-c4: #b91c1c;
}

.generated-cover.gc-v6 {
  --gc-base: #0f1012;
  --gc-c1: #334155;
  --gc-c2: #1f2937;
  --gc-c3: #0b0c0e;
  --gc-c4: #475569;
}

/* Pequeno ajuste de monograma em thumbs pequenos (accordion 50px) */
.module-accordion-thumb-wrap .generated-cover .gc-monogram {
  font-size: 22px;
}

.module-accordion-thumb-wrap .generated-cover::after {
  opacity: 0.4;
}

.module-accordion-thumb-wrap .generated-cover .gc-mark,
.module-accordion-thumb-wrap .generated-cover .gc-icon {
  display: none;
}

/* Mesma sutileza em upsell thumbs se existirem */
.upsell-course-thumb .generated-cover .gc-mark,
.upsell-course-thumb .generated-cover .gc-icon {
  display: none;
}

.upsell-course-thumb .generated-cover .gc-monogram {
  font-size: 28px;
}

/* Capa gerada bloqueada: nenhuma diferença de nitidez/cor */


/* ================================================================
   FERRAMENTAS (Tools view)
   ================================================================ */

.tools-view {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.tools-category-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tools-category-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0 4px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

/* Tool card — icon-centric app-launcher style */
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.1s ease, transform 0.18s var(--ease-smooth),
              box-shadow 0.18s var(--ease-smooth);
  text-align: center;
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.tool-card:hover {
  background: var(--control-bg-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.tool-card:hover::before {
  opacity: 0.04;
}

.tool-card:active {
  background: var(--fill-secondary);
  transform: translateY(-1px);
}

.tool-icon {
  font-size: 36px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--control-bg, rgba(0, 0, 0, 0.04));
  border: 1px solid var(--glass-border-outer);
  transition: background 0.15s;
  flex-shrink: 0;
}

.tool-card:hover .tool-icon {
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.25);
}

/* Favicon / custom-image icon inside .tool-icon */
.tool-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

.tool-icon-emoji {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  line-height: 1;
}

.tool-icon-emoji-show {
  display: flex;
}

.tool-icon-img.favicon-error {
  display: none;
}

.tool-icon-img.favicon-error~.tool-icon-emoji {
  display: flex;
}

.tool-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.3;
  word-break: break-word;
}

.tool-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.45;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card-ext-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--control-bg);
  border: 1px solid var(--glass-border-outer);
  color: var(--text-tertiary);
  opacity: 0;
  transition: opacity 0.15s;
}

.tool-card:hover .tool-card-ext-badge {
  opacity: 1;
}

/* Empty state */
.tools-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 24px;
  color: var(--text-tertiary);
  text-align: center;
}

.tools-empty p {
  font-size: 14px;
  max-width: 280px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .tool-card {
    padding: 16px 10px 14px;
    gap: 8px;
    border-radius: 12px;
  }

  .tool-icon {
    width: 44px;
    height: 44px;
    font-size: 26px;
    border-radius: 12px;
  }

  .tool-name {
    font-size: 11px;
  }

  .tool-desc {
    display: none;
  }
}

@media (max-width: 360px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================================================
   MEUS ACESSOS (My Access view)
   ================================================================ */

.my-access-view {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ── Section header ── */
.access-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.access-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
}

.access-section-icon {
  width: 28px;
  height: 28px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.access-section-icon.subs {
  background: rgba(var(--color-orange-rgb, 255, 149, 0), 0.12);
  color: var(--color-orange, #FF9500);
}

.access-section-icon.perp {
  background: rgba(52, 199, 89, 0.12);
  color: var(--color-green);
}

.access-section-icon.timed {
  background: rgba(0, 122, 255, 0.12);
  color: var(--color-blue);
}

.access-section-icon.tools {
  background: rgba(var(--accent-rgb), 0.10);
  color: var(--accent);
}

.access-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.access-section-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--control-bg);
  border: 1px solid var(--glass-border-outer);
  border-radius: 20px;
  padding: 2px 9px;
}

/* ── Access card ── */
.access-card {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-md);
  transition: background 0.1s;
}

.access-card:hover {
  background: var(--control-bg-hover);
}

.access-card.expired {
  opacity: 0.55;
}

/* Thumbnail / icon area */
.access-card-thumb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--control-bg);
  border: 1px solid var(--glass-border-outer);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.access-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Body */
.access-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.access-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.access-card-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.access-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}

.access-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.access-meta-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.access-meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-tertiary);
  opacity: 0.4;
}

/* Status badge */
.access-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}

.access-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.access-status.active {
  background: rgba(52, 199, 89, 0.12);
  color: var(--color-green);
}

.access-status.active .access-status-dot {
  background: var(--color-green);
}

.access-status.expired {
  background: var(--control-bg);
  color: var(--text-tertiary);
}

.access-status.expired .access-status-dot {
  background: var(--text-tertiary);
}

.access-status.canceled {
  background: rgba(255, 59, 48, 0.10);
  color: var(--color-red);
}

.access-status.canceled .access-status-dot {
  background: var(--color-red);
}

.access-status.past-due {
  background: rgba(255, 149, 0, 0.12);
  color: var(--color-orange);
}

.access-status.past-due .access-status-dot {
  background: var(--color-orange);
}

.access-status.free {
  background: rgba(0, 122, 255, 0.10);
  color: var(--color-blue);
}

.access-status.free .access-status-dot {
  background: var(--color-blue);
}

.access-status.pending {
  background: rgba(255, 149, 0, 0.10);
  color: var(--color-orange);
}

.access-status.pending .access-status-dot {
  background: var(--color-orange);
}

/* ── Subscription card extras ── */
.access-card-renewal {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--fill-tertiary);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.access-card-renewal svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* ── Tools list (within access view) ── */
.access-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.access-tool-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: background 0.1s;
}

.access-tool-chip:hover {
  background: var(--control-bg-hover);
}

.access-tool-chip-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.access-tool-chip-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Empty section ── */
.access-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: var(--surface);
  border: 1px dashed var(--glass-border-outer);
  border-radius: 12px;
  color: var(--text-tertiary);
  font-size: 13px;
}

/* ── Expiry progress bar ── */
.access-expiry-bar {
  margin-top: 6px;
  height: 3px;
  background: var(--control-bg);
  border-radius: 2px;
  overflow: hidden;
}

.access-expiry-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}

.access-expiry-bar-fill.ok {
  background: var(--color-green);
}

.access-expiry-bar-fill.warn {
  background: var(--color-orange);
}

.access-expiry-bar-fill.danger {
  background: var(--color-red);
}

@media (max-width: 560px) {
  .access-card {
    padding: 14px 16px;
    gap: 12px;
  }

  .access-card-thumb {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 18px;
  }

  .access-tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   ANEXOS — cards sofisticados (nome + tipo + peso)
   ============================================================ */
.attach-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  font-size: 11px; font-weight: 700; border-radius: 9px;
  background: var(--fill-primary); color: var(--text-secondary); vertical-align: middle;
}
.attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.attach-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}
.attach-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.attach-icon {
  flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--fill-secondary);
  color: var(--accent);
}
.attach-icon svg { width: 20px; height: 20px; }
.attach-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.attach-name {
  font-size: 13px; font-weight: 600; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-meta {
  font-size: 11px; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .03em;
}
.attach-dl { flex-shrink: 0; color: var(--text-tertiary); transition: color .15s; }
.attach-card:hover .attach-dl { color: var(--accent); }

/* ============================================================
   HOME — seções + "Continue de onde parou"
   ============================================================ */
.home-section { display: flex; flex-direction: column; gap: 14px; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* Título de seção como overline: quem fala é o conteúdo, não o rótulo. */
.home-section-title {
  font-size: 11px; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-tertiary); margin: 0;
}

.recent-lessons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.rl-card {
  position: relative;
  background: var(--glass-bg-card);
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: box-shadow .18s ease, transform .18s ease;
}
.rl-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.rl-cover { position: relative; aspect-ratio: 16 / 9; background: var(--fill-secondary); overflow: hidden; }
.rl-cover .generated-cover, .rl-cover .rl-thumb { position: absolute; inset: 0; width: 100%; height: 100%; }
.rl-thumb { object-fit: cover; }
.rl-play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.9);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
  z-index: 2; pointer-events: none;
}
.rl-play-badge svg { margin-left: 2px; }
.rl-card:hover .rl-play-badge { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.rl-body { padding: 12px 14px 14px; }
.rl-course {
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .03em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rl-title {
  font-size: 14px; font-weight: 600; color: var(--text-primary); line-height: 1.35; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.rl-meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 18px; }
.rl-bar { flex: 1; height: 5px; border-radius: 99px; background: var(--fill-primary); overflow: hidden; }
.rl-bar-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.rl-pct { font-size: 11px; font-weight: 600; color: var(--text-secondary); flex-shrink: 0; }
.rl-done { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--color-green); }
.rl-continue { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent); }