/* =========================================================
   BIZU — Área de Membros · Design System
   Estética: blueprint noturno de canteiro premium.
   Base quase-preta com tinta navy, amarelo capacete como
   acento dominante, grid técnico e dados em monospace.
   ========================================================= */

/* Fontes self-hosted (subset latin, woff2). Archivo e Instrument Sans são
   variáveis: um arquivo cobre todos os pesos usados. */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/instrument-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
}

:root {
  --bg0: #07090d;
  --bg1: #0b0f16;
  --surface: #10151f;
  --surface-2: #151c29;
  --surface-3: #1b2434;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #f2f5f9;
  --text-dim: #b8c1d0;
  --muted: #8b95a7;
  --faint: #7f8a9e; /* 5,7:1 sobre --bg0, 4,5:1 sobre --surface-3 */

  --yellow: #ffb81c;
  --yellow-deep: #e09f00;
  --yellow-soft: rgba(255, 184, 28, 0.12);
  --green: #00b25a;
  --green-soft: rgba(0, 178, 90, 0.14);
  --orange: #ff6a13;
  --navy: #1e3a6e;
  --blue: #3b82f6;
  --danger: #ef4444;

  --font-display: "Archivo", sans-serif;
  --font-body: "Instrument Sans", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow-card: 0 2px 6px rgba(0, 0, 0, 0.35), 0 20px 50px -24px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 24px 90px -20px rgba(0, 0, 0, 0.85);
  --glow-yellow: 0 8px 40px -10px rgba(255, 184, 28, 0.45);

  --header-h: 64px;
  --ease-snap: cubic-bezier(0.2, 0.9, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* `hidden` vence qualquer display de componente (.btn, .playlist, main em grid) */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg0);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

html:not([data-role="admin"]) a[href^="admin.html"],
html:not([data-role="admin"]) a[href^="/admin.html"] { display: none !important; }

/* Grid técnico de fundo (blueprint) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    radial-gradient(1200px 600px at 80% -10%, rgba(30, 58, 110, 0.28), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255, 184, 28, 0.05), transparent 55%);
  background-size: 44px 44px, 44px 44px, auto, auto;
  mask-image: linear-gradient(#000, #000);
}

main, header, footer, .layer { position: relative; z-index: 1; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }

:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--yellow);
  color: #14100a;
  font-weight: 800;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

::selection { background: var(--yellow); color: #101010; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #232c3d; border-radius: 99px; border: 2px solid var(--bg0); }
::-webkit-scrollbar-thumb:hover { background: #32405a; }

/* ---------- Tipografia utilitária ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.tag-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yellow);
}

.tag-mono.dim { color: var(--muted); }

.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
}

/* ---------- Fita zebrada (assinatura visual) ---------- */
.hazard {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--yellow) 0 14px,
    #0c0c0c 14px 28px
  );
  border-radius: 99px;
  opacity: 0.9;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  padding: 12px 22px;
  border-radius: 10px;
  transition: transform 0.18s var(--ease-snap), box-shadow 0.18s, background 0.18s, color 0.18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn-primary {
  background: linear-gradient(180deg, #ffc63f, var(--yellow) 55%, var(--yellow-deep));
  color: #14100a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, var(--glow-yellow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 14px 50px -12px rgba(255,184,28,0.6); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.11); transform: translateY(-2px); }

.btn-danger { background: rgba(239, 68, 68, 0.14); color: #ff8f8f; border: 1px solid rgba(239, 68, 68, 0.3); }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }

/* ---------- Header do aluno ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 32px;
  z-index: 50;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.92), rgba(7, 9, 13, 0.75));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand img { height: 34px; width: auto; }
.brand-word {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 19px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.brand-word small {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 8.5px;
  letter-spacing: 0.34em;
  color: var(--yellow);
  text-transform: uppercase;
  margin-top: 3px;
}

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14.5px;
  color: var(--muted);
  transition: color 0.15s, background 0.15s;
}
.main-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.main-nav a.active { color: var(--text); background: rgba(255, 255, 255, 0.07); box-shadow: 0 -2px 0 var(--yellow) inset; }

.header-spacer { flex: 1; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 14px;
  width: 240px;
  color: var(--muted);
  font-size: 13.5px;
  transition: border-color 0.15s, background 0.15s;
}
.search-box:focus-within { border-color: var(--yellow); background: rgba(255, 255, 255, 0.08); }
.search-box input { background: none; border: none; outline: none; width: 100%; font-size: 13.5px; }
.search-box input::placeholder { color: var(--faint); }
.search-box kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--faint);
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 3px var(--bg0);
}

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  background: linear-gradient(135deg, var(--navy), #2c5aa8);
  border: 2px solid var(--line-strong);
  flex-shrink: 0;
}
.avatar:empty { visibility: hidden; }
.avatar.yellow { background: linear-gradient(135deg, var(--yellow-deep), var(--yellow)); color: #14100a; }
.avatar.green { background: linear-gradient(135deg, #00733a, var(--green)); }
.avatar.orange { background: linear-gradient(135deg, #b34400, var(--orange)); }

/* ---------- Esteiras (shelf) ---------- */
.shelf { margin-bottom: 44px; }
.shelf-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
  padding: 0 48px;
}
.shelf-head .count { font-family: var(--font-mono); font-size: 11px; color: var(--faint); letter-spacing: 0.08em; }
.shelf-head .shelf-nav { margin-left: auto; display: flex; gap: 6px; }
.shelf-nav button {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  display: grid; place-items: center;
  transition: all 0.15s;
}
.shelf-nav button:hover { border-color: var(--yellow); color: var(--yellow); }

.shelf-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 14px 48px 22px;
  scrollbar-width: none;
}
.shelf-track::-webkit-scrollbar { display: none; }

/* ---------- Capa vertical (2:3) ---------- */
.cover {
  position: relative;
  flex: 0 0 208px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.28s var(--ease-snap), box-shadow 0.28s, border-color 0.28s;
  isolation: isolate;
}
.cover:hover {
  transform: translateY(-8px) scale(1.025);
  border-color: rgba(255, 184, 28, 0.55);
  box-shadow: var(--shadow-card), var(--glow-yellow);
  z-index: 2;
}

.cover-art {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 18px;
}

.cover-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
}

