/* app.css — layout do Precifica Mais. So usa os tokens de cor do theme.css
   (nunca codigos de cor de marca soltos). Tema dark, acento em ouro. */

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1100px 550px at 50% -12%, var(--bg-surface) 0%, var(--bg-base) 62%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--emerald-light); text-decoration: none; }

/* Barra do topo */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text-main); letter-spacing: .5px; }
.brand-accent { color: var(--gold); }
.topbar-nav { display: flex; align-items: center; gap: 1rem; }
.topbar-user { color: var(--text-muted); font-size: .95rem; }
.inline-form { margin: 0; }

/* Corpo da pagina */
.page { flex: 1; width: 100%; max-width: 880px; margin: 0 auto; padding: 2.5rem 1.25rem; }

/* Cartoes */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.card-narrow { max-width: 420px; margin: 0 auto; }
.center { text-align: center; }

/* Textos */
.title { margin: 0 0 .5rem; font-size: 1.6rem; }
.subtitle { margin: 1.5rem 0 .75rem; font-size: 1.1rem; }
.muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.25rem; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field-label { font-size: .85rem; color: var(--text-muted); }
.input {
  padding: .7rem .85rem;
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 1rem;
}
.input:focus {
  outline: none;
  border-color: var(--emerald-light);
  box-shadow: 0 0 0 3px rgba(42, 161, 129, 0.2);
}

/* Botoes */
.btn {
  display: inline-block;
  padding: .7rem 1.1rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  background: transparent;
}
.btn-primary {
  background: linear-gradient(180deg, var(--emerald-light), var(--emerald));
  border-color: var(--gold);
  color: var(--bg-base);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-block { width: 100%; }
.btn-ghost { border-color: var(--border); color: var(--text-main); }
.btn-ghost:hover { border-color: var(--emerald-light); }

/* Paginas legais (Termos, Privacidade, Reembolso) — leitura confortavel */
.legal { max-width: 720px; margin: 0 auto; }
.legal p, .legal li { line-height: 1.7; color: var(--text-main); }
.legal .subtitle { margin-top: 1.75rem; color: var(--gold-light); }
.legal ul { padding-left: 1.25rem; margin: .5rem 0 1rem; display: flex; flex-direction: column; gap: .4rem; }

/* Avisos */
.alert { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: .95rem; }
.alert-error { background: rgba(199, 82, 75, 0.12); border: 1px solid var(--danger); color: var(--text-main); }

/* Listas */
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.list-item { padding: .75rem 1rem; background: var(--bg-base); border: 1px solid var(--border); border-radius: 10px; }

/* Numeros do painel */
.stats { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 120px; padding: 1.25rem;
  background: var(--bg-base); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center;
}
.stat-number { display: block; font-size: 2rem; font-weight: 700; color: var(--gold); }
.stat-label { color: var(--text-muted); font-size: .9rem; }

/* Rodape */
.footer { text-align: center; padding: 1.5rem; color: var(--text-muted); }

/* ============================================================
   PAINEL ADMINISTRATIVO (Fase 2)
   Layout com menu lateral + conteudo. So usa tokens do theme.css.
   ============================================================ */

/* Estrutura geral: menu lateral fixo + area de conteudo */
body.admin { }
.admin-shell {
  flex: 1;
  display: grid;
  grid-template-columns: 250px 1fr;
  width: 100%;
}

/* ---- Menu lateral ---- */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
}
.sidebar-brand { font-size: 1.2rem; }
.sidebar-tag {
  margin: -.75rem 0 0; font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
}
.sidebar-nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.sidebar-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; border-radius: var(--radius-sm);
  color: var(--text-main); font-size: .95rem; border: 1px solid transparent;
}
a.sidebar-link:hover { background: var(--bg-base); border-color: var(--border); }
.sidebar-link.is-active {
  background: var(--bg-base);
  border-color: var(--gold);
  color: var(--text-main);
}
.sidebar-ico { color: var(--emerald-light); font-size: .9rem; width: 1rem; text-align: center; }
.sidebar-link.is-active .sidebar-ico { color: var(--gold); }
.sidebar-link.is-soon { color: var(--text-muted); cursor: default; }
.sidebar-link.is-soon .sidebar-ico { color: var(--text-muted); }
.soon-tag {
  margin-left: auto; font-style: normal; font-size: .68rem;
  color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 999px; padding: .05rem .5rem;
}
.sidebar-section {
  margin: 1rem 0 .1rem; font-size: .7rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted);
}
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.sidebar-user { color: var(--text-muted); font-size: .9rem; text-align: center; }

