/* ============================================================
   MS Academy Online — Design System v3
   Mobile-first · preto grafite + vermelho MS · estilo aplicativo
   ============================================================ */

:root {
  --acento: #e01b24;
  --acento-claro: #ff3b44;
  --acento-escuro: #8f0e14;
  --fundo: #0b0c10;
  --superficie: rgba(255, 255, 255, .05);
  --superficie-2: rgba(255, 255, 255, .09);
  --borda: rgba(255, 255, 255, .12);
  --borda-acento: rgba(224, 27, 36, .55);
  --texto: #f4f4f6;
  --texto-suave: #a3a3ad;
  --verde: #34d399;
  --vermelho: #f87171;
  --raio: 18px;
  --raio-sm: 12px;
  --brilho-acento: 0 10px 40px -10px rgba(224, 27, 36, .45);
  --sombra: 0 18px 50px -12px rgba(0, 0, 0, .65);
  --fonte-corpo: 'Inter', 'Segoe UI', sans-serif;
  --fonte-display: 'Sora', 'Segoe UI', sans-serif;
  --altura-tabbar: 66px;
}

/* ---------- base ---------- */
/* Avisa o navegador que o tema é escuro: listas de <select>, calendários e
   barras de rolagem nativas passam a abrir escuros (senão viram branco no branco). */
:root { color-scheme: dark; }

* { scrollbar-width: thin; scrollbar-color: #2c2c31 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #2c2c31; border-radius: 99px; }

::selection { background: var(--acento); color: #fff; }

body {
  font-family: var(--fonte-corpo);
  color: var(--texto);
  background-color: var(--fundo);
  background-image:
    radial-gradient(820px 460px at 85% -10%, rgba(224, 27, 36, .10), transparent 60%),
    radial-gradient(700px 480px at -10% 110%, rgba(224, 27, 36, .06), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* espaço para a barra inferior no celular */
body.com-navegacao { padding-bottom: calc(var(--altura-tabbar) + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 992px) { body.com-navegacao { padding-bottom: 0; } }

main.container { flex: 1; max-width: 1080px; }

main h1 {
  font-family: var(--fonte-display);
  font-weight: 800;
  letter-spacing: -.01em;
}

.texto-gradiente {
  background: linear-gradient(120deg, var(--acento-claro), var(--acento-escuro));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

a { color: var(--acento-claro); text-decoration: none; transition: color .18s ease; }
a:hover { color: #fff; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  padding: .6rem 0;
  background: rgba(11, 12, 16, .78);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--borda);
}

.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(224, 27, 36, .7), transparent);
}

.topbar .marca span {
  font-family: var(--fonte-display);
  font-size: 1.05rem;
  letter-spacing: .12em;
  color: var(--texto);
  font-weight: 600;
}

.topbar .marca b { color: var(--acento); }
.topbar .marca img { filter: drop-shadow(0 0 10px rgba(224, 27, 36, .4)); }

.tab-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--texto-suave);
  transition: color .18s ease, background-color .18s ease;
}

.tab-link:hover { color: #fff; background: rgba(255, 255, 255, .07); }

.tab-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--acento-claro), var(--acento));
  box-shadow: var(--brilho-acento);
}

.btn-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--borda-acento);
  background: linear-gradient(135deg, rgba(224, 27, 36, .25), rgba(224, 27, 36, .08));
  color: var(--acento-claro);
  font-weight: 800;
  font-size: 1.05rem;
  display: grid;
  place-items: center;
}

.dropdown-menu {
  background: rgba(18, 19, 24, .95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--borda);
  border-radius: var(--raio-sm);
  box-shadow: var(--sombra);
  overflow: hidden;
  min-width: 230px;
}