.cover-logo {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 12px 4px;
}
.cover-logo img { max-height: 96px; max-width: 82%; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.5)); }

.cover-code {
  flex: 1;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 52px;
  letter-spacing: -0.04em;
  opacity: 0.94;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

.cover-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17.5px;
  line-height: 1.14;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.cover-sub { font-size: 12px; color: rgba(255, 255, 255, 0.78); margin-top: 5px; line-height: 1.35; }

/* Véu inferior pra legibilidade */
.cover-art::after {
  content: "";
  position: absolute;
  inset: 55% 0 0 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.62));
  z-index: -1;
}

/* Overlay de hover */
.cover-hover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(5, 6, 9, 0.2), rgba(5, 6, 9, 0.88) 70%);
  opacity: 0;
  transition: opacity 0.22s;
}
.cover:hover .cover-hover { opacity: 1; }
.cover-hover .meta { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; color: var(--text-dim); }
.cover-hover .btn { width: 100%; }

/* Capa importada: a arte vem pronta como imagem (pôster completo) */
.cover.has-img { background-size: cover; background-position: center top; }
.cover.has-img .cover-art { display: none; }
.cover.has-img .cover-hover .meta { font-size: 12px; letter-spacing: 0; font-family: var(--font-body); font-weight: 600; }

/* Capa bloqueada (produto fora da assinatura do aluno) */
.cover.is-locked .cover-art { filter: grayscale(0.55) brightness(0.62); }
/* Capa com imagem escurece por véu — o cadeado fica nítido por cima */
.cover.is-locked.has-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(7, 9, 13, 0.55);
  z-index: 1;
}
.cover.is-locked:hover { transform: none; }
.cover-lock {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(5, 6, 9, 0.28), rgba(5, 6, 9, 0.72));
  z-index: 2;
  text-align: center;
  padding: 16px;
}
.cover-lock .lock-ico {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(9, 12, 18, 0.85);
  border: 1px solid var(--line-strong);
  color: var(--yellow);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.cover-lock .lock-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(9, 12, 18, 0.8);
  border: 1px solid var(--line);
  padding: 5px 10px;
  border-radius: 99px;
  opacity: 0;
  transition: opacity 0.2s;
}
.cover.is-locked:hover .lock-label { opacity: 1; }
/* Touch: sem hover — o rótulo do cadeado fica sempre visível */
@media (hover: none) {
  .cover-lock .lock-label { opacity: 1; }
}

