/* Plataforma Novera — identidade visual alinhada à Novera Academy
   (fundo roxo-escuro, destaque violeta, CTA verde-petróleo, tipografia Geist). */
:root {
  color-scheme: dark;
  --bg: #0e0718;
  --bg-2: #150c24;
  --surface: #1a1029;
  --surface-2: #231536;
  --card: #2e1b44;
  --line: rgba(203, 190, 224, 0.12);
  --line-strong: rgba(169, 123, 255, 0.35);
  --text: #f4efff;
  --muted: #cbbee0;
  --dim: #8a7fa3;
  --violet: #a97bff;
  --violet-deep: #5e17b0;
  --violet-soft: rgba(169, 123, 255, 0.14);
  --teal: #07655c;
  --teal-hover: #0a7d71;
  --teal-bright: #3fd9c0;
  --danger: #ff8597;
  --danger-soft: rgba(255, 133, 151, 0.12);
  --success: #5ee6bf;
  --success-soft: rgba(94, 230, 191, 0.12);
  --warn: #f2b660;
  --a1: #14a892;
  --a2: #e39a2f;
  --b2: #8c5cf0;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-btn: 8px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 30px 46px -24px rgba(169, 123, 255, 0.45);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
/* Uma fonte só em toda a plataforma (Geist): inclusive botões, campos, listas de opções e códigos. */
button, input, select, textarea, optgroup, option, code, kbd, pre, samp { font-family: var(--font); }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 620px at 85% -10%, rgba(94, 23, 176, 0.38), transparent 60%),
    radial-gradient(900px 520px at -15% 25%, rgba(7, 101, 92, 0.16), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
/* ---------------------------------------------------------------- cosmos (fundo de todas as páginas) */
.cosmos { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.cosmos-img { position: absolute; inset: 0; background: url("/img/cosmos.svg") center / cover no-repeat;
  animation: cosmos-drift 60s ease-in-out infinite alternate; }
/* véu escuro para o texto continuar legível sobre a imagem */
.cosmos::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 5, 22, 0.25) 0%, rgba(10, 5, 22, 0.45) 60%, rgba(10, 5, 22, 0.6) 100%); }
@keyframes cosmos-drift { from { transform: scale(1.04) translate(0, 0); } to { transform: scale(1.1) translate(-1.5%, -1%); } }