/* ---- Area de conteudo ---- */
.admin-main { padding: 2rem 2.25rem; max-width: 1000px; width: 100%; }
.footer-admin { border-top: 1px solid var(--border); }

/* ---- Trilha (breadcrumb) ---- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1.25rem; font-size: .88rem; }
.crumb { color: var(--text-muted); }
a.crumb:hover { color: var(--emerald-light); }
.crumb-current { color: var(--text-main); font-weight: 600; }
.crumb-sep { color: var(--text-muted); opacity: .6; }

/* ---- Cabecalho de pagina (titulo + acoes) ---- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.page-head .title { margin: 0; }
.page-lead { color: var(--text-muted); margin: .35rem 0 0; }
.page-actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---- Alertas de sucesso ---- */
.alert-ok { background: rgba(42, 161, 129, 0.12); border: 1px solid var(--emerald-light); color: var(--text-main); }

/* ---- Botoes extras ---- */
.btn-sm { padding: .4rem .7rem; font-size: .85rem; }
.btn-danger { border-color: var(--danger); color: var(--text-main); }
.btn-danger:hover { background: rgba(199, 82, 75, 0.14); }
.btn-gold {
  background: var(--gold-metal);
  border-color: var(--gold-deep);
  color: var(--bg-base);
}
.btn-gold:hover { filter: brightness(1.05); }
.btn-icon {
  padding: .3rem .55rem; font-size: .95rem; line-height: 1;
  border-color: var(--border); color: var(--text-main); border-radius: 8px;
}
.btn-icon:hover:not(:disabled) { border-color: var(--emerald-light); }
.btn-icon:disabled { opacity: .3; cursor: not-allowed; }

/* ---- Selos de status ---- */
.badge {
  display: inline-block; padding: .18rem .6rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--border);
}
.badge-ok { color: var(--bg-base); background: var(--emerald-light); border-color: var(--emerald-light); }
.badge-muted { color: var(--text-muted); background: transparent; border-color: var(--border); }
.badge-warn { color: var(--gold-light); background: var(--gold-soft); border-color: var(--gold); }
.badge-danger { color: var(--text-main); background: rgba(199, 82, 75, 0.14); border-color: var(--danger); }