/* Esteiras longas: só renderiza o que está perto do viewport */
.shelf { content-visibility: auto; contain-intrinsic-size: auto 480px; }

/* Banner divisório da vitrine (seção estilo Curseduca) */
.v-banner {
  display: block;
  margin: 40px 0 6px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
/* Uma imagem só, escolhida pelo <picture> em (max-width: 900px) — esconder a
   segunda com display:none não impedia o download das duas. */
.v-banner picture { display: block; }
.v-banner img { width: 100%; height: auto; display: block; aspect-ratio: 1600 / 448; }
a.v-banner { transition: transform 0.25s var(--ease-snap), box-shadow 0.25s; }
a.v-banner:hover { transform: translateY(-3px); box-shadow: var(--shadow-card), var(--glow-yellow); }

/* Card largo (capa horizontal — mesma proporção da Curseduca) */
.cover.is-wide { flex: 0 0 372px; aspect-ratio: 16 / 9; }
.cover.is-wide.has-img { background-position: center; }
@media (max-width: 720px) {
  .cover.is-wide { flex-basis: 300px; }
}

/* Barra de progresso na capa */
.cover-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.14);
}
.cover-progress i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--yellow-deep), var(--yellow));
}

/* ----- Artes por produto (fundos das capas) ----- */
.cv-elite      { background: linear-gradient(165deg, #1a1c10 0%, #0d0e08 55%), radial-gradient(circle at 80% 15%, rgba(255,184,28,0.4), transparent 55%); background-blend-mode: normal; }
.cv-elite::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, transparent 0 34px, rgba(255,184,28,0.09) 34px 44px); }
.cv-mqv        { background: radial-gradient(circle at 25% 20%, #3d2f00, #171204 60%, #0b0903); }
.cv-mqv::before { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 50% 120%, transparent 0 26px, rgba(255,200,60,0.07) 26px 27px); }
.cv-petro      { background: linear-gradient(170deg, #003d20, #001c0e 70%); }
.cv-petro::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 10%, rgba(0,178,90,0.45), transparent 50%), repeating-linear-gradient(0deg, transparent 0 30px, rgba(255,255,255,0.04) 30px 31px); }
.cv-sniper     { background: radial-gradient(circle at 50% 38%, #26060a, #10050a 65%, #090407); }
.cv-sniper::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 38%, transparent 52px, rgba(239,68,68,0.16) 53px, transparent 55px, transparent 76px, rgba(239,68,68,0.1) 77px, transparent 79px); }
.cv-transpetro { background: linear-gradient(160deg, #0a1f42, #061027 60%, #04091a); }
.cv-transpetro::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 26px, rgba(96,165,250,0.09) 26px 27px), radial-gradient(circle at 20% 85%, rgba(59,130,246,0.35), transparent 55%); }
.cv-operacao   { background: linear-gradient(200deg, #2b1503, #140a02 65%); }
.cv-operacao::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 80% 80%, rgba(255,106,19,0.4), transparent 55%), repeating-linear-gradient(-45deg, transparent 0 40px, rgba(255,106,19,0.08) 40px 48px); }
.cv-qbizu      { background: linear-gradient(165deg, #10233f, #0a1526 60%, #070d18); }
.cv-qbizu::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 20%, rgba(255,106,19,0.22), transparent 50%); }
.cv-simulados  { background: linear-gradient(180deg, #101b2e, #0a0f1c); }
.cv-simulados::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 12px, rgba(255,255,255,0.05) 12px 13px), radial-gradient(circle at 50% 0%, rgba(59,130,246,0.28), transparent 60%); }
.cv-raiox      { background: linear-gradient(180deg, #071a18, #050e0d); }
.cv-raiox::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(45,212,191,0.16) 1px, transparent 1px), linear-gradient(90deg, rgba(45,212,191,0.16) 1px, transparent 1px); background-size: 26px 26px; mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); }
.cv-questoes   { background: linear-gradient(165deg, #1c1607, #0f0b04 65%); }
.cv-questoes::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 15%, rgba(255,184,28,0.3), transparent 45%); }
.cv-maratona   { background: linear-gradient(200deg, #131f16, #0a0f0b 70%); }
.cv-maratona::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 8px, rgba(0,178,90,0.12) 8px 10px); mask-image: linear-gradient(180deg, transparent 30%, #000 75%); }
.cv-apostilas  { background: linear-gradient(170deg, #1d1207, #0f0a05 70%); }
.cv-apostilas::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(255,255,255,0.06) 22px 23px); mask-image: linear-gradient(120deg, #000 40%, transparent 80%); }
.cv-mapas      { background: radial-gradient(circle at 30% 30%, #142033, #0a101d 70%); }
.cv-mapas::before { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 30% 30%, transparent 0 34px, rgba(96,165,250,0.12) 34px 35px); }
.cv-planilha   { background: linear-gradient(180deg, #0d1f16, #08120d); }
.cv-planilha::before { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(0,178,90,0.14) 1px, transparent 1px), linear-gradient(90deg, rgba(0,178,90,0.14) 1px, transparent 1px); background-size: 30px 24px; mask-image: linear-gradient(200deg, #000 30%, transparent 85%); }
.cv-workshop   { background: linear-gradient(155deg, #201303, #0f0902 60%); }
.cv-workshop::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255,184,28,0.16) 0 16px, transparent 16px 32px); mask-image: linear-gradient(0deg, #000 12%, transparent 55%); }
.cv-plantao    { background: radial-gradient(circle at 50% 20%, #250b10, #12060a 65%); }
.cv-plantao::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 22%, rgba(239,68,68,0.35), transparent 40%); }

/* Selo AO VIVO pulsante */
.live-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em;
  color: #ff8f8f;
}
.live-pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  60% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ---------- Cards genéricos ---------- */
.card {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, var(--shadow-card);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.15s;
  cursor: pointer;
}
.chip:hover { border-color: var(--yellow); color: var(--text); }
.chip.active { background: var(--yellow); border-color: var(--yellow); color: #14100a; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(480px, calc(100vw - 40px));
  background: linear-gradient(180deg, var(--surface-3), var(--surface));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 30px;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.24s var(--ease-snap);
}
.modal-backdrop.open .modal { transform: none; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted);
}
.modal-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translate(-50%, 80px);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--yellow);
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-pop);
  z-index: 120;
  transition: transform 0.3s var(--ease-snap);
  white-space: nowrap;
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Formulários ---------- */
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 15px;
  font-size: 14.5px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--yellow);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 0 0 3px rgba(255, 184, 28, 0.14);
}
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field + .field { margin-top: 16px; }

/* ---------- Bizuzinho (assistente flutuante) ---------- */
.bz-fab {
  position: fixed;
  right: 26px; bottom: 26px;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffc63f, var(--yellow) 60%, var(--yellow-deep));
  box-shadow: var(--glow-yellow), 0 8px 24px rgba(0, 0, 0, 0.5);
  display: grid; place-items: center;
  z-index: 80;
  transition: transform 0.2s var(--ease-snap);
}
.bz-fab:hover { transform: scale(1.08) rotate(-4deg); }
.bz-fab img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: top; }
.bz-fab::after {
  content: "";
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 184, 28, 0.5);
  animation: bz-ring 2.6s infinite;
}
@keyframes bz-ring {
  0% { transform: scale(1); opacity: 1; }
  70%, 100% { transform: scale(1.35); opacity: 0; }
}
.bz-fab .bz-hint {
  position: absolute;
  right: 74px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: var(--shadow-card);
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.2s;
  pointer-events: none;
}
.bz-fab:hover .bz-hint { opacity: 1; transform: none; }

