/* ===== Base ===== */
:root {
  --bg: #060a13;
  --panel: #0c1322;
  --line: rgba(148, 163, 184, 0.14);
  --text: #e6edf7;
  --muted: #8fa1b8;
  --blue: #3b82f6;
  --blue-claro: #60a5fa;
  --green: #22c55e;
  --grad: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
  --raio: 16px;
  --sombra: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

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

/* garante que o atributo hidden sempre vença regras de display */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Sora', 'Inter', sans-serif; }

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--blue-claro);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #27364e; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: rgba(59, 130, 246, 0.35); }

/* ===== Fundo animado em grid ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
}

.bg-grid::before {
  content: '';
  position: absolute;
  top: -46px;
  left: -46px;
  width: calc(100% + 92px);
  height: calc(100% + 92px);
  background-image:
    linear-gradient(rgba(96, 165, 250, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.07) 1px, transparent 1px);
  background-size: 46px 46px;
  animation: grid-desliza 16s linear infinite;
  will-change: transform;
}

@keyframes grid-desliza {
  from { transform: translate(0, 0); }
  to { transform: translate(46px, 46px); }
}

.bg-vinheta {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(37, 99, 235, 0.12), transparent 60%),
    radial-gradient(ellipse at center, transparent 40%, rgba(2, 5, 10, 0.85) 100%);
}

.bg-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(130px);
  z-index: -2;
  opacity: 0.32;
  pointer-events: none;
  will-change: transform;
}

.bg-glow--1 {
  background: #1d4ed8;
  top: -160px;
  left: -140px;
  animation: glow-flutua 14s ease-in-out infinite alternate;
}

.bg-glow--2 {
  background: #15803d;
  bottom: -200px;
  right: -160px;
  animation: glow-flutua 18s ease-in-out infinite alternate-reverse;
}

@keyframes glow-flutua {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(60px, 40px) scale(1.15); }
}

/* ===== Cabeçalho ===== */
.topo {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px 24px;
  background: rgba(6, 10, 19, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.logo { display: inline-flex; align-items: center; }
.logo svg { height: 44px; display: block; }

/* logos enviadas ganham um fundo branco para ficarem legíveis no tema escuro */
.logo img {
  height: 56px;
  max-width: 280px;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  background: #fff;
  padding: 8px 16px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

/* ===== Banner principal ===== */
.hero {
  position: relative;
  height: clamp(320px, 52vh, 580px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(6, 10, 19, 0.3) 0%, transparent 28%, transparent 55%, var(--bg) 100%);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: hero-zoom 26s ease-in-out infinite alternate;
}

@keyframes hero-zoom {
  from { transform: scale(1.02); }
  to { transform: scale(1.1); }
}

.hero-conteudo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 44px;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}

.hero-conteudo h1 {
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.65);
}

.hero-conteudo p {
  color: #d7e0ec;
  margin-top: 10px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.75);
}

.hero-fallback {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 0 24px;
  background:
    radial-gradient(620px 320px at 18% 22%, rgba(59, 130, 246, 0.28), transparent 62%),
    radial-gradient(620px 320px at 82% 78%, rgba(34, 197, 94, 0.2), transparent 62%),
    linear-gradient(160deg, #0b1322, #060a13);
}

.hero-fallback h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, #60a5fa 10%, #4ade80 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-fallback p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); }

/* ===== Banner de oferta / venda ===== */
.cta-venda {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(700px 320px at 15% 20%, rgba(59, 130, 246, 0.22), transparent 60%),
    radial-gradient(700px 320px at 85% 80%, rgba(34, 197, 94, 0.18), transparent 60%),
    linear-gradient(160deg, #0d1830, #0a1120);
}

.cta-venda-conteudo {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px;
  text-align: center;
}

.cta-venda h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 16px;
}

.cta-venda p {
  color: var(--muted);
  margin-top: 10px;
  font-size: 1rem;
  line-height: 1.6;
}

.cta-venda-botao {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 30px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  box-shadow: 0 14px 40px -14px rgba(37, 99, 235, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cta-venda-botao::after { content: '→'; }

.cta-venda-botao:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 18px 50px -14px rgba(37, 99, 235, 0.7);
}

/* ===== Seção de vídeos ===== */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 72px 24px 48px;
}

.secao-cabecalho { text-align: center; margin-bottom: 52px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-claro);
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(59, 130, 246, 0.08);
  padding: 7px 16px;
  border-radius: 999px;
}