/* ---- Paineis / caixas ---- */
.panel {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.panel-title { margin: 0; font-size: 1.15rem; }
.panel-title .count { color: var(--text-muted); font-weight: 400; font-size: .9rem; }

/* ---- Linhas de conteudo (curso/modulo/aula) ---- */
.rows { display: flex; flex-direction: column; gap: .6rem; }
.row-item {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1rem; background: var(--bg-base);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.row-order { display: flex; flex-direction: column; gap: .15rem; }
.row-order .btn-icon { padding: .1rem .4rem; font-size: .8rem; }
.row-body { flex: 1; min-width: 0; }
.row-title { font-weight: 600; color: var(--text-main); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
a.row-title-link { color: var(--text-main); }
a.row-title-link:hover { color: var(--emerald-light); }
.row-meta { color: var(--text-muted); font-size: .85rem; margin-top: .2rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.row-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

/* ---- Estado vazio ---- */
.empty {
  text-align: center; padding: 2rem 1rem; color: var(--text-muted);
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
}
.empty strong { color: var(--text-main); display: block; margin-bottom: .35rem; }

/* ---- Formulario "adicionar rapido" (inline) ---- */
.inline-add { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.inline-add .input { flex: 1; min-width: 200px; }

/* ---- Grade de metricas do dashboard ---- */
.metric-grid {
  display: grid; gap: 1rem; margin-top: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.metric {
  padding: 1.25rem; background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.metric-number { display: block; font-size: 1.9rem; font-weight: 700; color: var(--gold); line-height: 1; }
.metric-label { color: var(--text-muted); font-size: .85rem; margin-top: .4rem; display: block; }
.metric-sub { color: var(--emerald-light); font-size: .78rem; margin-top: .15rem; display: block; }
a.metric { display: block; text-decoration: none; color: inherit; }
a.metric:hover { border-color: var(--gold); }

/* ---- Detalhes / atividade ---- */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin: 0; }
.dl dt { color: var(--text-muted); font-size: .9rem; }
.dl dd { margin: 0; color: var(--text-main); }
.activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.activity li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem .25rem; border-bottom: 1px solid var(--border); font-size: .9rem; }
.activity li:last-child { border-bottom: none; }
.activity .act-when { color: var(--text-muted); white-space: nowrap; }

/* ---- Ajustes de formulario ---- */
.field-hint { color: var(--text-muted); font-size: .8rem; }
.field-check { flex-direction: row; align-items: center; gap: .55rem; }
.form-actions { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.yt-preview { margin-top: .6rem; }
.yt-frame {
  position: relative; width: 100%; max-width: 480px; aspect-ratio: 16 / 9;
  border: 1px solid var(--gold); border-radius: var(--radius-sm); overflow: hidden;
}
.yt-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Tabela de produtos ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .8rem .9rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.table th { color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--bg-base); }
.table a { color: var(--text-main); font-weight: 600; }
.table a:hover { color: var(--emerald-light); }

/* ---- Responsivo: menu vira faixa no topo ---- */
@media (max-width: 820px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap;
    align-items: center; border-right: none; border-bottom: 1px solid var(--border);
    gap: .75rem;
  }
  .sidebar-tag { display: none; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .sidebar-section { display: none; }
  .sidebar-link.is-soon { display: none; }
  .sidebar-foot { border-top: none; padding-top: 0; flex-direction: row; align-items: center; gap: .75rem; }
  .admin-main { padding: 1.5rem 1.1rem; }
}

/* ============================================================
   AREA DO CLIENTE / ALUNO (Fase 3)
   Menu lateral + video no palco + barra de progresso + efeito joia.
   So consome tokens do theme.css (cor mora la, nao aqui).
   ============================================================ */

/* Topo do aluno: mesma barra, com link de navegacao */
.topbar-client .topbar-nav { gap: 1.25rem; }
.topbar-link { color: var(--text-muted); font-size: .95rem; padding: .25rem 0; border-bottom: 2px solid transparent; }
a.topbar-link:hover { color: var(--text-main); }
.topbar-link.is-active { color: var(--text-main); border-bottom-color: var(--gold); }

.client-flash { max-width: 1040px; margin: 1rem auto 0; padding: 0 1.25rem; }

/* Pagina mais larga para os cartoes de curso */
.page-wide { max-width: 1040px; }
.footer-client { border-top: 1px solid var(--border); }

/* ---- Barra de progresso (reaproveitada) — o brilho de joia mora aqui ---- */
.progress {
  height: 9px; background: var(--bg-base);
  border: 1px solid var(--border); border-radius: 999px; overflow: hidden;
}
.progress-bar {
  height: 100%; width: 0; border-radius: 999px;
  background: var(--gold-metal);          /* ouro metalico, nao amarelo chapado */
  box-shadow: var(--gold-glow);           /* halo de joia */
  transition: width .6s ease;
  position: relative; overflow: hidden;
}
/* reflexo suave que "acende" o ouro (brilho de pedra preciosa) */
.progress-bar::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, var(--sheen) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: jewel-shine 3.2s ease-in-out infinite;
}
@keyframes jewel-shine {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(120%); }
}
@media (prefers-reduced-motion: reduce) {
  .progress-bar::after { animation: none; }
  .progress-bar { transition: none; }
}
.progress-caption { color: var(--text-muted); font-size: .82rem; }
.eyebrow { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }

/* ---- INICIO do aluno ---- */
.client-home { display: flex; flex-direction: column; gap: 1.75rem; }
.home-hello .title { margin-bottom: .25rem; }
.empty-lg { padding: 3rem 1.5rem; font-size: 1rem; }

/* Card "continuar assistindo" — o destaque nobre da tela inicial */
.resume-card {
  display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--gold);          /* aro fino dourado (joia) */
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--gold-glow);
  padding: 1.25rem; align-items: center;
}
.resume-thumb {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: var(--bg-base); border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--border);
}
.resume-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.resume-play {
  position: absolute; inset: 0; margin: auto; width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-metal); color: var(--bg-base);
  border-radius: 999px; font-size: 1.3rem; padding-left: .2rem;
  box-shadow: var(--gold-glow); transition: transform .2s ease;
}
.resume-thumb:hover .resume-play { transform: scale(1.08); }
.resume-body { display: flex; flex-direction: column; gap: .5rem; }
.resume-title { margin: 0; font-size: 1.35rem; color: var(--text-main); }
.resume-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .5rem; flex-wrap: wrap; }