.bz-panel {
  position: fixed;
  right: 26px; bottom: 102px;
  width: min(390px, calc(100vw - 40px));
  height: min(560px, calc(100vh - 140px));
  background: linear-gradient(180deg, var(--surface-3), var(--surface));
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 85;
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.24s var(--ease-snap);
}
.bz-panel.open { opacity: 1; transform: none; pointer-events: auto; }

.bz-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 184, 28, 0.06);
}
.bz-head img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--yellow); background: #fff; }
.bz-head .who strong { font-family: var(--font-display); font-size: 15.5px; display: block; }
.bz-head .who span { font-size: 12px; color: var(--green); display: inline-flex; align-items: center; gap: 6px; }
.bz-head .who span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.bz-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bz-msg {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 13.8px;
  line-height: 1.5;
  animation: bz-in 0.25s var(--ease-snap);
}
@keyframes bz-in { from { opacity: 0; transform: translateY(8px); } }
.bz-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.bz-msg.me {
  align-self: flex-end;
  background: linear-gradient(180deg, #ffc63f, var(--yellow));
  color: #14100a;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.bz-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.bz-typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: bz-b 1.1s infinite;
}
.bz-typing i:nth-child(2) { animation-delay: 0.15s; }
.bz-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bz-b { 0%, 60%, 100% { transform: none; opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

.bz-sugs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; }
.bz-sugs button {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 184, 28, 0.4);
  color: var(--yellow);
  background: rgba(255, 184, 28, 0.07);
  transition: all 0.15s;
}
.bz-sugs button:hover { background: var(--yellow); color: #14100a; }

.bz-input {
  display: flex; gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}
.bz-input input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  outline: none;
}
.bz-input input:focus { border-color: var(--yellow); }
.bz-input button {
  width: 44px; border-radius: 10px;
  background: linear-gradient(180deg, #ffc63f, var(--yellow-deep));
  color: #14100a;
  display: grid; place-items: center;
}

/* ---------- Pop-up promocional ---------- */
.promo-pop .hazard { margin: -30px -30px 22px; border-radius: 18px 18px 0 0; height: 8px; }
.promo-pop h3 { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.promo-pop p { color: var(--text-dim); font-size: 14.5px; margin-bottom: 22px; }

/* ---------- Animações de entrada ---------- */
.reveal { opacity: 0; transform: translateY(18px); animation: reveal 0.6s var(--ease-snap) forwards; }
.reveal.d1 { animation-delay: 0.08s; }
.reveal.d2 { animation-delay: 0.16s; }
.reveal.d3 { animation-delay: 0.24s; }
.reveal.d4 { animation-delay: 0.32s; }
@keyframes reveal { to { opacity: 1; transform: none; } }

/* ---------- Navegação inferior (mobile app-like) ---------- */
.mobile-nav { display: none; }

.session-logout {
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12px;
}
.session-logout:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.session-logout:disabled { opacity: 0.55; cursor: wait; }

.service-error {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 0%, rgba(30, 58, 110, 0.5), transparent 60%), var(--bg0);
}
.service-error-card {
  width: min(560px, 100%);
  padding: clamp(28px, 6vw, 52px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.service-error-card h1 { font: 800 clamp(26px, 5vw, 38px)/1.08 var(--font-display); margin: 14px 0; }
.service-error-card p { color: var(--text-dim); margin-bottom: 24px; }
.service-error-card small { display: block; margin-top: 18px; color: var(--muted); font-family: var(--font-mono); font-size: 12px; word-break: break-all; }
.service-error-card .row { display: flex; gap: 10px; flex-wrap: wrap; }

[id^="m-"] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ---------- Estados de carregamento e vazio ---------- */
.is-hidden { display: none !important; }

.page-skeleton {
  position: relative;
  z-index: 1;
  padding: calc(var(--header-h) + 34px) 48px 60px;
  max-width: 1320px;
  margin: 0 auto;
}
.page-skeleton.tight { padding-top: calc(var(--header-h) + 26px); }
.sk {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.08) 45%, rgba(255, 255, 255, 0.04) 90%);
  background-size: 220% 100%;
  animation: sk-shimmer 1.4s ease-in-out infinite;
  margin-bottom: 14px;
}
.sk.title { height: 34px; width: min(420px, 70%); }
.sk.text { height: 14px; width: min(560px, 90%); }
.sk.text.short { width: min(320px, 55%); }
.sk.block { height: clamp(200px, 32vh, 340px); width: 100%; border-radius: var(--radius-lg); margin: 24px 0 34px; }
.sk-row { display: flex; gap: 18px; overflow: hidden; }
.sk-row .sk { flex: 0 0 208px; aspect-ratio: 2 / 3; height: auto; margin: 0; }
.sk-row.wide .sk { flex-basis: 292px; aspect-ratio: 16 / 10; }
@keyframes sk-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.empty-state {
  padding: 26px 24px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.empty-state strong { display: block; color: var(--text); font-family: var(--font-display); font-size: 16px; margin-bottom: 4px; }
.empty-state .btn { margin-top: 14px; }
.empty-state.inline { padding: 18px 20px; }

.page-empty {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: calc(var(--header-h) + 40px) 24px 80px;
  text-align: center;
}
.page-empty .tag-mono { display: block; margin-bottom: 14px; }
.page-empty h1 { font: 800 clamp(26px, 4vw, 36px)/1.1 var(--font-display); letter-spacing: -0.02em; margin-bottom: 12px; }
.page-empty p { color: var(--text-dim); max-width: 46ch; margin: 0 auto 24px; }

/* ---------- Card único (capa 2:3 / larga 16:9 / aula 16:9 + corpo) ---------- */
.card-lesson {
  position: relative;
  flex: 0 0 292px;
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s var(--ease-snap), border-color 0.2s, box-shadow 0.2s;
}
.card-lesson:hover { transform: translateY(-5px); border-color: rgba(255, 184, 28, 0.5); box-shadow: var(--shadow-card), var(--glow-yellow); }
.card-lesson .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  overflow: hidden;
}
.card-lesson .thumb .frame-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 17px; line-height: 1.25; letter-spacing: -0.01em;
  text-align: center; padding: 0 18px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
}
.card-lesson .thumb .dur {
  position: absolute; right: 10px; bottom: 10px;
  font-family: var(--font-mono); font-size: 11px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 3px 8px; border-radius: 6px;
}
.card-lesson .thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(5, 6, 9, 0.3);
  opacity: 0; transition: opacity 0.2s;
}
.card-lesson:hover .thumb .play { opacity: 1; }
.card-lesson .thumb .play i {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--yellow); color: #14100a;
  display: grid; place-items: center;
  box-shadow: var(--glow-yellow);
}
.card-lesson .done-mark {
  position: absolute; left: 10px; top: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green);
  display: grid; place-items: center;
  color: #04130a;
  box-shadow: 0 4px 14px rgba(0, 178, 90, 0.5);
}
.card-lesson .body { padding: 13px 15px 15px; flex: 1; }
.card-lesson .kicker { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-lesson h4 {
  font-family: var(--font-display); font-size: 14.5px; font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(14.5px * 1.3 * 2);
}
.card-lesson .state { font-size: 12px; color: var(--muted); margin-top: 7px; }
.card-lesson .state.doing { color: var(--yellow); font-weight: 600; }

/* Capa com imagem em touch: o título vira texto sobre a imagem */
.cover-caption {
  display: none;
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 12px;
  background: linear-gradient(180deg, transparent, rgba(5, 6, 9, 0.88));
  font-family: var(--font-display); font-weight: 700; font-size: 13px; line-height: 1.25;
  z-index: 1;
}
.cover-caption span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: none) {
  .cover.has-img .cover-caption { display: block; }
}