.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.secao-cabecalho h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 18px;
}

.linha-grad {
  width: 76px;
  height: 4px;
  border-radius: 4px;
  background: var(--grad);
  margin: 18px auto 0;
}

.grade-videos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* tablet */
@media (max-width: 1024px) {
  .grade-videos { grid-template-columns: repeat(2, 1fr); }
}

/* celular */
@media (max-width: 640px) {
  .grade-videos { grid-template-columns: 1fr; gap: 18px; }
  main { padding: 48px 16px 32px; }
  .secao-cabecalho { margin-bottom: 36px; }
}

/* progresso geral do curso, acima da grade de vídeos */
.progresso-geral {
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 19, 34, 0.6);
}

.progresso-geral-topo {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}

.progresso-geral-topo span:last-child { color: var(--blue-claro); flex: none; }

.progresso-geral-barra {
  height: 8px;
  border-radius: 99px;
  background: #1b2740;
  overflow: hidden;
}

.progresso-geral-barra span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--grad);
  transition: width 0.5s ease;
}

/* título de módulo/seção entre os cards de vídeo */
.grade-modulo-titulo {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 8px 0 4px;
}

.grade-modulo-titulo:not(:first-child) {
  margin-top: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.grade-modulo-titulo::before {
  content: '';
  width: 4px;
  height: 18px;
  border-radius: 3px;
  background: var(--grad);
  flex: none;
}

/* destaque da próxima aula sugerida */
.tv.proxima {
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.35), 0 26px 60px -18px rgba(37, 99, 235, 0.4);
}

.sem-videos {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

/* ===== Card estilo TV ===== */
.tv {
  background: linear-gradient(180deg, #131c30, #0c1322);
  border: 1px solid var(--line);
  border-radius: var(--raio);
  padding: 12px;
  box-shadow: var(--sombra);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.tv:hover {
  transform: translateY(-6px);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 26px 60px -18px rgba(37, 99, 235, 0.35);
}

.tv-tela {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #020409;
}

.tv-tela iframe,
.tv-tela video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.tv-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 4px 4px;
}

.tv-titulo {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.35em); /* reserva 2 linhas: todos os cards ficam da mesma altura */
}

/* barra de progresso do vídeo */
.tv-progresso {
  height: 6px;
  border-radius: 99px;
  background: #1b2740;
  overflow: hidden;
}

.tv-progresso-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  background: var(--grad);
  transition: width 0.4s ease;
}

.tv-progresso.oculta { visibility: hidden; }

.tv-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
}

.tv-led {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
  animation: led-pisca 2.4s ease-in-out infinite;
}

.tv-led.apagado {
  background: #334155;
  box-shadow: none;
  animation: none;
}