/* Grade de cursos: os liberados e os que a aluna ainda nao tem (com cadeado).
   O cartao e o MESMO nos dois casos — capa, tamanho e espacamento. */
.course-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.course-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s ease, transform .2s ease;
}
.course-card:hover { border-color: var(--emerald-light); transform: translateY(-2px); }
/* capa do curso: a capa do YouTube da primeira aula, na mesma moldura 16:9 das aulas */
.course-cover {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--bg-base); border-bottom: 1px solid var(--border);
}
.course-cover .yt-thumb-empty { font-size: 1.6rem; }
.course-card-body { padding: 1.1rem 1.35rem 1.35rem; display: flex; flex-direction: column; gap: .9rem; flex: 1; }
.course-card-top { display: flex; flex-direction: column; gap: .2rem; }
.course-card-title { margin: 0; font-size: 1.1rem; color: var(--text-main); }
.course-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.progress-pct { color: var(--gold); font-weight: 700; font-size: 1rem; }
/* curso com cadeado: os espacos do progresso ficam reservados (invisiveis) para
   o cartao ter exatamente o mesmo tamanho do cartao liberado */
.course-card-ghost { visibility: hidden; }

/* Cadeado discreto no canto da capa (curso ou aula ainda nao liberados):
   mesma posicao e tamanho do selo de "concluida", mas apagado, sem brilho. */
.lock-badge {
  position: absolute; top: .6rem; right: .6rem;
  width: 30px; height: 30px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-base); border: 1px solid var(--border); color: var(--text-muted);
  box-shadow: var(--shadow);
}
.lock-badge svg { width: 14px; height: 14px; display: block; }

/* So para leitor de tela (texto que completa o que o cadeado mostra) */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- PLAYER: menu lateral + palco ---- */
.player {
  flex: 1; width: 100%;
  display: grid; grid-template-columns: 320px 1fr;
  align-items: start;
}