.star { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; opacity: 0.7; animation: twinkle 3.2s ease-in-out infinite; }
.star.big { width: 3px; height: 3px; box-shadow: 0 0 6px 1px rgba(255, 255, 255, 0.8); }
@keyframes twinkle { 0%, 100% { opacity: 0.2; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

.shooting { position: absolute; width: 140px; height: 2px; border-radius: 2px; opacity: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff); transform: rotate(-24deg); animation: shoot 7s ease-in infinite; }
.shooting.s1 { top: 12%; left: 60%; animation-delay: 1s; }
.shooting.s2 { top: 30%; left: 20%; animation-delay: 4s; }
.shooting.s3 { top: 6%; left: 35%; animation-delay: 6.2s; }
@keyframes shoot { 0% { opacity: 0; translate: 0 0; } 4% { opacity: 1; } 12% { opacity: 0; translate: -260px 120px; } 100% { opacity: 0; translate: -260px 120px; } }

.rocket { position: absolute; font-size: 1.9rem; filter: drop-shadow(0 0 10px rgba(255, 180, 80, 0.7)); }
.rocket.r1 { bottom: -40px; left: -40px; animation: fly1 16s linear infinite; }
.rocket.r2 { bottom: -40px; left: 55%; font-size: 1.3rem; animation: fly2 22s linear infinite; animation-delay: 6s; }
.rocket.r3 { top: 18%; right: -60px; font-size: 1.6rem; filter: drop-shadow(0 0 10px rgba(120, 220, 255, 0.7)); animation: ufo 26s linear infinite; animation-delay: 3s; }
.cosmos .rocket.r1 { animation-duration: 24s; }
.cosmos .rocket.r2 { animation-duration: 30s; animation-delay: 9s; }
.cosmos .rocket.r3 { animation-duration: 38s; animation-delay: 5s; }
@keyframes fly1 { 0% { transform: translate(0, 0) rotate(0deg); } 100% { transform: translate(130vw, -110vh) rotate(8deg); } }
@keyframes fly2 { 0% { transform: translate(0, 0); } 100% { transform: translate(40vw, -115vh); } }
@keyframes ufo { 0% { transform: translate(0, 0); } 50% { transform: translate(-70vw, 40px); } 100% { transform: translate(-140vw, -10px); } }

@media (prefers-reduced-motion: reduce) {
  .star, .shooting, .rocket, .cosmos-img { animation: none !important; }
  .shooting, .cosmos .rocket { display: none; }
}
/* A imagem do fundo fica numa camada própria da placa de vídeo (não é redesenhada a cada quadro). */
.cosmos-img { will-change: transform; }

/* Páginas com vídeo do YouTube: o fundo animado + o desfoque da barra do topo, redesenhados
   junto com o vídeo, faziam a tela piscar em vários computadores. Aqui o fundo fica parado. */
body.has-video .cosmos *,
body.has-video .cosmos::after { animation: none !important; }
body.has-video .cosmos .shooting,
body.has-video .cosmos .rocket { display: none; }
body.has-video .cosmos-img { will-change: auto; transform: scale(1.04); }
body.has-video .topbar-inner,
body.has-video .nav-menu { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgb(26, 16, 41); }
[hidden] { display: none !important; }
a { color: var(--violet); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.45em; font-weight: 600; letter-spacing: -0.04em; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h2 { font-weight: 500; }
p { margin: 0 0 0.8em; }
.hl { color: var(--violet); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 0.875rem; }
.mt { margin-top: 1.5rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0.8rem; border-radius: 999px;
  background: var(--violet-soft); border: 1px solid rgba(169, 123, 255, 0.25);
  color: var(--muted); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase;
  margin-bottom: 1rem;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 10px var(--violet); }

/* ---------- Botões e formulários ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  padding: 0.62rem 1.1rem; font: inherit; font-weight: 500; font-size: 0.95rem;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
  background: var(--teal); color: #fff;
}
.btn:hover { background: var(--teal-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); border-color: rgba(203, 190, 224, 0.25); }
.btn-violet { background: var(--violet-deep); }
.btn-violet:hover { background: #6f22cc; }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255, 133, 151, 0.3); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: 0.38rem 0.75rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 0.45rem; width: 36px; height: 36px; }

.field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; min-width: 0; }
.field label { font-weight: 500; font-size: 0.88rem; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit; padding: 0.65rem 0.8rem; border-radius: var(--radius-sm); width: 100%; min-width: 0;
  border: 1px solid var(--line); background: rgba(14, 7, 24, 0.55); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field textarea { resize: vertical; min-height: 76px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft);
}
.field select option { background: var(--surface); }
.field .hint { font-size: 0.78rem; color: var(--dim); }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.9rem; }

.alert { padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.9rem; margin: 0.6rem 0; border: 1px solid transparent; }
.alert:empty { display: none; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(255, 133, 151, 0.25); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(94, 230, 191, 0.25); }

/* ---------- Barra superior (pílula flutuante) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; padding: 12px 16px 0; }
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0.55rem 0.7rem 0.55rem 0.9rem;
  display: flex; align-items: center; gap: 1.2rem;
  background: rgba(26, 16, 41, 0.82); border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px; backdrop-filter: blur(12px) saturate(1.4); -webkit-backdrop-filter: blur(12px) saturate(1.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.brand { display: flex; align-items: center; gap: 0.65rem; color: var(--text); text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: radial-gradient(circle at 30% 25%, #c4a4ff, var(--violet-deep) 70%);
  color: #fff; font-weight: 700; font-size: 0.95rem; box-shadow: 0 0 18px rgba(169, 123, 255, 0.45);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-size: 0.98rem; font-weight: 700; letter-spacing: 0.14em; }
.brand-text span { font-size: 0.56rem; letter-spacing: 0.38em; color: var(--violet); margin-top: 3px; }
.nav { display: flex; gap: 0.2rem; flex: 1; justify-content: center; }
.nav a { padding: 0.45rem 0.8rem; border-radius: var(--radius-btn); color: var(--muted); text-decoration: none; font-size: 0.93rem; }
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.nav a.active { color: var(--text); background: var(--violet-soft); }
.user-box { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; }
.user-box .name { color: var(--muted); }

.container { max-width: 1100px; margin: 0 auto; padding: 2.2rem 1rem 5rem; }
.page-head { margin-bottom: 1.8rem; }
.card {
  background: linear-gradient(180deg, rgba(46, 27, 68, 0.7), rgba(29, 18, 46, 0.7));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem;
}

/* ---------- Badges de nível ---------- */
.level-badge {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; border-radius: 7px; padding: 0.12rem 0.5rem; font-size: 0.8rem; color: #fff; letter-spacing: 0.02em;
}
.level-A1 { background: var(--a1); }
.level-A2 { background: var(--a2); }
.level-B2 { background: var(--b2); }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 500; padding: 0.18rem 0.55rem; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); color: var(--muted); border: 1px solid var(--line); white-space: nowrap;
}
.tag-own { background: var(--success-soft); color: var(--success); border-color: rgba(94, 230, 191, 0.25); }