@keyframes led-pisca {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.tv-status-texto {
  flex: 1;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv.concluido .tv-status-texto { color: #4ade80; }
.tv.concluido .tv-progresso-fill { background: linear-gradient(90deg, #16a34a, #4ade80); }
.tv.concluido .tv-tela { box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.35); }

.tv-deco { display: flex; gap: 5px; flex: none; }
.tv-deco span { width: 16px; height: 5px; border-radius: 3px; background: #25324a; display: block; }
.tv-deco span:last-child { width: 8px; }

/* Miniatura clicável (YouTube) */
.tv-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #000;
  display: block;
}

.tv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: opacity 0.3s ease, transform 0.5s ease;
}

.tv-thumb:hover img { opacity: 1; transform: scale(1.05); }

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(6, 10, 19, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  transition: transform 0.3s ease, background 0.3s ease;
}

.tv-thumb:hover .play {
  transform: translate(-50%, -50%) scale(1.12);
  background: rgba(37, 99, 235, 0.78);
}

.play svg { width: 22px; height: 22px; margin-left: 3px; }

/* Slot vazio */
.tv-vazia {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #3d4d68;
  background: #050910;
  overflow: hidden;
}

.tv-vazia::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(96, 165, 250, 0.07) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: tela-brilho 3.6s linear infinite;
}

@keyframes tela-brilho {
  to { transform: translateX(100%); }
}

.tv-vazia svg { width: 40px; height: 40px; opacity: 0.75; }

.tv-vazia span {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ===== Animação de entrada ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visivel { opacity: 1; transform: none; }

/* ===== Rodapé ===== */
footer {
  border-top: 1px solid var(--line);
  padding: 30px 24px 36px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(6, 10, 19, 0.6);
}

.footer-marca { font-weight: 600; color: var(--text); }

.rodape-admin { margin-top: 10px; font-size: 0.82rem; }

footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted rgba(51, 65, 85, 0.6);
  transition: color 0.2s ease;
}

footer a:hover { color: var(--blue-claro); }

.rodape-sair {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted rgba(51, 65, 85, 0.6);
  cursor: pointer;
  transition: color 0.2s ease;
}

.rodape-sair:hover { color: var(--blue-claro); }

/* ===== Botão e popup de materiais da aula ===== */
.tv-materiais {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(59, 130, 246, 0.08);
  color: var(--blue-claro);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.tv-materiais:hover { background: rgba(59, 130, 246, 0.16); border-color: rgba(96, 165, 250, 0.5); }
.tv-materiais:active { transform: scale(0.97); }

.tv-materiais-icone { display: inline-flex; width: 16px; height: 16px; flex: none; }
.tv-materiais-icone svg { width: 100%; height: 100%; }

.materiais-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 5, 10, 0.65);
}

.materiais-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 82vh;
  overflow-y: auto;
  background: linear-gradient(180deg, #131c30, #0c1322);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px 28px;
  box-shadow: var(--sombra);
  animation: gate-entra 0.4s ease;
}

.materiais-fechar {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.materiais-fechar:hover { color: var(--text); border-color: #33415f; }

.materiais-card h3 {
  font-size: 1.12rem;
  font-weight: 800;
  padding-right: 28px;
  margin-bottom: 14px;
}

.materiais-obs {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  background: rgba(6, 10, 19, 0.5);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.materiais-lista { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.materiais-lista a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10, 17, 32, 0.7);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.materiais-lista a:hover {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.1);
  transform: translateX(2px);
}

.materiais-lista a svg { width: 18px; height: 18px; flex: none; color: var(--blue-claro); }

.materiais-vazio { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 8px 0; }

body.materiais-aberto { overflow: hidden; }

/* ===== Portão de acesso por e-mail ===== */
.site-conteudo {
  transition: filter 0.5s ease;
}

body.gate-ativo .site-conteudo {
  filter: blur(20px) brightness(0.55);
  pointer-events: none;
  user-select: none;
}

.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 5, 10, 0.55);
}

.gate-card {
  width: 100%;
  max-width: 380px;
  background: linear-gradient(180deg, #131c30, #0c1322);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px 30px 30px;
  box-shadow: var(--sombra);
  text-align: center;
  animation: gate-entra 0.5s ease;
}

@keyframes gate-entra {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.gate-icone {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: var(--blue-claro);
}

.gate-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.gate-card p {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 8px;
  margin-bottom: 22px;
  line-height: 1.5;
}

.gate-card input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.gate-card input::placeholder { color: #55698a; }
.gate-card input:focus { border-color: var(--blue-claro); }

.gate-card button {
  width: 100%;
  margin-top: 14px;
  padding: 13px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.gate-card button:hover { transform: translateY(-1px); }
.gate-card button:disabled { opacity: 0.6; cursor: wait; transform: none; }

.gate-erro {
  margin-top: 14px;
  font-size: 0.82rem;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  padding: 9px 12px;
  border-radius: 8px;
}

.gate-contato {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ===== Acessibilidade ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bg-grid::before, .bg-glow, .hero-img, .tv-led, .tv-vazia::after { animation: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
}
