/* =========================================================
   Área de Membros — Design system (verde & branco)
   Para trocar a identidade visual, ajuste as variáveis abaixo
   (a cor principal também pode ser trocada em Admin > Configurações)
   ========================================================= */
:root {
  --brand: #16a34a;
  --brand-600: color-mix(in srgb, var(--brand) 88%, #000);
  --brand-700: color-mix(in srgb, var(--brand) 72%, #000);
  --brand-800: color-mix(in srgb, var(--brand) 55%, #000);
  --brand-300: color-mix(in srgb, var(--brand) 55%, #fff);
  --brand-100: color-mix(in srgb, var(--brand) 14%, #fff);
  --brand-50: color-mix(in srgb, var(--brand) 6%, #fff);

  --bg: #f5f9f6;
  --surface: #ffffff;
  --surface-2: #f8fbf9;
  --border: #e3ece6;
  --border-strong: #cfdcd3;
  --text: #0f1f17;
  --text-2: #4b5d53;
  --muted: #8a9a91;

  --gold: #f59e0b;
  --gold-100: #fef3c7;
  --orange: #f97316;
  --danger: #dc2626;
  --danger-100: #fee2e2;
  --info: #0284c7;
  --info-100: #e0f2fe;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 40, 24, .06);
  --shadow: 0 6px 24px -8px rgba(16, 40, 24, .14), 0 2px 6px -2px rgba(16, 40, 24, .06);
  --shadow-lg: 0 22px 48px -16px rgba(16, 40, 24, .28);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); background: var(--bg);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--brand-800); }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86em; }
pre { background: #0f1f17; color: #d1fae5; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.2em; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== Botões ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; font-size: .92rem; line-height: 1;
  padding: 12px 18px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, background .15s, box-shadow .15s, border-color .15s;
  text-decoration: none; white-space: nowrap; background: var(--surface); color: var(--text);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { background: var(--brand-600); color: #fff; }
.btn-outline { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand-700); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--brand-50); color: var(--brand-700); }
.btn-soft { background: var(--brand-100); color: var(--brand-800); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 22%, #fff); color: var(--brand-800); }
.btn-danger { background: var(--danger-100); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-white { background: #fff; color: var(--brand-800); }
.btn-white:hover { background: var(--brand-50); color: var(--brand-800); }
.btn-lg { padding: 15px 24px; font-size: 1rem; border-radius: 14px; }
.btn-sm { padding: 8px 12px; font-size: .82rem; border-radius: 10px; }
.btn-icon { padding: 9px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ===== Formulários ===== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-weight: 700; font-size: .86rem; color: var(--text); }
.hint { font-size: .8rem; color: var(--muted); }
.input, .select, .textarea {
  font: inherit; width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 110px; resize: vertical; }
.textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: .82rem; min-height: 120px; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon .input { padding-left: 42px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex-shrink: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(18px); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }

/* ===== Alertas / flash ===== */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; font-weight: 600; font-size: .9rem; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: var(--brand-100); color: var(--brand-800); border-color: color-mix(in srgb, var(--brand) 25%, #fff); }
.alert-error { background: var(--danger-100); color: #991b1b; border-color: #fecaca; }
.alert-info { background: var(--info-100); color: #075985; border-color: #bae6fd; }
.alert-warn { background: var(--gold-100); color: #92400e; border-color: #fde68a; }

/* ===== Cartões / superfícies ===== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2, .card-head h3 { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 800; padding: 4px 9px; border-radius: 99px; background: var(--brand-100); color: var(--brand-800); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
.badge-gray { background: #eef2ef; color: var(--text-2); }
.badge-gold { background: var(--gold-100); color: #92400e; }
.badge-red { background: var(--danger-100); color: #991b1b; }
.badge-blue { background: var(--info-100); color: #075985; }

/* ===== Barra de progresso ===== */
.progress { height: 8px; background: color-mix(in srgb, var(--brand) 12%, #e8efea); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 60%, #a3e635)); border-radius: 99px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.progress.lg { height: 12px; }
.progress.on-dark { background: rgba(255, 255, 255, .22); }
.progress.on-dark > span { background: #fff; }

/* ===== Avatar ===== */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 92px; height: 92px; font-size: 1.8rem; }
.avatar.sm { width: 30px; height: 30px; font-size: .72rem; }

/* =========================================================
   ÁREA DO ALUNO
   ========================================================= */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .88); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand img { height: 36px; width: auto; max-width: 160px; object-fit: contain; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--brand-700)); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px -6px var(--brand); }
.nav { display: flex; gap: 4px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; font-weight: 700; font-size: .9rem; color: var(--text-2); }
.nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.nav a.active { background: var(--brand-100); color: var(--brand-800); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.xp-pill { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: .82rem; box-shadow: var(--shadow-sm); }
.xp-pill:hover { color: var(--text); border-color: var(--brand-300); }
.lvl-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 99px; background: linear-gradient(135deg, var(--brand), var(--brand-700)); color: #fff; font-weight: 800; font-size: .78rem; }
.xp-pill .progress { width: 74px; height: 6px; }
.streak-pill { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px; border-radius: 99px; background: #f1f5f2; color: var(--muted); font-weight: 800; font-size: .85rem; }
.streak-pill.on { background: #fff1e6; color: var(--orange); }
.streak-pill .icon { width: 1em; height: 1em; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu .menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; z-index: 60; }
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: .92rem; }
.menu-head span { font-size: .78rem; color: var(--muted); word-break: break-all; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; background: none; border: 0; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--brand-50); color: var(--brand-700); }

.main { padding-top: 28px; padding-bottom: 80px; min-height: calc(100vh - 68px); }

/* Mobile bottom nav */
.bottom-nav { display: none; }

/* ----- Hero / boas-vindas ----- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 60%, #a3e635) 0%, var(--brand) 38%, var(--brand-800) 100%);
  padding: 34px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; box-shadow: var(--shadow-lg);
}
.hero.has-banner { background-size: cover; background-position: center; }
.hero.has-banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 30, 15, .88) 0%, rgba(5, 30, 15, .55) 55%, rgba(5, 30, 15, .2) 100%); }
.hero > * { position: relative; }
.hero::after { content: ''; position: absolute; width: 380px; height: 380px; border-radius: 50%; right: -120px; bottom: -200px; background: rgba(255, 255, 255, .08); pointer-events: none; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; background: rgba(255, 255, 255, .16); padding: 6px 12px; border-radius: 99px; margin-bottom: 14px; }
.hero h1 { color: #fff; margin-bottom: 8px; }
.hero p { color: rgba(255, 255, 255, .86); max-width: 520px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hero-stat { background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .18); border-radius: 16px; padding: 14px 16px; backdrop-filter: blur(6px); }
.hero-stat .num { font-size: 1.55rem; font-weight: 800; line-height: 1.1; display: flex; align-items: center; gap: 6px; }
.hero-stat .lbl { font-size: .78rem; color: rgba(255, 255, 255, .78); font-weight: 600; }
.hero-level { grid-column: span 2; }
.hero-level .row { justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-size: .85rem; }

/* ----- Continuar assistindo ----- */
.continue { display: grid; grid-template-columns: 300px 1fr auto; gap: 20px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; margin-top: 22px; box-shadow: var(--shadow-sm); }
.continue .thumb-16x9 { border-radius: 12px; }
.continue h3 { margin: 4px 0 4px; font-size: 1.15rem; }

/* ----- Seções / carrosséis ----- */
.section { margin-top: 38px; }
.section-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head .count { font-size: .8rem; font-weight: 800; color: var(--brand-700); background: var(--brand-100); padding: 3px 9px; border-radius: 99px; }
.carousel-nav { margin-left: auto; display: flex; gap: 6px; }
.carousel { display: grid; grid-auto-flow: column; grid-auto-columns: 200px; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 18px; margin: 0 -4px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.carousel > * { scroll-snap-align: start; }
.grid-stories { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.grid-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }

/* ----- Capas ----- */
.thumb-9x16, .thumb-16x9 { position: relative; overflow: hidden; background: linear-gradient(150deg, var(--brand-300), var(--brand-700)); }
.thumb-9x16 { aspect-ratio: 9 / 16; }
.thumb-16x9 { aspect-ratio: 16 / 9; }
.thumb-9x16 img, .thumb-16x9 img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.thumb-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: rgba(255, 255, 255, .95); padding: 16px; text-align: center; font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.thumb-placeholder .icon { width: 34px; height: 34px; opacity: .85; }
.thumb-placeholder::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .25), transparent 55%); }

/* Card vertical (curso / módulo — formato stories) */
.story { position: relative; display: block; border-radius: 18px; overflow: hidden; color: #fff; box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s; isolation: isolate; }
.story:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); color: #fff; }
.story:hover img { transform: scale(1.05); }
.story-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 16px; background: linear-gradient(180deg, transparent 40%, rgba(3, 20, 10, .88) 100%); z-index: 2; }
.story-title { font-weight: 800; font-size: 1rem; line-height: 1.25; margin-bottom: 4px; text-shadow: 0 1px 8px rgba(0, 0, 0, .3); }
.story-meta { font-size: .76rem; font-weight: 600; color: rgba(255, 255, 255, .78); margin-bottom: 10px; }
.story .progress { height: 6px; background: rgba(255, 255, 255, .25); }
.story .progress > span { background: linear-gradient(90deg, #86efac, #fff); }
.story-tag { position: absolute; top: 12px; left: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; font-size: .7rem; font-weight: 800; background: rgba(255, 255, 255, .92); color: var(--brand-800); text-transform: uppercase; letter-spacing: .04em; }
.story-tag.done { background: var(--brand); color: #fff; }
.story-tag.soon { background: var(--gold-100); color: #92400e; }
.story.locked img { filter: grayscale(.85) brightness(.55); }
.story.locked .thumb-placeholder { filter: grayscale(.8) brightness(.7); }
.story-lock { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; }
.story-lock span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .35); }
.story-lock .icon { width: 24px; height: 24px; }
.story-cta { margin-top: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: #fff; color: var(--brand-800); font-weight: 800; font-size: .78rem; padding: 9px 12px; border-radius: 10px; }

/* Card horizontal de aula (formato YouTube) */
.video-card { display: block; color: var(--text); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s, border-color .2s; }
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--text); border-color: var(--brand-300); }
.video-card:hover img { transform: scale(1.04); }
.video-card .thumb-16x9::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, .45)); }
.play-btn { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); width: 54px; height: 54px; border-radius: 50%; background: rgba(255, 255, 255, .95); color: var(--brand-700); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); opacity: 0; transition: opacity .2s, transform .2s; }
.play-btn .icon { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.video-card:hover .play-btn { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.video-chip { position: absolute; z-index: 2; bottom: 10px; right: 10px; background: rgba(0, 0, 0, .72); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; display: inline-flex; gap: 4px; align-items: center; }
.video-done { position: absolute; z-index: 2; top: 10px; left: 10px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; padding: 5px 10px; border-radius: 99px; display: inline-flex; gap: 5px; align-items: center; box-shadow: 0 4px 10px rgba(0, 0, 0, .2); }
.video-num { position: absolute; z-index: 2; top: 10px; left: 10px; background: rgba(255, 255, 255, .92); color: var(--text); font-size: .72rem; font-weight: 800; padding: 5px 10px; border-radius: 99px; }
.video-body { padding: 14px 16px 16px; }
.video-body h3 { font-size: .98rem; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-body .meta { display: flex; gap: 12px; font-size: .78rem; color: var(--muted); font-weight: 600; }
.xp-tag { color: var(--gold); font-weight: 800; display: inline-flex; align-items: center; gap: 3px; }

/* ----- Cabeçalho de curso / módulo ----- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--brand-700); }
.breadcrumb .icon { width: 14px; height: 14px; }

.course-head { display: grid; grid-template-columns: 210px 1fr; gap: 30px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.course-head::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #a3e635)); }
.course-head .story { box-shadow: var(--shadow); pointer-events: none; }
.course-head h1 { margin-bottom: 10px; }
.course-desc { color: var(--text-2); max-width: 680px; }
.progress-box { display: flex; align-items: center; gap: 16px; margin-top: 18px; max-width: 560px; }
.progress-box .progress { flex: 1; }
.progress-box strong { font-size: 1.4rem; color: var(--brand-700); min-width: 60px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: .85rem; font-weight: 600; color: var(--text-2); }
.meta-row span { display: inline-flex; align-items: center; gap: 6px; }
.meta-row .icon { color: var(--brand); }

/* ----- Página da aula ----- */
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.player { position: relative; border-radius: var(--radius); overflow: hidden; background: #0b1510; box-shadow: var(--shadow-lg); }
.player .embed { position: relative; width: 100%; }
.player .embed iframe { display: block; width: 100%; border: 0; }
.player .embed.ratio { aspect-ratio: 16 / 9; }
.player .embed.ratio iframe { position: absolute; inset: 0; height: 100%; }
.player-empty { aspect-ratio: 16 / 9; display: grid; place-items: center; color: rgba(255, 255, 255, .7); text-align: center; padding: 20px; }
.player-empty img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.player-empty div { position: relative; }
.player-empty .icon { width: 42px; height: 42px; }
.lesson-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 20px 0 6px; }
.lesson-bar h1 { font-size: 1.5rem; margin: 0; flex: 1 1 320px; }
.complete-btn.is-done { background: var(--brand-100); color: var(--brand-800); box-shadow: none; }
.complete-btn .xp-plus { background: rgba(255, 255, 255, .22); padding: 3px 8px; border-radius: 99px; font-size: .78rem; }
.complete-btn.is-done .xp-plus { display: none; }
.lesson-nav { display: flex; gap: 10px; margin: 18px 0 8px; }
.lesson-nav .btn { flex: 1; justify-content: space-between; padding: 14px 16px; }
.lesson-nav .btn small { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.lesson-nav .btn span.t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.lesson-nav .btn > div { min-width: 0; text-align: left; }
.lesson-nav .btn.next > div { text-align: right; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 18px 0; }
.tabs button { font: inherit; font-weight: 700; font-size: .9rem; color: var(--muted); padding: 12px 14px; border: 0; background: none; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 8px; align-items: center; }
.tabs button.active { color: var(--brand-700); border-bottom-color: var(--brand); }
.tabs .count { font-size: .72rem; background: var(--brand-100); color: var(--brand-800); padding: 2px 7px; border-radius: 99px; }
.lesson-desc { color: var(--text-2); line-height: 1.7; }
.files { display: grid; gap: 10px; }
.file-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); transition: border-color .15s, background .15s; }
.file-item:hover { border-color: var(--brand-300); background: var(--brand-50); color: var(--text); }
.file-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; font-size: .66rem; font-weight: 800; text-transform: uppercase; flex-shrink: 0; }
.file-item .info { flex: 1; min-width: 0; }
.file-item .info strong { display: block; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .info span { font-size: .78rem; color: var(--muted); }

.side { position: sticky; top: 88px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.side-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.side-head small { color: var(--muted); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; }
.side-head h3 { margin: 4px 0 10px; }
.side-head .row { font-size: .8rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; justify-content: space-between; }
.side-list { max-height: calc(100vh - 260px); overflow-y: auto; padding: 8px; }
.side-item { display: flex; align-items: center; gap: 12px; padding: 9px; border-radius: 12px; color: var(--text); }
.side-item:hover { background: var(--brand-50); color: var(--text); }
.side-item.current { background: var(--brand-100); }
.side-thumb { width: 92px; flex-shrink: 0; border-radius: 8px; overflow: hidden; }
.side-item .t { font-size: .85rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.side-item .m { font-size: .74rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.side-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; margin-left: auto; flex-shrink: 0; color: #fff; }
.side-check .icon { width: 13px; height: 13px; stroke-width: 3.5; }
.side-item.done .side-check { background: var(--brand); border-color: var(--brand); }

/* ----- Bloqueado ----- */
.locked-page { max-width: 760px; margin: 30px auto; display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); }
.lock-icon { width: 58px; height: 58px; border-radius: 18px; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; margin-bottom: 14px; }
.lock-icon .icon { width: 28px; height: 28px; }

/* ----- Conquistas ----- */
.level-card { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; color: #fff; padding: 28px; border-radius: var(--radius-lg); background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 60%, #a3e635) 0%, var(--brand) 40%, var(--brand-800) 100%); box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.level-ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .2) 0); position: relative; }
.level-ring::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--brand-700); }
.level-ring div { position: relative; text-align: center; line-height: 1; }
.level-ring b { font-size: 2.4rem; font-weight: 800; display: block; }
.level-ring small { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.level-card h1 { color: #fff; margin-bottom: 4px; }
.level-card p { color: rgba(255, 255, 255, .85); margin-bottom: 14px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat .num { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.stat .lbl { font-size: .78rem; font-weight: 700; color: var(--muted); }
.stat .ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; background: var(--brand-100); color: var(--brand-700); }
.stat .ico.orange { background: #fff1e6; color: var(--orange); }
.stat .ico.gold { background: var(--gold-100); color: #b45309; }
.stat .ico.blue { background: var(--info-100); color: var(--info); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.badge-item { text-align: center; padding: 20px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: transform .2s; }
.badge-item:hover { transform: translateY(-3px); }
.badge-emoji { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; font-size: 1.9rem; background: radial-gradient(circle at 30% 25%, #fff, var(--brand-100)); border: 3px solid var(--brand-300); box-shadow: 0 6px 16px -6px var(--brand); }
.badge-item strong { display: block; font-size: .9rem; }
.badge-item span { font-size: .76rem; color: var(--muted); }
.badge-item.off { background: var(--surface-2); }
.badge-item.off .badge-emoji { filter: grayscale(1); opacity: .45; border-color: var(--border-strong); box-shadow: none; }
.badge-item.off strong { color: var(--muted); }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.rank li:last-child { border-bottom: 0; }
.rank li.me { background: var(--brand-50); border-radius: 12px; }
.rank .pos { width: 30px; text-align: center; font-weight: 800; color: var(--muted); }
.rank li:nth-child(1) .pos { color: #d97706; font-size: 1.15rem; }
.rank li:nth-child(2) .pos { color: #64748b; font-size: 1.1rem; }
.rank li:nth-child(3) .pos { color: #b45309; font-size: 1.05rem; }
.rank .name { flex: 1; font-weight: 700; font-size: .9rem; }
.rank .xp { font-weight: 800; color: var(--brand-700); font-size: .88rem; }
.levels-list { display: grid; gap: 6px; }
.levels-list div { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 10px; font-size: .86rem; font-weight: 600; color: var(--text-2); }
.levels-list div.cur { background: var(--brand-100); color: var(--brand-800); font-weight: 800; }
.levels-list div.past { color: var(--brand-700); }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; margin-top: 22px; }

/* ----- Empty state ----- */
.empty { text-align: center; padding: 50px 20px; background: var(--surface); border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-2); }
.empty .icon { width: 42px; height: 42px; color: var(--brand); margin-bottom: 10px; }

/* ===== Toasts e modal de recompensa ===== */
#toast-root { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #0f1f17; color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 700; font-size: .9rem; animation: toast-in .45s cubic-bezier(.2, 1.3, .4, 1) both; max-width: 360px; }
.toast.out { animation: toast-out .3s ease forwards; }
.toast .t-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.toast .t-ico.gold { background: var(--gold); }
.toast small { display: block; font-weight: 600; color: rgba(255, 255, 255, .7); font-size: .78rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }

.reward-modal { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; background: rgba(5, 25, 14, .55); backdrop-filter: blur(4px); padding: 20px; animation: fade-in .25s ease; }
.reward-box { width: 100%; max-width: 400px; background: var(--surface); border-radius: 26px; padding: 34px 28px 26px; text-align: center; box-shadow: var(--shadow-lg); animation: pop-in .5s cubic-bezier(.2, 1.4, .4, 1); }
.reward-emoji { font-size: 3.6rem; line-height: 1; margin-bottom: 8px; display: inline-block; animation: bounce 1.2s ease infinite; }
.reward-box h2 { font-size: 1.5rem; margin-bottom: 6px; }
.reward-box p { color: var(--text-2); }
.reward-xp { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1.1rem; color: #b45309; background: var(--gold-100); padding: 8px 16px; border-radius: 99px; margin: 4px 0 18px; }
.reward-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 18px; }
.reward-badges div { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 14px; padding: 10px 14px; font-size: .82rem; font-weight: 700; }
.reward-badges div b { display: block; font-size: 1.6rem; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.7) translateY(30px); } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 190; }
.xp-bump { animation: xp-bump .7s ease; }
@keyframes xp-bump { 30% { transform: scale(1.15); box-shadow: 0 0 0 6px var(--brand-100); } }

/* =========================================================
   LOGIN / AUTENTICAÇÃO
   ========================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.auth-side { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--brand) 55%, #a3e635) 0%, var(--brand) 40%, var(--brand-800) 100%); background-size: cover; background-position: center; }
.auth-side.has-bg::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 30, 15, .35), rgba(5, 30, 15, .85)); }
.auth-side > * { position: relative; }
.auth-side .brand { color: #fff; }
.auth-side .brand-mark { background: rgba(255, 255, 255, .18); box-shadow: none; }
.auth-side h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); font-weight: 800; color: #fff; max-width: 480px; }
.auth-side p { color: rgba(255, 255, 255, .85); max-width: 420px; font-size: 1.02rem; }
.auth-perks { display: grid; gap: 12px; margin-top: 26px; }
.auth-perks div { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.auth-perks span { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); }
.auth-deco { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 1.8rem; }
.auth-box .sub { color: var(--text-2); margin-bottom: 26px; }
.captcha-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; }
.captcha-img { position: relative; height: 50px; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--border-strong); background: var(--brand-50); }
.captcha-img img { width: 100%; height: 100%; }
.captcha-refresh { position: absolute; right: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 6px; border: 0; background: rgba(255, 255, 255, .9); display: grid; place-items: center; cursor: pointer; color: var(--brand-700); padding: 0; }
.captcha-refresh .icon { width: 13px; height: 13px; }
.auth-links { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 20px; font-size: .86rem; font-weight: 600; }
.pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px; }
.auth-foot { text-align: center; color: var(--muted); font-size: .82rem; margin-top: 28px; }

/* Logins de teste (DEMO_LOGIN=true) */
.demo-logins { border: 1.5px dashed var(--brand-300); background: var(--brand-50); border-radius: 14px; padding: 12px; margin-bottom: 22px; }
.demo-logins-head { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; color: var(--brand-800); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.demo-logins-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.demo-login { display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; padding: 10px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .12s; min-width: 0; }
.demo-login:hover { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.demo-login:active { transform: scale(.98); }
.demo-login.picked { border-color: var(--brand); background: var(--brand-100); }
.demo-login > span:last-child { min-width: 0; }
.demo-login b { display: block; font-size: .9rem; }
.demo-login small { display: block; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-100); color: var(--brand-700); display: grid; place-items: center; flex-shrink: 0; }

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 1080px) {
  .lesson-layout, .two-col { grid-template-columns: 1fr; }
  .side { position: static; }
  .side-list { max-height: 420px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 26px; }
  .continue { grid-template-columns: 1fr; }
  .continue .btn { width: 100%; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .nav { display: none; }
  .xp-pill .progress { display: none; }
  .bottom-nav { display: flex; position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .95); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; font-weight: 700; color: var(--muted); padding: 6px 14px; border-radius: 12px; }
  .bottom-nav a .icon { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--brand-700); }
  .main { padding-bottom: 110px; }
  #toast-root { bottom: 86px; right: 12px; left: 12px; align-items: stretch; }
  .course-head { grid-template-columns: 1fr; }
  .course-head > .story { width: 150px; }
  .locked-page { grid-template-columns: 1fr; }
  .locked-page > .story { width: 160px; }
  .level-card { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .demo-logins-list { grid-template-columns: 1fr; }
  .topbar-inner { gap: 12px; }
  .brand span.name { display: none; }
  .carousel { grid-auto-columns: 150px; gap: 12px; }
  .grid-stories { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .story-overlay { padding: 12px; }
  .story-title { font-size: .9rem; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav .btn span.t { max-width: 220px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