.dropdown-header { color: var(--texto-suave); }
.dropdown-item { padding: .6rem 1.1rem; font-weight: 500; color: var(--texto); }
.dropdown-item:hover { background: rgba(224, 27, 36, .12); color: #fff; }
.dropdown-divider { border-color: var(--borda); }

/* ---------- barra inferior (celular) ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1030;
  display: flex;
  height: calc(var(--altura-tabbar) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(13, 14, 18, .92);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--borda);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: none;
  color: var(--texto-suave);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .01em;
  transition: color .15s ease;
}

.tab-item i { font-size: 1.35rem; line-height: 1; }

.tab-item.active { color: var(--acento); }
.tab-item.active i { filter: drop-shadow(0 0 8px rgba(224, 27, 36, .55)); }

/* menu "Mais" */
.menu-mais {
  background: rgba(16, 17, 22, .97);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  border-top: 1px solid var(--borda);
  height: auto !important;
}

.menu-mais .offcanvas-title { font-family: var(--fonte-display); font-weight: 700; }
.menu-mais .btn-close { filter: invert(1); }

.item-mais {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .95rem 1rem;
  margin-bottom: .4rem;
  border-radius: var(--raio-sm);
  background: var(--superficie);
  border: 1px solid var(--borda);
  color: var(--texto);
  font-weight: 600;
}

.item-mais i { color: var(--acento); font-size: 1.2rem; }
.item-mais.texto-perigo, .item-mais.texto-perigo i { color: var(--vermelho); }

/* ---------- rodapé ---------- */
.rodape {
  background: rgba(9, 10, 13, .8);
  color: var(--texto-suave);
  border-top: 1px solid var(--borda);
}

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, var(--superficie-2), var(--superficie));
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: 0 8px 28px -12px rgba(0, 0, 0, .55);
}

.card-header {
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--borda);
}

.card-stat { position: relative; overflow: hidden; }

.card-stat::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--acento-claro), var(--acento-escuro));
  border-radius: 0 4px 4px 0;
}

.card-stat .valor {
  font-family: var(--fonte-display);
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff, var(--acento-claro));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-stat .icone-stat {
  position: absolute;
  right: .9rem; top: .9rem;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(224, 27, 36, .12);
  color: var(--acento);
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(224, 27, 36, .3);
}

/* ---------- hero ---------- */
.hero-panel {
  position: relative;
  border-radius: calc(var(--raio) + 4px);
  padding: 1.6rem 1.4rem;
  background:
    radial-gradient(480px 200px at 90% 0%, rgba(224, 27, 36, .16), transparent 65%),
    linear-gradient(180deg, var(--superficie-2), var(--superficie));
  border: 1px solid var(--borda);
  overflow: hidden;
}

@media (min-width: 768px) { .hero-panel { padding: 2rem 2.2rem; } }

.hero-panel h1 { margin-bottom: .2rem; font-size: clamp(1.5rem, 4vw, 2.1rem); }

.faixa-graduacao {
  display: inline-flex;
  height: 10px;
  width: 120px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--acento) 0 70%, #17181d 70% 100%);
  box-shadow: 0 0 18px rgba(224, 27, 36, .45);
}

/* ---------- botões ---------- */
.btn { border-radius: var(--raio-sm); font-weight: 700; transition: transform .15s ease, box-shadow .2s ease, filter .2s ease; }

.btn-primario, .btn-primario:focus {
  background: linear-gradient(135deg, var(--acento-claro), var(--acento-escuro));
  border: 0;
  color: #fff;
  box-shadow: var(--brilho-acento);
}

