:root {
  --primary: #F68522;
  --primary-ink: #fff;
  --bg: #110A1A;
  --bg-2: #170E23;
  --card: #1D1330;
  --card-2: #261A3B;
  --line: #34254A;
  --text: #F4F4F6;
  --muted: #A99CBB;
  --ok: #22C55E;
  --danger: #EF4444;
  --radius: 14px;
  --sidebar: 260px;
  --top: 64px;
  --sat: env(safe-area-inset-top, 0px);
  --topf: calc(var(--top) + var(--sat));
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.accent { color: var(--primary); }

/* ---------- botões e campos ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card-2); border-radius: 10px;
  padding: 10px 16px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn:hover { border-color: #4A3866; background: #2E2045; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 10px; cursor: pointer; display: inline-flex; color: var(--text); }
.icon-btn:hover { background: var(--card-2); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, textarea.input, select.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; outline: none; transition: .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
textarea.input { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- login ---------- */
.auth {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%), var(--bg);
}
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 32px 28px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.auth-logo img { max-height: 64px; width: auto; }
.auth h2 { text-align: center; text-transform: uppercase; letter-spacing: .06em; font-size: 15px; }
.auth .link { color: var(--primary); cursor: pointer; font-size: 14px; background: none; border: 0; padding: 0; }
.auth .foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.notice { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.notice.err { border-color: color-mix(in srgb, var(--danger) 60%, transparent); }

/* ---------- layout ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topf); z-index: 30;
  display: flex; align-items: center; gap: 8px; padding: var(--sat) calc(14px + env(safe-area-inset-right, 0px)) 0 calc(14px + env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.topbar .brand img { height: 28px; width: auto; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--card-2); border: 1px solid var(--line);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; overflow: hidden;
}
.sidebar {
  position: fixed; top: var(--topf); bottom: 0; left: 0; width: var(--sidebar); z-index: 25;
  background: var(--bg-2); border-right: 1px solid var(--line); padding: 16px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 4px; overflow-y: auto; transition: transform .2s;
}
.sidebar .me { padding: 8px 10px 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.sidebar .nav a, .sidebar .nav button {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-weight: 500; width: 100%; background: none; border: 0; cursor: pointer; text-align: left;
}
.sidebar .nav a:hover, .sidebar .nav button:hover { background: var(--card); color: var(--text); }
.sidebar .nav a.active { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--text); }
.sidebar .nav a.active svg { color: var(--primary); }
.sidebar .sep { height: 1px; background: var(--line); margin: 8px 0; }
.main { padding: calc(var(--topf) + 20px) 24px 60px calc(var(--sidebar) + 24px); max-width: 1400px; }
.scrim { display: none; }
.only-mobile { display: none; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open .scrim { display: block; position: fixed; inset: 0; background: #0008; z-index: 20; }
  .main { padding: calc(var(--topf) + 16px) 16px calc(60px + env(safe-area-inset-bottom, 0px)); }
  .only-mobile { display: inline-flex; }
}

.progress { height: 6px; background: var(--card-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .3s; }

/* ---------- início ---------- */
.hero {
  position: relative; border-radius: 20px; overflow: hidden; min-height: 240px; margin-bottom: 26px;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 28px;
  background: radial-gradient(800px 300px at 20% 0%, color-mix(in srgb, var(--primary) 35%, transparent), transparent 70%), var(--card);
  border: 1px solid var(--line);
}
.hero.has-img { background-size: cover; background-position: center; }
.hero.has-img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, #000c); }
.hero > * { position: relative; }
.hero img.logo { max-height: 56px; max-width: min(260px, 70%); width: auto; margin-bottom: 18px; }
.section { margin: 30px 0 14px; display: flex; align-items: center; gap: 12px; }
.section h2 { margin: 0; }
.section .kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; color: var(--primary); text-transform: uppercase; }
.live-card {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 18%, var(--card)), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--line)); border-radius: var(--radius); padding: 16px 18px;
}
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); }
.pill.live { background: var(--danger); border-color: var(--danger); color: #fff; }
.pill.live::before { content: ""; width: 7px; height: 7px; background: #fff; border-radius: 50%; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.rail > * { scroll-snap-align: start; }
.cont-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: .15s; }
.cont-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.cont-card .thumb { aspect-ratio: 16/9; background: var(--card-2); display: grid; place-items: center; position: relative; }
.cont-card .thumb svg { width: 40px; height: 40px; color: var(--primary); }
.cont-card .body { padding: 12px 14px; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
@media (max-width: 640px) { .modules { grid-template-columns: 1fr 1fr; gap: 12px; } .module-card .cover .kick { position: absolute; top: 14px; left: 14px; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--primary); text-transform: uppercase; }
.module-card .cover .ttl { font-size: 15px; } }
.module-card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: .18s; display: flex; flex-direction: column; }
.module-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.module-card .cover { aspect-ratio: 3/4; background: var(--card-2) center/cover; position: relative; display: flex; align-items: flex-end; padding: 14px; }
.module-card .cover.placeholder { background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 40%, #261637) 0%, #261637 55%, #120A1C 100%); }
.module-card .cover .kick { position: absolute; top: 14px; left: 14px; font-size: 10px; font-weight: 800; letter-spacing: .14em; color: var(--primary); text-transform: uppercase; }
.module-card .cover .ttl { font-weight: 800; font-size: 18px; text-transform: uppercase; line-height: 1.15; text-shadow: 0 2px 12px #000a; }
.module-card .meta { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.module-card.locked .cover::after { content: ""; position: absolute; inset: 0; background: #000a; }
.lock-badge { position: absolute; top: 10px; right: 10px; z-index: 2; background: #000c; border-radius: 99px; padding: 6px 10px; font-size: 12px; font-weight: 700; display: flex; gap: 6px; align-items: center; }

/* ---------- módulo / aula ---------- */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
@media (max-width: 1100px) { .lesson-layout { grid-template-columns: 1fr; } }
.player { aspect-ratio: 16/9; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.player iframe { width: 100%; height: 100%; border: 0; }
.player .empty { height: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 20px; }
.lesson-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 16px 0; }
.stars { display: inline-flex; gap: 2px; }
.stars button { background: none; border: 0; cursor: pointer; padding: 2px; color: #4A3866; }
.stars button.on { color: #FACC15; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 10px 0 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--primary); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.lesson-list { display: flex; flex-direction: column; }
.lesson-item { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 10px; color: var(--muted); }
.lesson-item:hover { background: var(--card-2); color: var(--text); }
.lesson-item.current { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--text); }
.lesson-item .chk { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.lesson-item .chk.done { background: var(--ok); border-color: var(--ok); color: #000; }
.lesson-item .t { flex: 1; font-size: 14px; }
.module-head { display: grid; grid-template-columns: 200px 1fr; gap: 22px; margin-bottom: 22px; }
.module-head .cover { aspect-ratio: 3/4; border-radius: var(--radius); background: var(--card-2) center/cover; }
@media (max-width: 640px) { .module-head { grid-template-columns: 1fr; } .module-head .cover { display: none; } }
.desc { white-space: pre-wrap; color: #d6d6dd; }
.material { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.material:hover { border-color: var(--primary); }
.comment { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: 0; }
.comment .who { font-weight: 600; font-size: 14px; }

/* ---------- listas / tabelas admin ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.list-row { display: flex; gap: 12px; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-list { margin: 0 0 8px 28px; border-left: 2px solid var(--line); }
.tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; background: var(--card-2); color: var(--muted); }
.tag.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.tag.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--danger); }
.tag.pri { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary); }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
code.box { display: block; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; word-break: break-all; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat b { font-size: 26px; display: block; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 48px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: none; padding: 3px; cursor: pointer; }
.img-prev { height: 56px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); padding: 4px; }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: #000b; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.modal-head { display: flex; align-items: center; margin-bottom: 16px; }
.modal-head h2 { margin: 0; flex: 1; }
.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; background: var(--card-2); border: 1px solid var(--line); padding: 12px 18px; border-radius: 12px; font-weight: 500; box-shadow: 0 10px 30px #0008; }
.toast.err { border-color: var(--danger); }
.demo-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--primary); color: var(--primary-ink); text-align: center; font-size: 13px; font-weight: 600; padding: 6px; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); }
.spin { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* Abertura (motion da logo) */
.intro{position:fixed;inset:0;z-index:9999;background:#000;display:flex;align-items:center;justify-content:center;transition:opacity .6s ease}
.intro video{width:min(100vw,100vh,900px);height:min(100vw,100vh,900px);object-fit:contain;pointer-events:none}
.intro.out{opacity:0;pointer-events:none}
.intro-skip{position:absolute;right:20px;bottom:calc(20px + env(safe-area-inset-bottom));background:rgba(0,0,0,.35);color:#fff;border:1px solid rgba(255,255,255,.25);border-radius:999px;padding:8px 16px;font:inherit;font-size:13px;cursor:pointer}

/* Marca no topo do início: MEVO + fio + AFTERPAY PRO */
.hero-brand { display: inline-flex; flex-direction: column; align-items: center; align-self: flex-start; margin-bottom: 18px; }
.hero-brand img.logo { margin-bottom: 0; width: 240px; max-width: 100%; max-height: none; height: auto; }
.hero-line { width: 34%; height: 2px; border-radius: 2px; background: var(--primary); margin: 14px 0 10px; opacity: .9; }
.hero-sub { font-size: 14px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: #fff; padding-left: .3em; white-space: nowrap; }
.hero-sub b { color: var(--primary); font-weight: 800; }
@media (max-width: 520px) { .hero-brand img.logo { width: 190px; } .hero-sub { font-size: 11px; letter-spacing: .28em; } }

/* AfterPay PRO na tipografia da marca + "M" grande decorando o banner do início */
.hero-sub-img { display: block; width: 70%; height: auto; }
.hero:not(.has-img) { background:
  radial-gradient(700px 320px at 18% 0%, color-mix(in srgb, var(--primary) 32%, transparent), transparent 70%),
  radial-gradient(520px 380px at 88% 70%, rgba(123, 63, 176, .35), transparent 70%),
  var(--card); }
.hero > .hero-mark { position: absolute; right: 5%; top: 50%; transform: translateY(-50%); height: 76%; aspect-ratio: 945 / 598; max-width: 46%;
  background: linear-gradient(135deg, #F68522 0%, #C2569A 45%, #6B3FB8 100%);
  -webkit-mask: url(M.svg) center / contain no-repeat; mask: url(M.svg) center / contain no-repeat;
  opacity: .42; pointer-events: none; }
@media (max-width: 720px) { .hero > .hero-mark { right: -18%; height: 62%; max-width: none; opacity: .18; } }

/* Login com AFTERPAY PRO embaixo do MEVO */
.auth-brand { display: flex; flex-direction: column; align-items: center; width: 100%; }
.auth-logo .auth-brand > img:first-child { width: 78%; max-height: none; height: auto; }
.auth-brand .hero-line { width: 30%; margin: 14px 0 11px; }
.auth-logo .auth-sub-img { display: block; width: 56%; max-height: none; height: auto; }

/* selo do Netlify: discreto, no cantinho inferior direito */
#nl-badge-frame {
  transform: scale(.42) !important;
  transform-origin: bottom right !important;
  opacity: .55 !important;
  right: calc(6px + env(safe-area-inset-right)) !important;
  bottom: calc(6px + env(safe-area-inset-bottom)) !important;
  transition: opacity .2s;
}
#nl-badge-frame:hover { opacity: 1 !important; }
.legal-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-text { white-space: pre-wrap; max-height: 60vh; overflow: auto; font-size: 14px; line-height: 1.6; }