/* ---------- Login / cadastro ---------- */
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; max-width: 1200px; margin: 0 auto; }
.auth-hero { position: relative; padding: 3rem 2.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; }
.auth-hero > *:not(.hero-orbit) { position: relative; z-index: 1; }
.auth-hero h1 .hl { background: linear-gradient(90deg, #f2c94c, #ff9f5a 45%, #c79bff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ilustração do login: planeta com órbita tracejada, foguete dando a volta e as "luas" dos níveis */
.hero-orbit { position: absolute; top: 0.6rem; right: -2.2rem; width: 230px; height: 230px; pointer-events: none; }
.orbit-path { position: absolute; inset: 10px; border-radius: 50%; border: 3px dashed rgba(242, 201, 76, 0.6); animation: spin 60s linear infinite; }
.orbit-planet { position: absolute; inset: 62px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f3e8ff, #a97bff 35%, #5b2bc4 70%, #1b0b45);
  box-shadow: 0 0 50px rgba(169, 123, 255, 0.65), inset -14px -16px 30px rgba(5, 1, 15, 0.6); animation: bob 6s ease-in-out infinite; }
.orbit-planet::after { content: ""; position: absolute; inset: 44% -30%; border-radius: 50%;
  border: 4px solid rgba(255, 214, 120, 0.75); border-top-color: transparent; transform: rotate(-16deg); }
.orbit-arm { position: absolute; inset: 10px; animation: spin 9s linear infinite; }
.orbit-rocket { position: absolute; top: -18px; left: 50%; font-size: 1.9rem; transform: translateX(-50%) rotate(45deg);
  filter: drop-shadow(0 0 10px rgba(255, 170, 70, 0.9)); }
.orbit-moon { position: absolute; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 800; color: #1a1030; animation: bob 5s ease-in-out infinite; }
.orbit-moon.m1 { left: -6px; top: 56%; background: radial-gradient(circle at 30% 30%, #fff8, #f2c94c 50%, #14a892); box-shadow: 0 0 18px #f2c94c88; }
.orbit-moon.m2 { right: -4px; top: 22%; background: radial-gradient(circle at 30% 30%, #fff8, #ff9f5a 50%, #e34f7a); box-shadow: 0 0 18px #ff9f5a88; animation-delay: -1.6s; }
.orbit-moon.m3 { left: 40%; bottom: -8px; background: radial-gradient(circle at 30% 30%, #fff8, #a97bff 50%, #4cc3ff); box-shadow: 0 0 18px #a97bff88; animation-delay: -3.2s; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@media (max-width: 1100px) { .hero-orbit { width: 180px; height: 180px; right: -1rem; } .orbit-planet { inset: 46px; } .orbit-rocket { font-size: 1.5rem; } }
@media (max-width: 900px) { .hero-orbit { width: 140px; height: 140px; top: 0.6rem; right: 0.4rem; opacity: 0.9; }
  .orbit-planet { inset: 36px; } .orbit-moon { width: 28px; height: 28px; font-size: 0.6rem; } .orbit-rocket { font-size: 1.2rem; top: -12px; } }
@media (prefers-reduced-motion: reduce) { .orbit-path, .orbit-arm, .orbit-planet, .orbit-moon { animation: none; } }
.auth-hero h1 { font-size: clamp(2.2rem, 4.4vw, 3.4rem); max-width: 13ch; }
.auth-hero .lead { color: var(--muted); max-width: 44ch; font-size: 1.05rem; }
.stats { display: flex; gap: 2.2rem; flex-wrap: wrap; }
.stat strong { display: block; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.stat span { font-size: 0.8rem; color: var(--dim); }
.hero-levels { display: grid; gap: 0.6rem; max-width: 420px; }
.hero-level {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 0.95rem; border-radius: 12px;
  background: rgba(46, 27, 68, 0.55); border: 1px solid var(--line); color: var(--muted); font-size: 0.93rem;
}
.hero-level .level-badge { min-width: 40px; }
.auth-panel { display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; padding: 2rem; box-shadow: var(--shadow), var(--glow); }
.auth-card h2 { font-size: 1.5rem; }
.tabs {
  display: grid; grid-template-columns: 1fr 1fr; background: rgba(14, 7, 24, 0.6); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px; margin-bottom: 1.6rem;
}
.tabs button { border: 0; background: transparent; font: inherit; font-weight: 500; padding: 0.55rem; border-radius: 9px; cursor: pointer; color: var(--dim); }
.tabs button.active { background: var(--card); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3); }

/* ---------- Nivelamento ---------- */
.quiz { max-width: 700px; margin: 0 auto; }
.progress { height: 6px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; overflow: hidden; margin: 0.9rem 0 1.6rem; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet-deep), var(--violet)); width: 0; transition: width .25s; box-shadow: 0 0 12px var(--violet); }
.q-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--dim); letter-spacing: 0.08em; text-transform: uppercase; }
.q-prompt { font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; margin: 0.4rem 0 1.4rem; }
.options { display: grid; gap: 0.6rem; }
.option {
  text-align: left; font: inherit; padding: 0.9rem 1rem; border-radius: 12px; color: var(--text);
  border: 1px solid var(--line); background: rgba(14, 7, 24, 0.45); cursor: pointer; display: flex; gap: 0.8rem; align-items: center;
  transition: border-color .15s, background .15s;
}
.option:hover { border-color: rgba(169, 123, 255, 0.4); }
.option.selected { border-color: var(--violet); background: var(--violet-soft); }
.option .letter { width: 28px; height: 28px; border-radius: 8px; background: rgba(255, 255, 255, 0.06); display: grid; place-items: center; font-weight: 600; font-size: 0.82rem; flex-shrink: 0; color: var(--muted); }
.option.selected .letter { background: var(--violet); color: #12081f; }
.quiz-actions { display: flex; justify-content: space-between; margin-top: 1.6rem; }
.result-level { margin: 0.3rem 0 1rem; }
.result-level .level-badge { font-size: 3rem; padding: 0.35rem 1.1rem; border-radius: 16px; box-shadow: var(--glow); }
.band-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin: 1.4rem 0; }
.band { background: rgba(14, 7, 24, 0.45); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem; text-align: center; }
.band p { margin: 0.4rem 0 0; }
.band strong { display: block; font-size: 1.35rem; font-weight: 600; }
.result-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- Trilhas ---------- */
.level-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin-bottom: 2rem; }
.level-tab {
  text-align: left; border: 1px solid var(--line); background: rgba(26, 16, 41, 0.7);
  border-radius: var(--radius); padding: 1rem 1.1rem; cursor: pointer; font: inherit; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 0.35rem; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.level-tab:hover { border-color: rgba(169, 123, 255, 0.35); transform: translateY(-2px); }
.level-tab.active { border-color: var(--violet); box-shadow: var(--glow); background: rgba(46, 27, 68, 0.8); }
.level-tab .row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.level-tab strong { font-weight: 500; }
.track-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.track-hero h1 { margin-bottom: 0.3rem; }
.track-hero p { margin: 0; max-width: 60ch; }
.notice {
  background: rgba(242, 182, 96, 0.1); color: var(--warn); border: 1px solid rgba(242, 182, 96, 0.25);
  border-radius: var(--radius-sm); padding: 0.75rem 0.95rem; margin-bottom: 1.4rem; font-size: 0.92rem;
}
.notice a { color: var(--warn); font-weight: 500; }

.modules { display: grid; gap: 1rem; }
.module {
  background: linear-gradient(180deg, rgba(46, 27, 68, 0.75), rgba(29, 18, 46, 0.75));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, border-color .2s;
}
.module:hover, .module.open { box-shadow: var(--shadow), var(--glow); border-color: rgba(169, 123, 255, 0.22); }
.module-head { display: flex; gap: 1rem; align-items: center; padding: 1.1rem 1.25rem; cursor: pointer; width: 100%; border: 0; background: none; font: inherit; text-align: left; color: inherit; }
.module-num {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 600; flex-shrink: 0;
  background: var(--violet-soft); color: var(--violet); border: 1px solid rgba(169, 123, 255, 0.25);
}
.module-head .grow { flex: 1; min-width: 0; }
.mod-title { display: block; font-weight: 500; font-size: 1.08rem; letter-spacing: -0.01em; }
.mod-desc { display: block; font-size: 0.88rem; color: var(--dim); }
.chev { transition: transform .2s; color: var(--dim); font-size: 0.8rem; }
.module.open .chev { transform: rotate(90deg); }
.module-body { border-top: 1px solid var(--line); padding: 0.4rem 1.25rem 1rem; }
.empty { color: var(--dim); font-size: 0.92rem; padding: 0.8rem 0; margin: 0; }

.material { display: flex; gap: 0.95rem; align-items: center; padding: 0.85rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.material:last-child { border-bottom: 0; }
.mat-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 0.64rem;
  font-weight: 700; flex-shrink: 0; letter-spacing: .05em; border: 1px solid transparent; text-transform: uppercase;
}
.kind-pdf { background: rgba(255, 133, 151, 0.12); color: #ff9aa9; border-color: rgba(255, 133, 151, 0.25); }
.kind-audio { background: rgba(63, 217, 192, 0.1); color: var(--teal-bright); border-color: rgba(63, 217, 192, 0.25); }
.kind-video { background: var(--violet-soft); color: var(--violet); border-color: rgba(169, 123, 255, 0.3); }
.kind-document { background: rgba(242, 182, 96, 0.1); color: var(--warn); border-color: rgba(242, 182, 96, 0.25); }
.mat-info { flex: 1; min-width: 200px; }
.mat-info strong { display: block; font-weight: 500; }
.mat-title-btn { all: unset; display: block; cursor: pointer; font-weight: 500; }
.mat-title-btn:hover { color: var(--violet); }
.mat-title-btn:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }
.mat-actions { display: flex; gap: 0.4rem; }

/* ---------- Visualizador (modal) ---------- */
body.viewer-open { overflow: hidden; }
.viewer {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 2.5vh 2vw;
  background: rgba(8, 4, 14, 0.78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.viewer-panel {
  width: min(1180px, 100%); height: 100%; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), var(--glow);
}
.viewer-head { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.viewer-head .grow { flex: 1; min-width: 0; }
.viewer-head strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.viewer-head .meta { font-size: 0.8rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.viewer-actions { display: flex; gap: 0.4rem; align-items: center; }
.viewer-body { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; background: #120a1e; }
.viewer-body iframe { width: 100%; height: 100%; border: 0; background: #efeaf7; }
.viewer-body iframe.canva-frame { background: #0b0614; }
.viewer-body video { max-width: 100%; max-height: 100%; background: #000; }
.viewer-audio { width: min(560px, 90%); text-align: center; }
.viewer-audio .mat-icon { width: 96px; height: 96px; border-radius: 28px; font-size: 1rem; margin: 0 auto 1.4rem; box-shadow: var(--glow); }
.viewer-audio audio { width: 100%; margin-top: 1rem; }
.viewer-message { text-align: center; padding: 2rem; max-width: 460px; color: var(--muted); }
.viewer-message .mat-icon { margin: 0 auto 1rem; width: 72px; height: 72px; border-radius: 20px; font-size: 0.85rem; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 0.9rem; pointer-events: none; }
.viewer-desc { padding: 0.7rem 1rem; border-top: 1px solid var(--line); font-size: 0.88rem; color: var(--muted); background: var(--surface-2); }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 390px 1fr; gap: 1.5rem; align-items: start; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 1.2rem; }
.upload-progress { height: 6px; background: rgba(255, 255, 255, 0.06); border-radius: 999px; overflow: hidden; margin: 0.6rem 0; }
.upload-progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--teal-bright)); transition: width .15s; }
.drop {
  border: 1.5px dashed rgba(203, 190, 224, 0.25); border-radius: 12px; padding: 1.2rem; text-align: center;
  color: var(--dim); font-size: 0.9rem; cursor: pointer; transition: border-color .15s, background .15s;
}
.drop:hover { border-color: rgba(169, 123, 255, 0.5); }
.drop.has-file { border-style: solid; border-color: var(--violet); color: var(--text); background: var(--violet-soft); }
.drop input { display: none; }
.admin-module { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 0.8rem; overflow: hidden; }
.admin-module-head { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; padding: 0.8rem 0.95rem; background: rgba(14, 7, 24, 0.4); }
.admin-module-head h3 { margin: 0; font-size: 1rem; font-weight: 500; letter-spacing: -0.01em; }
.admin-module-body { padding: 0 0.95rem; }
.inline-form { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 0.6rem; align-items: end; margin-bottom: 1.2rem; }
.inline-form .field { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 500; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .12em; }
.segmented { display: inline-flex; background: rgba(14, 7, 24, 0.6); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.segmented button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 0.35rem 0.85rem; border-radius: 7px; cursor: pointer; color: var(--dim); }
.segmented button.active { background: var(--card); color: var(--text); }

.toast {
  position: fixed; bottom: 1.4rem; left: 50%; transform: translateX(-50%); z-index: 80;
  background: var(--card); color: var(--text); padding: 0.75rem 1.15rem; border-radius: 12px; font-size: 0.92rem;
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}

:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { padding: 2rem 1rem 0; gap: 1.6rem; }
  .admin-grid { grid-template-columns: 1fr; }
  .inline-form { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { padding: 8px 8px 0; }
  .topbar-inner { flex-wrap: wrap; gap: 0.4rem 0.5rem; justify-content: space-between; }
  .nav { order: 3; flex: 1 0 100%; justify-content: flex-start; overflow-x: auto; border-top: 1px solid var(--line); padding-top: 0.35rem; }
  .user-box .name, .user-box .tag, .brand-text span { display: none; }
  .level-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
  .level-tab { padding: 0.7rem; }
  .level-tab strong, .level-tab .small, .level-tab .tag { display: none; }
  .level-tab .row { justify-content: center; }
  .module-head { gap: 0.75rem; padding: 1rem; }
  .module-head .tag { display: none; }
  .module-num { width: 36px; height: 36px; }
  .mat-actions { width: 100%; }
  .mat-actions .btn { flex: 1; }
  .form-row, .band-grid { grid-template-columns: 1fr; }
  .viewer { padding: 0; }
  .viewer-panel { border-radius: 0; }
  .viewer-head .btn-label { display: none; }
  .card { padding: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Notificações: sino no topo, painel e pop-up ---------- */
.nav-bell { position: relative; display: inline-grid; place-items: center; width: 38px; height: 34px; border: 0; border-radius: var(--radius-btn);
  background: transparent; color: var(--muted); font-size: 1.05rem; cursor: pointer; flex: none; }
.nav-bell:hover, .nav-bell[aria-expanded="true"] { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.nav-bell:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.nav-bell.has-unread > span:first-child { animation: bell-ring 2.4s ease-in-out infinite; display: inline-block; transform-origin: 50% 0; }
.nav-bell-count { position: absolute; top: 1px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ff5f7a; color: #fff; font-size: 0.68rem; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px rgba(26, 16, 41, 0.9); }
@keyframes bell-ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(14deg); } 82% { transform: rotate(-12deg); } 89% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
.notif-panel { position: fixed; z-index: 60; max-height: min(70vh, 560px); overflow: auto; padding: 0.8rem; border-radius: 16px;
  background: rgb(30, 19, 47); border: 1px solid var(--line-strong, rgba(255, 255, 255, 0.14)); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.notif-head { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.notif-pill { display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.45rem; border-radius: 999px; background: #ff5f7a; color: #fff; font-size: 0.72rem; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.notif { display: grid; gap: 0.45rem; padding: 0.65rem 0.75rem; border-radius: 12px; background: rgba(169, 123, 255, 0.12); border: 1px solid rgba(169, 123, 255, 0.35); text-align: left; }
.notif.is-read { background: rgba(255, 255, 255, 0.03); border-color: var(--line); opacity: 0.75; }
.notif-main { display: grid; gap: 0.15rem; min-width: 0; }
.notif-title { font-size: 0.92rem; line-height: 1.3; }
.notif-body { font-size: 0.84rem; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.notif-time { font-size: 0.75rem; color: var(--dim); }
.notif-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.notif-empty { margin: 0.4rem 0; color: var(--muted); font-size: 0.9rem; }
.notif-pop { width: min(520px, 100%); max-height: 88vh; overflow: auto; padding: 1.4rem; display: grid; gap: 0.7rem; box-shadow: var(--shadow), var(--glow); }
.notif-pop h2 { margin: 0; font-size: 1.3rem; }
.notif-pop p { margin: 0; }
.notif-pop-actions { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.notif-pop-right { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }
.btn.btn-go { background: #22a865; color: #fff; border-color: transparent; }
.btn.btn-go:hover { background: #1c9257; }
.notif-task .notif-title a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .notif-pop { padding: 1.1rem; }
  .viewer.notif-pop-wrap { padding: 0; align-items: flex-end; }
  .notif-pop-right { flex: 1; }
  .notif-pop-actions .btn { flex: 1; }
}
.notif-section { margin: 0.2rem 0 0.4rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.notif-section ~ .notif-list + .notif-section { margin-top: 0.8rem; }
.notif-task { background: rgba(249, 213, 110, 0.1); border-color: rgba(249, 213, 110, 0.4); }
.notif-task .t-pend-bar { height: 6px; margin-top: 0.25rem; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.notif-task .t-pend-bar span { display: block; height: 100%; width: 0; background: #f9d56e; border-radius: inherit; }
.notif-task .level-badge { font-size: 0.68rem; padding: 0.05rem 0.35rem; vertical-align: middle; }
.notif-pop-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.notif-pop-body { display: grid; gap: 0.2rem; }
@media (prefers-reduced-motion: reduce) { .nav-bell.has-unread > span:first-child { animation: none; } }

/* ======================================================================
   Celular: menu fixo embaixo (como app), gavetas que sobem e movimento
   ====================================================================== */
html { -webkit-tap-highlight-color: transparent; }
.tabbar { display: none; }
.btn:active:not(:disabled) { transform: scale(0.97); }
@keyframes sheet-up { from { transform: translateY(100%); opacity: 0.6; } to { transform: none; opacity: 1; } }
@keyframes page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
  /* Topo enxuto: marca + nível + Sair. O menu vai para baixo. */
  body.has-tabbar .nav { display: none; }
  body.has-tabbar { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .topbar-inner { flex-wrap: nowrap; padding: 0.45rem 0.55rem 0.45rem 0.7rem; }
  .brand-mark { width: 30px; height: 30px; }

  .tabbar {
    position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 45;
    display: flex; gap: 2px; padding: 5px; border-radius: 22px;
    background: rgba(26, 16, 41, 0.94); border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .tab {
    flex: 1; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: 7px 2px 6px; border: 0; border-radius: 16px;
    background: none; color: var(--dim); font: inherit; font-size: 0.66rem; font-weight: 500; text-decoration: none; cursor: pointer;
    transition: background .2s, color .2s, transform .12s;
  }
  .tab-ico { position: relative; font-size: 1.3rem; line-height: 1; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab.active { color: var(--text); background: var(--violet-soft); }
  .tab.active .tab-ico { transform: translateY(-2px) scale(1.15); }
  .tab:active { transform: scale(0.92); }
  .tab .nav-bell-count { top: -7px; right: -13px; }
  .tab-bell.has-unread .tab-ico { animation: bell-ring 2.4s ease-in-out infinite; transform-origin: 50% 0; }

  /* Avisos sobem acima do menu de baixo. */
  .notif-panel.is-sheet { left: 8px; right: 8px; top: auto; width: auto; bottom: calc(88px + env(safe-area-inset-bottom));
    max-height: 68vh; border-radius: 20px; animation: sheet-up .28s ease-out; }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); width: max-content; max-width: calc(100vw - 32px); text-align: center; }

  /* Pop-up de avisos e janelas: gaveta presa embaixo, com a "alcinha" no topo. */
  .notif-pop { width: 100%; max-height: 86vh; border-radius: 22px 22px 0 0; padding-bottom: calc(1.1rem + env(safe-area-inset-bottom));
    animation: sheet-up .3s ease-out; }
  .notif-pop::before, .hw-modal::before { content: ""; justify-self: center; display: block; width: 42px; height: 5px; margin: -0.4rem auto 0.2rem;
    border-radius: 99px; background: rgba(255, 255, 255, 0.22); }

  /* Campos com 16px: o iPhone não dá zoom sozinho ao tocar. */
  input, select, textarea { font-size: 16px; }

  /* Conteúdo entra com um leve deslizar. */
  main, .container { animation: page-in .35s ease-out both; }
  .page-head h1, h1 { font-size: clamp(1.6rem, 7vw, 2.1rem); }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  main, .container, .notif-pop, .notif-panel.is-sheet { animation: none; }
  .tab-bell.has-unread .tab-ico { animation: none; }
}

/* Celular: lista que abre ao tocar num ícone do menu de baixo */
.sheet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.sheet-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 0.8rem; border-radius: 14px; color: var(--text); text-decoration: none;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); transition: background .15s, transform .12s; }
.sheet-item:active { transform: scale(0.98); background: var(--violet-soft); }
.sheet-item.is-locked { opacity: 0.55; }
.sheet-ico { width: 32px; display: grid; place-items: center; font-size: 1.25rem; flex: none; }
.sheet-label { flex: 1; min-width: 0; font-weight: 500; }
.sheet-tag { font-size: 0.7rem; color: var(--dim); white-space: nowrap; }
.sheet-tag.own { color: var(--success); }
.sheet-go { color: var(--dim); font-size: 1.3rem; line-height: 1; }
@media (max-width: 640px) {
  .tab-sheet .sheet-list > li { animation: pop-in .25s ease-out both; }
  .tab-sheet .sheet-list > li:nth-child(2) { animation-delay: 25ms; } .tab-sheet .sheet-list > li:nth-child(3) { animation-delay: 50ms; }
  .tab-sheet .sheet-list > li:nth-child(4) { animation-delay: 75ms; } .tab-sheet .sheet-list > li:nth-child(n+5) { animation-delay: 100ms; }
}
@media (prefers-reduced-motion: reduce) { .tab-sheet .sheet-list > li { animation: none; } }

.tab[aria-expanded="true"] { color: var(--text); background: rgba(255, 255, 255, 0.07); }