/* Menu lateral do aluno */
.course-nav {
  background: var(--bg-surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.course-nav-head { padding: 1.4rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .7rem; }
.course-nav-back { color: var(--text-muted); font-size: .85rem; }
a.course-nav-back:hover { color: var(--emerald-light); }
.course-nav-title { margin: 0; font-size: 1.15rem; color: var(--text-main); }
.course-nav-title a { color: inherit; }
.course-nav-title a:hover { color: var(--emerald-light); }
.course-nav-progress { display: flex; flex-direction: column; gap: .4rem; }

.module-course { margin: .5rem .5rem 0; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }

/* Lista de aulas: cards medios empilhados, agrupados por modulo; a lateral rola.
   O card reaproveita o visual .lesson-card da grade do curso; tudo que muda
   aqui fica preso em .lesson-list para a grade continuar intacta. */
.lesson-list { padding: 1.1rem 1rem 2rem; display: flex; flex-direction: column; gap: 1.4rem; }
.lesson-list-module { display: flex; flex-direction: column; gap: .6rem; }
.lesson-list-title {
  margin: 0 .25rem; display: flex; flex-direction: column; gap: .15rem;
  font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
}
.lesson-list-course { font-size: .7rem; letter-spacing: .14em; color: var(--gold); }
.lesson-list-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }

.lesson-list .lesson-card { flex-direction: row; align-items: stretch; }
.lesson-list .lesson-card:hover, .lesson-list .lesson-card:focus-visible { transform: none; }
.lesson-list .lesson-thumb {
  flex: 0 0 130px; align-self: flex-start; aspect-ratio: 16 / 9;
  margin: .5rem 0 .5rem .5rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.lesson-list .lesson-thumb .yt-thumb-empty { font-size: 1.1rem; }
.lesson-list .lesson-thumb-play { width: 32px; height: 32px; font-size: .8rem; }
.lesson-list .lesson-thumb-done { top: .3rem; right: .3rem; width: 22px; height: 22px; font-size: .72rem; }
.lesson-list .lock-badge { top: .3rem; right: .3rem; width: 22px; height: 22px; }
.lesson-list .lock-badge svg { width: 10px; height: 10px; }
/* amostra gratuita: no lugar da barra de progresso, o selo "Aula gratuita" */
.course-nav-free { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.lesson-list .lesson-card-body { padding: .55rem .7rem .6rem; gap: .2rem; min-width: 0; }
.lesson-list .lesson-card-num { font-size: .66rem; letter-spacing: .1em; }
.lesson-list .lesson-card-title {
  font-size: .88rem; line-height: 1.3; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lesson-list .lesson-card-meta { padding-top: .25rem; font-size: .74rem; gap: .35rem; }
.lesson-list .lesson-state { font-size: .68rem; padding: .08rem .45rem; }

/* aula que esta tocando: aro esmeralda + selo de play + "Assistindo agora" (forma, nao so cor) */
.lesson-list .lesson-card.is-current {
  border-color: var(--emerald-light); box-shadow: var(--emerald-ring), var(--emerald-glow);
}
.lesson-now {
  position: absolute; inset: 0; margin: auto; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; padding-left: .12rem;
  background: var(--emerald-metal); color: var(--text-main); font-size: .8rem;
  box-shadow: var(--emerald-glow);
}
.text-emerald { color: var(--emerald-light); }

/* Celular/tablet: a lista vai para baixo do video; o card nao estica demais */
@media (max-width: 900px) {
  .lesson-list { width: 100%; max-width: 560px; margin: 0 auto; }
}

/* ---- CAPA DO YOUTUBE (grade do curso + lista do player) ---- */
/* Preso na moldura 16:9 da capa: a hqdefault (plano B) e 4:3 com faixas pretas
   embutidas; o "cover" corta exatamente essas faixas. */
.yt-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-thumb[hidden] { display: none; } /* nenhuma capa existe: fica o fundo neutro */
.yt-thumb-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-size: .9rem;
}

/* ---- PAGINA DO CURSO: grade de aulas ---- */
.client-course { display: flex; flex-direction: column; gap: 1.5rem; }
.course-head { display: flex; flex-direction: column; gap: .9rem; }
.course-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.course-head-text { display: flex; flex-direction: column; gap: .3rem; }
.course-head-text .title { margin: 0; }
.course-head-progress { display: flex; flex-direction: column; gap: .4rem; max-width: 520px; }
.course-module .subtitle { margin-top: 0; }
.client-course .module-course { margin: .5rem 0 0; }

.lesson-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.lesson-card {
  display: flex; flex-direction: column;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: var(--text-main);
  transition: border-color .2s ease, transform .2s ease;
}
.lesson-card:hover, .lesson-card:focus-visible { border-color: var(--emerald-light); transform: translateY(-2px); }
.lesson-card:focus-visible { outline: 2px solid var(--emerald-light); outline-offset: 2px; }
/* a proxima aula a assistir ganha o aro dourado (mesmo destaque da aula atual no player) */
.lesson-card.is-next { border-color: var(--gold); box-shadow: var(--gold-ring); }

.lesson-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--bg-base); border-bottom: 1px solid var(--border);
}
.lesson-thumb .yt-thumb-empty { font-size: 1.6rem; }
.lesson-thumb-play {
  position: absolute; inset: 0; margin: auto; width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--emerald-metal); color: var(--text-main);
  border-radius: 999px; font-size: 1.05rem; padding-left: .15rem;
  box-shadow: var(--emerald-glow);
  opacity: 0; transform: scale(.9); transition: opacity .2s ease, transform .2s ease;
}
.lesson-card:hover .lesson-thumb-play, .lesson-card:focus-visible .lesson-thumb-play { opacity: 1; transform: scale(1); }
/* concluida: capa esmaecida + selo de "visto" (forma, nao so cor) */
.lesson-card.is-done .yt-thumb { opacity: .5; }
.lesson-thumb-done {
  position: absolute; top: .6rem; right: .6rem;
  width: 30px; height: 30px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-metal); color: var(--bg-base);
  font-weight: 700; font-size: .95rem; box-shadow: var(--gold-glow);
}