.btn-primario:hover {
  background: linear-gradient(135deg, #ffe084, var(--acento));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 14px 44px -8px rgba(224, 27, 36, .6);
}

.btn-primario:active { transform: translateY(0); color: #fff; }
.btn-primario:disabled { color: #fff; opacity: .65; }

.btn-outline-light { border-color: var(--borda); color: var(--texto); }
.btn-outline-light:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }

.btn-outline-danger { border-color: rgba(248, 113, 113, .5); color: var(--vermelho); }
.btn-outline-danger:hover { background: rgba(248, 113, 113, .14); border-color: var(--vermelho); color: #fff; }

.btn-outline-success { border-color: rgba(52, 211, 153, .5); color: var(--verde); }
.btn-outline-success:hover { background: rgba(52, 211, 153, .16); border-color: var(--verde); color: #fff; }

.btn-outline-warning { border-color: rgba(224, 27, 36, .5); color: var(--acento-claro); }
.btn-outline-warning:hover { background: rgba(224, 27, 36, .14); border-color: var(--acento); color: #fff; }

.btn-success { background: #16a34a; border: 0; }

/* ---------- formulários ---------- */
.form-control, .form-select {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--borda);
  border-radius: var(--raio-sm);
  color: var(--texto);
  padding: .65rem .95rem;
  font-size: 1rem;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.form-control:focus, .form-select:focus {
  background: rgba(255, 255, 255, .08);
  border-color: var(--acento);
  box-shadow: 0 0 0 .22rem rgba(224, 27, 36, .2);
  color: #fff;
}

.form-control::placeholder { color: #5d5d66; }
.form-label { font-weight: 600; color: #d6d6dd; }
.form-text { color: var(--texto-suave); }

/* Opções dos seletores sempre legíveis (fundo escuro, texto claro) */
.form-select option {
  background-color: #15161b;
  color: var(--texto);
}

.input-group-text {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--borda);
  color: var(--texto-suave);
}

.form-check-input { background-color: rgba(255,255,255,.1); border-color: var(--borda); }
.form-check-input:checked { background-color: var(--acento); border-color: var(--acento); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(224, 27, 36, .25); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }

/* ---------- tabelas ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: rgba(224, 27, 36, .05); color: var(--texto); }

.table thead th {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--texto-suave);
  border-bottom: 1px solid var(--borda) !important;
  padding: .85rem .75rem;
}

.table td { border-color: rgba(255, 255, 255, .05); padding: .8rem .75rem; }

/* ---------- badges e chips ---------- */
.badge { font-weight: 700; letter-spacing: .02em; border-radius: 999px; padding: .42em .8em; }
.badge.bg-success { background: rgba(52, 211, 153, .16) !important; color: var(--verde); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .35); }
.badge.bg-secondary { background: rgba(255, 255, 255, .08) !important; color: var(--texto-suave); box-shadow: inset 0 0 0 1px var(--borda); }
.badge.text-bg-dark { background: rgba(255, 255, 255, .06) !important; color: var(--texto-suave) !important; }

.chip-nivel {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--borda);
  font-size: .8rem;
  font-weight: 700;
  color: var(--texto);
  white-space: nowrap;
}

.chip-cor {
  width: 14px; height: 14px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
  flex-shrink: 0;
}

.chip-sem-nivel { color: var(--texto-suave); }

/* ---------- alerts ---------- */
.alert {
  border-radius: var(--raio-sm);
  border: 1px solid;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.alert-success { background: rgba(52, 211, 153, .1); border-color: rgba(52, 211, 153, .35); color: #86efac; }
.alert-danger { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .4); color: #fca5a5; }
.alert-warning { background: rgba(224, 27, 36, .1); border-color: rgba(224, 27, 36, .35); color: #fde68a; }
.alert-info { background: rgba(96, 165, 250, .1); border-color: rgba(96, 165, 250, .35); color: #93c5fd; }

/* ---------- progresso ---------- */
.progress { background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; }

.progress-bar {
  background: linear-gradient(90deg, var(--acento-escuro), var(--acento-claro));
  border-radius: 999px;
}

/* ---------- painel: ações rápidas ---------- */
.acao-rapida {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  height: 100%;
  padding: 1.1rem 1rem;
  border-radius: var(--raio);
  background: linear-gradient(180deg, var(--superficie-2), var(--superficie));
  border: 1px solid var(--borda);
  color: var(--texto);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

@media (min-width: 768px) { .acao-rapida { padding: 1.4rem 1.2rem; } }

.acao-rapida:hover, .acao-rapida:active {
  transform: translateY(-3px);
  border-color: var(--borda-acento);
  box-shadow: var(--brilho-acento);
  color: #fff;
}

.acao-rapida i { font-size: 1.7rem; color: var(--acento); line-height: 1.2; }
.acao-rapida .acao-titulo { font-weight: 800; font-size: .98rem; }
.acao-rapida .acao-desc { color: var(--texto-suave); font-size: .8rem; }

/* ---------- primeiros passos ---------- */
.card-primeiros-passos .passo-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .8rem 0;
  border-bottom: 1px dashed var(--borda);
}

.card-primeiros-passos .passo-item:last-child { border-bottom: 0; padding-bottom: 0; }
.card-primeiros-passos .passo-item.feito { opacity: .6; }

.passo-numero {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 800;
  background: rgba(224, 27, 36, .14);
  color: var(--acento);
  box-shadow: inset 0 0 0 1px rgba(224, 27, 36, .35);
}

.passo-item.feito .passo-numero {
  background: rgba(52, 211, 153, .16);
  color: var(--verde);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .35);
}

/* ---------- ranking de alunos ---------- */
.rank-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.rank-item:last-child { border-bottom: 0; padding-bottom: 0; }

.rank-posicao {
  flex-shrink: 0;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 800;
  font-size: .95rem;
  background: rgba(255, 255, 255, .06);
  color: var(--texto-suave);
  box-shadow: inset 0 0 0 1px var(--borda);
}

.rank-item.top1 .rank-posicao { background: linear-gradient(135deg, #ffe084, #d99a06); color: #141002; box-shadow: var(--brilho-acento); }
.rank-item.top2 .rank-posicao { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #111; }
.rank-item.top3 .rank-posicao { background: linear-gradient(135deg, #d9a56b, #92552a); color: #fff; }

.rank-info { min-width: 0; }
.rank-info .nome { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-info small { color: var(--texto-suave); }

/* ---------- formulário de aula em passos ---------- */
.passo-header { display: flex; align-items: center; gap: .7rem; font-weight: 800; font-size: 1rem; }

.passo-badge {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: .9rem;
  background: linear-gradient(135deg, var(--acento-claro), var(--acento-escuro));
  color: #fff;
  box-shadow: var(--brilho-acento);
}

.opcao-video {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  width: 100%;
  height: 100%;
  padding: .9rem 1rem;
  border-radius: var(--raio-sm);
  border: 1px solid var(--borda);
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}

.opcao-video i { font-size: 1.4rem; color: var(--acento); }
.opcao-video small { color: var(--texto-suave); }
.opcao-video:hover { border-color: rgba(255, 255, 255, .25); }

.btn-check:checked + .opcao-video {
  border-color: var(--acento);
  background: rgba(224, 27, 36, .1);
  box-shadow: 0 0 0 .18rem rgba(224, 27, 36, .18);
}

/* seletor de nível no formulário */
.opcao-nivel {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  padding: .7rem .9rem;
  border-radius: var(--raio-sm);
  border: 1px solid var(--borda);
  background: rgba(255, 255, 255, .03);
  cursor: pointer;
  font-weight: 700;
  font-size: .92rem;
  transition: border-color .18s ease, background-color .18s ease;
}

.btn-check:checked + .opcao-nivel {
  border-color: var(--acento);
  background: rgba(224, 27, 36, .1);
  box-shadow: 0 0 0 .18rem rgba(224, 27, 36, .18);
}

/* ---------- dropzone ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 2rem 1.2rem;
  border: 2px dashed rgba(255, 255, 255, .25);
  border-radius: var(--raio);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease;
}

.dropzone:hover, .dropzone:focus, .dropzone.arrastando {
  border-color: var(--acento);
  background: rgba(224, 27, 36, .06);
  outline: none;
}

.dropzone i { font-size: 2.3rem; color: var(--acento); }
.dropzone .dz-texto { color: var(--texto-suave); }
.dropzone .dz-texto b { color: var(--texto); }

.dropzone .dz-arquivo {
  margin-top: .5rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, .13);
  color: var(--verde);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .35);
  font-size: .9rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* ---------- overlay de upload ---------- */
.overlay-upload {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(6, 6, 8, .88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.overlay-upload .overlay-card { width: 100%; max-width: 440px; }

/* ---------- listas do professor ---------- */
.mini-thumb {
  width: 60px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  flex-shrink: 0;
}

.thumb-admin {
  width: 130px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--raio-sm);
  background: #000;
  display: block;
}

@media (max-width: 575px) { .thumb-admin { width: 100%; } }

/* cabeçalho de seção por nível */
.secao-nivel {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin: 1.6rem 0 .8rem;
  font-family: var(--fonte-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.secao-nivel .linha { flex: 1; height: 1px; background: var(--borda); }

/* ---------- cartão de credenciais ---------- */
.card-credenciais {
  border-color: rgba(52, 211, 153, .4);
  box-shadow: 0 0 50px -18px rgba(52, 211, 153, .4);
}

.dado-acesso {
  display: flex;
  flex-direction: column;
  padding: .6rem .9rem;
  border-radius: var(--raio-sm);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--borda);
  overflow-wrap: anywhere;
}

.dado-acesso small { color: var(--texto-suave); text-transform: uppercase; letter-spacing: .08em; font-size: .66rem; }

/* ---------- mensalidades ---------- */
.chip-venc {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.chip-venc.venc-vencida {
  background: rgba(248, 113, 113, .14);
  color: var(--vermelho);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .45);
}

.chip-venc.venc-hoje, .chip-venc.venc-breve {
  background: rgba(250, 204, 21, .12);
  color: #fde047;
  box-shadow: inset 0 0 0 1px rgba(250, 204, 21, .4);
}

.chip-venc.venc-em-dia {
  background: rgba(52, 211, 153, .14);
  color: var(--verde);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .4);
}

.chip-venc.venc-indefinida {
  background: rgba(255, 255, 255, .07);
  color: var(--texto-suave);
  box-shadow: inset 0 0 0 1px var(--borda);
}

/* destaque do painel: mensalidades vencidas */
.card-vencidas {
  border-color: rgba(248, 113, 113, .5);
  box-shadow: 0 0 50px -16px rgba(248, 113, 113, .5);
  animation: pulso-vencida 3s ease-in-out infinite;
}

@keyframes pulso-vencida {
  0%, 100% { box-shadow: 0 0 40px -16px rgba(248, 113, 113, .45); }
  50%      { box-shadow: 0 0 60px -12px rgba(248, 113, 113, .7); }
}

.linha-vencido, .linha-comprovante {
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  padding: .7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.linha-vencido:first-child, .linha-comprovante:first-child { padding-top: 0; }
.linha-vencido:last-child, .linha-comprovante:last-child { border-bottom: 0; padding-bottom: 0; }

/* aluno com mensalidade vencida (lista do professor e cartão do aluno) */
.card-aluno-vencido {
  border-color: rgba(248, 113, 113, .55);
  background: linear-gradient(180deg, rgba(248, 113, 113, .09), var(--superficie));
}

/* comprovantes PIX aguardando o professor */
.card-comprovantes {
  border-color: rgba(52, 211, 153, .4);
  box-shadow: 0 0 50px -18px rgba(52, 211, 153, .4);
}

/* atalho da mensalidade vencida (início do aluno) */
.aula-trilha.trilha-vencida { border-color: rgba(248, 113, 113, .55); }

.aula-trilha.trilha-vencida .numero {
  background: rgba(248, 113, 113, .15);
  color: var(--vermelho);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .45);
}

/* quadro branco do QR Code do PIX (precisa de fundo claro para a câmera ler) */
.quadro-qr {
  width: 230px;
  max-width: 100%;
  padding: 14px;
  border-radius: var(--raio-sm);
  background: #fff;
  box-shadow: 0 0 40px -12px rgba(224, 27, 36, .4);
}

.quadro-qr svg { display: block; width: 100%; height: auto; }

/* estatística de vencidas na página de mensalidades */
.card-stat.stat-vencida::before { background: linear-gradient(180deg, #f87171, #b91c1c); }

.card-stat.stat-vencida .icone-stat {
  background: rgba(248, 113, 113, .14);
  color: var(--vermelho);
  box-shadow: inset 0 0 0 1px rgba(248, 113, 113, .4);
}

/* ---------- trilha do aluno ---------- */
.aula-trilha {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .8rem;
  margin-bottom: .7rem;
  border-radius: var(--raio);
  background: linear-gradient(180deg, var(--superficie-2), var(--superficie));
  border: 1px solid var(--borda);
  color: var(--texto);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

a.aula-trilha:hover { transform: translateY(-2px); border-color: var(--borda-acento); box-shadow: var(--brilho-acento); color: #fff; }

.aula-trilha .numero {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 800;
  background: rgba(224, 27, 36, .14);
  color: var(--acento);
  box-shadow: inset 0 0 0 1px rgba(224, 27, 36, .35);
}

.aula-trilha.assistida .numero {
  background: rgba(52, 211, 153, .16);
  color: var(--verde);
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .4);
}

.aula-trilha .thumb-trilha {
  width: 92px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 10px;
  background: #000;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 576px) { .aula-trilha .thumb-trilha { display: block; } }

.aula-trilha .info { min-width: 0; flex: 1; }
.aula-trilha .titulo-aula { font-weight: 700; line-height: 1.3; }
.aula-trilha small { color: var(--texto-suave); }

.aula-trilha.bloqueada {
  opacity: .55;
  filter: grayscale(.4);
}

.aula-trilha.bloqueada .numero {
  background: rgba(255, 255, 255, .07);
  color: var(--texto-suave);
  box-shadow: inset 0 0 0 1px var(--borda);
}

.aula-trilha .seta { color: var(--texto-suave); font-size: 1.2rem; }

/* ---------- player ---------- */
.player-wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--raio);
  overflow: hidden;
  border: 1px solid var(--borda);
  box-shadow: var(--sombra), 0 0 60px -18px rgba(224, 27, 36, .35);
}

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

/* ---------- página de ajuda ---------- */
.accordion-ajuda .accordion-item {
  background: linear-gradient(180deg, var(--superficie-2), var(--superficie));
  border: 1px solid var(--borda);
  margin-bottom: .7rem;
  border-radius: var(--raio) !important;
  overflow: hidden;
}

.accordion-ajuda .accordion-button {
  background: transparent;
  color: var(--texto);
  font-weight: 700;
  box-shadow: none;
  padding: 1rem 1.2rem;
}

.accordion-ajuda .accordion-button:not(.collapsed) { background: rgba(224, 27, 36, .08); color: #fff; }
.accordion-ajuda .accordion-button::after { filter: invert(1) brightness(1.6); }
.accordion-ajuda .accordion-body { color: #d6d6dd; }

/* ---------- modal ---------- */
.modal-content {
  background: rgba(20, 21, 26, .97);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
}

/* ---------- login ---------- */
.pagina-login {
  position: relative;
  overflow: hidden;
  background: var(--fundo);
  padding: 1rem;
}

.pagina-login::before,
.pagina-login::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  animation: flutuar 14s ease-in-out infinite alternate;
}

.pagina-login::before {
  width: 480px; height: 480px;
  left: -160px; top: -160px;
  background: radial-gradient(circle, rgba(224, 27, 36, .28), transparent 65%);
}

.pagina-login::after {
  width: 420px; height: 420px;
  right: -140px; bottom: -140px;
  background: radial-gradient(circle, rgba(224, 27, 36, .18), transparent 65%);
  animation-delay: -7s;
}

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

.card-login {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  background: rgba(18, 19, 24, .8);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--borda);
  border-radius: 24px;
  box-shadow: var(--sombra), 0 0 80px -20px rgba(224, 27, 36, .35);
}

.card-login::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: 24px 24px 0 0;
  background: linear-gradient(90deg, transparent, var(--acento), transparent);
}

.logo-login { filter: drop-shadow(0 0 22px rgba(224, 27, 36, .5)); }

.titulo-login {
  font-family: var(--fonte-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: .02em;
}

/* ---------- utilidades ---------- */
.secao-titulo {
  font-family: var(--fonte-display);
  font-weight: 700;
  font-size: 1.15rem !important;
}

.breadcrumb-item a { color: var(--texto-suave); }
.breadcrumb-item.active { color: var(--texto); }
.breadcrumb-item + .breadcrumb-item::before { color: #4b4b52; }

/* ============================================================
   EFEITOS — vida, brilho e micro-interações
   ============================================================ */

html { scroll-behavior: smooth; }

/* fundo vivo: orbes de luz vermelha flutuando */
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .5;
  animation: orbita 22s ease-in-out infinite alternate;
  pointer-events: none;
}

body::before {
  width: 560px; height: 560px;
  top: -220px; right: -180px;
  background: radial-gradient(circle, rgba(224, 27, 36, .32), transparent 65%);
}

body::after {
  width: 460px; height: 460px;
  bottom: -200px; left: -160px;
  background: radial-gradient(circle, rgba(224, 27, 36, .2), transparent 65%);
  animation-delay: -11s;
}

@keyframes orbita {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-70px, 60px) scale(1.2); }
}

/* conteúdo entra suavemente, em cascata */
main.container > * {
  animation: entrar .5s cubic-bezier(.2, .7, .3, 1) both;
}

main.container > *:nth-child(2) { animation-delay: .06s; }
main.container > *:nth-child(3) { animation-delay: .12s; }
main.container > *:nth-child(4) { animation-delay: .18s; }
main.container > *:nth-child(5) { animation-delay: .24s; }
main.container > *:nth-child(n+6) { animation-delay: .3s; }

@keyframes entrar {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* cards ganham vida ao passar o dedo/mouse */
.card { transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease; }

.card:hover {
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 14px 40px -14px rgba(0, 0, 0, .7);
}

.card-stat:hover, .card-aula-admin:hover {
  transform: translateY(-3px);
  border-color: var(--borda-acento);
  box-shadow: 0 0 44px -16px rgba(224, 27, 36, .5), var(--sombra);
}

/* título com brilho que percorre o texto
   (o clip PRECISA ser redeclarado aqui: o shorthand background o reseta) */
.texto-gradiente {
  background: linear-gradient(110deg, var(--acento-claro) 20%, #ffb3b6 40%, var(--acento) 60%, var(--acento-claro) 80%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brilho-texto 5s linear infinite;
}

@keyframes brilho-texto {
  to { background-position: -220% center; }
}

/* hero com aura pulsante */
.hero-panel::after {
  content: '';
  position: absolute;
  right: -70px; top: -70px;
  width: 240px; height: 240px;
  background: conic-gradient(from 180deg, rgba(224, 27, 36, .45), transparent 60%);
  filter: blur(52px);
  pointer-events: none;
  animation: pulso-aura 6s ease-in-out infinite;
}

@keyframes pulso-aura {
  0%, 100% { opacity: .55; transform: scale(1); }
  50%      { opacity: 1; transform: scale(1.18); }
}

/* botão principal com faixa de luz que atravessa */
.btn-primario {
  position: relative;
  overflow: hidden;
}

.btn-primario::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: none;
}

.btn-primario:hover::after { animation: varrer 0.8s ease; }

@keyframes varrer {
  to { transform: translateX(120%); }
}

/* barra de progresso com brilho animado */
.progress-bar {
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .4) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: brilho-progresso 2.4s ease-in-out infinite;
}

@keyframes brilho-progresso {
  60%, 100% { transform: translateX(100%); }
}

/* ícones das ações rápidas reagem ao toque */
.acao-rapida i { transition: transform .25s cubic-bezier(.2, .8, .3, 1.4); }
.acao-rapida:hover i, .acao-rapida:active i { transform: scale(1.18) rotate(-4deg); }

/* trilha: número da aula liberada pulsa de leve */
a.aula-trilha:not(.assistida) .numero {
  animation: chamar-atencao 2.8s ease-in-out infinite;
}

@keyframes chamar-atencao {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(224, 27, 36, .35); }
  50%      { box-shadow: inset 0 0 0 1px rgba(224, 27, 36, .8), 0 0 16px rgba(224, 27, 36, .35); }
}

/* 1º lugar do ranking com brilho de troféu */
.rank-item.top1 .rank-posicao { animation: brilho-trofeu 3s ease-in-out infinite; }

@keyframes brilho-trofeu {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 215, 94, .35); }
  50%      { box-shadow: 0 0 26px rgba(255, 215, 94, .75); }
}

/* aba ativa do celular com pontinho indicador */
.tab-item { position: relative; }

.tab-item.active::before {
  content: '';
  position: absolute;
  top: 6px;
  width: 26px; height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--acento-claro), var(--acento));
  box-shadow: 0 0 10px rgba(224, 27, 36, .8);
}

/* logo pulsando de leve no topo */
.topbar .marca img { animation: pulso-logo 5s ease-in-out infinite; }

@keyframes pulso-logo {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(224, 27, 36, .35)); }
  50%      { filter: drop-shadow(0 0 18px rgba(224, 27, 36, .7)); }
}

.logo-login { animation: pulso-logo 4s ease-in-out infinite; }

/* alertas deslizam para dentro */
.alert { animation: entrar .4s ease both; }

/* acabamento fino: luz sutil no topo dos cards e do hero */
.card, .hero-panel { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 28px -12px rgba(0, 0, 0, .55); }
.card-header { font-weight: 700; letter-spacing: .01em; }

/* miniaturas nunca ficam com ícone quebrado (fundo escuro + play) */
.mini-thumb, .thumb-trilha, .thumb-admin {
  background: #101116 url('../img/video-placeholder.svg') center/cover no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