/* ---------- Prompt "Próxima aula" ---------- */
.next-prompt {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: min(320px, calc(100vw - 20px));
  background: var(--surface-3);
  border: 1px solid rgba(255, 184, 28, 0.55);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--shadow-pop);
}
.next-prompt .np-count { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.next-prompt .np-count b { color: var(--yellow); font-variant-numeric: tabular-nums; }
.next-prompt .np-title { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.next-prompt .np-row { display: flex; gap: 8px; }
body.has-next-prompt .bz-fab { display: none; }

/* ---------- Busca mobile (bloco abaixo do header) ---------- */
.m-search { display: none; }

/* ---------- Responsivo global ---------- */
@media (max-width: 900px) {
  .search-box { display: none; }
  .main-nav { display: none; }
  .shelf-head, .shelf-track { padding-left: 16px; padding-right: 16px; }
  .cover { flex-basis: 164px; }

  .site-header { padding: 0 14px; gap: 10px; height: 58px; }
  :root { --header-h: 58px; }
  .brand img { height: 28px; }
  .brand-word { font-size: 16px; }
  .session-logout { padding: 6px 8px; font-size: 11px; min-height: 40px; }

  /* iOS não dá zoom em campo com fonte >= 16px */
  input, textarea, select { font-size: 16px; }
  .search-box input { font-size: 16px; }

  .m-search { display: block; padding: 14px 16px 2px; }
  .m-search .search-box { display: flex; width: 100%; min-height: 44px; }
  .m-search kbd { display: none; }

  .page-skeleton { padding-left: 16px; padding-right: 16px; }
  .sk-row .sk { flex-basis: 164px; }
  .card-lesson { flex-basis: 252px; }

  .next-prompt {
    right: 10px; left: 10px; width: auto;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  body.has-next-prompt .toast { bottom: calc(200px + env(safe-area-inset-bottom)); }

  body.with-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 70;
    background: rgba(9, 12, 18, 0.96);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line-strong);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .mobile-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 48px;
    padding: 6px 0 4px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--muted);
  }
  .mobile-nav a.active { color: var(--yellow); }
  .mobile-nav a:active { background: rgba(255, 255, 255, 0.06); }
  .mobile-nav a:focus-visible { outline-offset: -3px; }

  /* Bizuzinho acima da tab bar */
  .bz-fab {
    width: 54px; height: 54px;
    right: 14px;
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
  .bz-fab img { width: 40px; height: 40px; }
  .bz-fab .bz-hint { display: none; }
  .bz-panel {
    right: 10px; left: 10px;
    width: auto;
    bottom: calc(144px + env(safe-area-inset-bottom));
    height: min(480px, calc(100vh - 220px));
  }

  .toast {
    white-space: normal;
    max-width: calc(100vw - 28px);
    width: max-content;
    text-align: center;
    bottom: calc(84px + env(safe-area-inset-bottom));
    font-size: 13px;
  }

  .modal { padding: 22px; }
  .shelf-head .shelf-nav { display: none; } /* touch: arrasta a esteira */
  .section-title { font-size: 18px; }
}

@media (max-width: 480px) {
  .cover { flex-basis: 148px; }
  .cover-title { font-size: 15.5px; }
  .cover-code { font-size: 42px; }
  .btn { padding: 11px 18px; font-size: 14px; }
}

/* Touch: sem hover — overlay das capas vira informação permanente ao tocar */
@media (hover: none) {
  .cover-hover { display: none; }
  .card-lesson .thumb .play { opacity: 1; background: none; }
  .card-lesson .thumb .play i { width: 44px; height: 44px; opacity: 0.92; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