.lesson-card-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.lesson-card-num { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.lesson-card-title { margin: 0; font-size: 1rem; line-height: 1.35; color: var(--text-main); }
.lesson-card-meta {
  margin-top: auto; padding-top: .4rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap;
  color: var(--text-muted); font-size: .82rem;
}
.lesson-state {
  padding: .12rem .55rem; border-radius: 999px; border: 1px solid var(--border);
  font-size: .74rem; font-weight: 600; color: var(--text-muted);
}
.lesson-state.is-done { color: var(--gold-light); background: var(--gold-soft); border-color: var(--gold); }

/* aula trancada (curso que a aluna ainda nao tem): mesmo cartao, sem link e
   sem "convite" de clique; a capa fica levemente apagada atras do cadeado */
.lesson-card.is-locked { cursor: default; }
.lesson-card.is-locked:hover { border-color: var(--border); transform: none; }
/* escurece com filtro (nao com opacidade): a capa continua opaca e o "play" de
   reserva que fica por baixo dela nao transparece */
.lesson-card.is-locked .yt-thumb { filter: brightness(.6) saturate(.85); }
/* aula gratuita (amostra): o destaque dourado da grade + selo */
.lesson-card.is-free { border-color: var(--gold); box-shadow: var(--gold-ring); }
.lesson-state.is-free { color: var(--gold-light); background: var(--gold-soft); border-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  .lesson-card, .lesson-thumb-play { transition: none; }
  .lesson-card:hover, .lesson-card:focus-visible { transform: none; }
}

/* ---- PAGINA "CONHECER" DO CURSO (ainda nao liberado) ---- */
.course-desc { margin: .35rem 0 0; max-width: 640px; color: var(--text-muted); line-height: 1.6; }
.course-locked-note { margin: 0; font-size: .9rem; }

/* ---- COMPRAR OU GANHAR um curso ainda nao liberado ---- */
.unlock-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.unlock-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.35rem; display: flex; flex-direction: column; gap: .5rem;
}
.unlock-title { margin: 0; font-size: 1.15rem; color: var(--text-main); }
.unlock-card p { margin: 0; line-height: 1.55; }
.unlock-card .btn { align-self: flex-start; margin-top: .5rem; }
/* no fim da aula gratuita, no lugar de "anterior / proxima" */
.stage-unlock {
  display: flex; flex-direction: column; gap: 1rem;
  border-top: 1px solid var(--border); padding-top: 1.25rem;
}
@media (max-width: 640px) {
  .unlock-card .btn { align-self: stretch; text-align: center; }
}

/* Palco: video em cima, informacoes embaixo */
.stage { min-width: 0; padding: 1.75rem 2rem 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; }
.stage-video {
  width: 100%; aspect-ratio: 16 / 9; background: #000;
  border: 1px solid var(--gold); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow), var(--gold-glow);
}
.stage-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.stage-novideo {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .5rem;
  color: var(--text-muted); background: var(--bg-surface);
}
.stage-novideo span { font-size: 2rem; color: var(--gold); }

/* "Problemas com o video?": link discreto colado ao player, painel recolhido */
.video-help { margin-top: -.9rem; max-width: 900px; font-size: .85rem; color: var(--text-muted); }
.video-help summary {
  display: inline-flex; align-items: center; gap: .35rem;
  cursor: pointer; list-style: none; color: var(--text-muted);
  border-radius: 4px; padding: .15rem .1rem;
}
.video-help summary::-webkit-details-marker { display: none; }
.video-help summary::after { content: '\203A'; transition: transform .2s ease; }
.video-help[open] summary::after { transform: rotate(90deg); }
.video-help summary:hover { color: var(--emerald-light); text-decoration: underline; text-underline-offset: 3px; }
.video-help summary:focus-visible { outline: 2px solid var(--emerald-light); outline-offset: 2px; }
.video-help-panel {
  margin: .6rem 0 0; padding: .9rem 1.1rem;
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: .8rem;
}
.video-help-item dt { color: var(--text-main); font-weight: 600; margin-bottom: .2rem; }
.video-help-item dd { margin: 0; line-height: 1.55; }

.stage-body { display: flex; flex-direction: column; gap: 1.1rem; max-width: 900px; }
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.25rem; flex-wrap: wrap; }
.stage-headings { display: flex; flex-direction: column; gap: .35rem; }
.stage-title { margin: 0; font-size: 1.5rem; color: var(--text-main); }
.stage-desc { color: var(--text-muted); line-height: 1.6; margin: 0; }

/* Botao "concluida": estado premium com ouro */
.btn-done {
  border-color: var(--gold); color: var(--gold);
  background: var(--gold-soft); box-shadow: var(--gold-ring);
}
.btn-done:hover { filter: brightness(1.08); }

.stage-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 1.25rem;
}
.stage-nav-left, .stage-nav-right { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.finish-tag { color: var(--gold); font-weight: 600; }

/* ======================================================================
   DOWNLOADS E ATUALIZACOES (Fase 4) — area do cliente
   ====================================================================== */
.client-downloads, .client-updates { display: flex; flex-direction: column; gap: 1.75rem; }

.download-group, .update-group { display: flex; flex-direction: column; gap: .75rem; }
.download-list { display: flex; flex-direction: column; gap: .8rem; }

.download-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem; flex-wrap: wrap;
}
.download-info { display: flex; align-items: flex-start; gap: .9rem; min-width: 0; }
.download-ico {
  font-size: 1.4rem; color: var(--gold); line-height: 1;
  filter: drop-shadow(var(--gold-glow)); flex: none; margin-top: .1rem;
}
.download-name { margin: 0; font-size: 1.1rem; color: var(--text-main); }
.download-desc { margin: .2rem 0 0; font-size: .9rem; }
.download-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .5rem 0 0; font-size: .85rem; }

/* Linha do tempo das versoes (o que mudou) */
.update-file { margin-bottom: 1.25rem; }
.update-file-name { margin: 0 0 .6rem; font-size: 1.05rem; color: var(--text-main); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 1rem; }
.timeline-item { position: relative; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.35rem; top: .35rem;
  width: .6rem; height: .6rem; border-radius: 50%;
  background: var(--emerald-light); box-shadow: 0 0 0 3px var(--bg-base);
}
.timeline-item:first-child::before { background: var(--gold); box-shadow: var(--gold-ring), 0 0 0 3px var(--bg-base); }
.timeline-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.timeline-version { font-weight: 600; color: var(--text-main); }
.timeline-date { font-size: .82rem; }
.timeline-changelog { margin: .35rem 0 0; color: var(--text-main); line-height: 1.55; white-space: pre-line; }
.timeline-changelog.muted { color: var(--text-muted); }

/* ======================================================================
   RESPONSIVO GERAL — celular (o publico usa muito o smartphone)
   ====================================================================== */
@media (max-width: 640px) {
  /* Barra do topo: permite quebrar linha em vez de estourar a tela */
  .topbar { padding: .8rem 1rem; flex-wrap: wrap; gap: .5rem .75rem; }
  .topbar-nav { flex-wrap: wrap; gap: .5rem 1rem; }
  .topbar-client .topbar-nav { width: 100%; }

  /* Cartoes e listas respiram melhor em tela estreita */
  .card { padding: 1.5rem 1.25rem; }
  .row-item { flex-wrap: wrap; }
  .row-actions { width: 100%; justify-content: flex-end; }

  /* Pares rotulo/valor viram uma coluna (rotulo em cima, valor embaixo) */
  .dl { grid-template-columns: 1fr; gap: .15rem; }
  .dl dd { margin-bottom: .6rem; word-break: break-word; }
  .activity li { flex-wrap: wrap; }
}

/* ---- Responsivo: menu lateral vai para baixo do video ---- */
@media (max-width: 900px) {
  .player { grid-template-columns: 1fr; }
  .stage { order: 1; padding: 1.25rem 1.1rem 2rem; }
  .course-nav {
    order: 2; position: static; height: auto; border-right: none;
    border-top: 1px solid var(--border);
  }
  .resume-card { grid-template-columns: 1fr; }
  .resume-thumb { max-width: 340px; }
  .download-card { align-items: flex-start; }
  .download-card .btn { width: 100%; }
}


/* Identificação do vendedor: dados só em /termos#vendedor; nas demais páginas, link discreto no rodapé */
.seller-section { margin-top: 1.25rem; scroll-margin-top: 1.5rem; }
.seller-id { margin: .5rem 0 0; font-size: .9rem; line-height: 1.6; color: var(--text-muted); overflow-wrap: anywhere; }
.seller-id a { color: var(--text-muted); }
.seller-id a:hover { color: var(--emerald-light); }
.seller-link { display: block; margin-top: .4rem; font-size: .78rem; color: var(--text-muted); text-decoration: none; }
.seller-link:hover { color: var(--emerald-light); text-decoration: underline; }

/* Aviso "Bônus liberado" (modal da área da aluna, liberação manual) */
.bonus-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(5, 9, 7, 0.78);
}
.bonus-modal {
  position: relative; width: 100%; max-width: 440px;
  padding: 2rem 1.75rem 1.75rem; text-align: center;
  background: var(--bg-surface); border: 1px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow), var(--gold-glow);
  animation: bonus-in .35s ease-out;
}
.bonus-title { margin: .5rem 0 .75rem; font-family: Georgia, 'Times New Roman', serif; font-size: 1.45rem; line-height: 1.3; color: var(--text-main); }
.bonus-modal .muted { margin: 0 0 1.4rem; line-height: 1.6; }
.bonus-modal .btn { min-width: 12rem; }
.bonus-close-form { position: absolute; top: .5rem; right: .5rem; margin: 0; }
.bonus-close {
  width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-muted); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.bonus-close:hover, .bonus-close:focus-visible { color: var(--text-main); background: var(--gold-soft); }
@keyframes bonus-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bonus-modal { animation: none; } }
