:root {
  --ink: #221733;
  --bg: #FBF8FD;
  --card: #FFFFFF;
  --purple-900: #1D1230;
  --purple-800: #2A1B4A;
  --purple-700: #3D2170;
  --purple-600: #4E2C8C;
  --magenta: #C13FAE;
  --magenta-dark: #A32F92;
  --muted: #7C7089;
  --line: #EDE7F3;
  --radius: 18px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
h1, h2, h3, h4 { font-family: 'Poppins', 'Inter', sans-serif; margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.cs-btn-primary { background: linear-gradient(135deg, var(--magenta), var(--purple-600)); color: #fff; box-shadow: 0 8px 24px rgba(193,63,174,.35); }
.cs-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(193,63,174,.45); }
.cs-btn-outline { background: transparent; color: var(--purple-700); border: 1.5px solid var(--line); }
.cs-btn-outline:hover { border-color: var(--magenta); color: var(--magenta-dark); }
.cs-btn-ghost-light { background: rgba(255,255,255,.08); color: #fff; border: 1.5px solid rgba(255,255,255,.25); }
.cs-btn-ghost-light:hover { background: rgba(255,255,255,.16); }

/* ============ TOPBAR ============ */
/* O menu (topbar) inteiro - estrutura e cor - agora vem de
   ../../includes/hub_menu.php + ../../assets/css/hub-menu.css
   (compartilhado com a Raiz e a Loja). Isso substituiu o que existia
   aqui antes (inclusive um design mais antigo do menu, com busca e
   dropdown de conta, que não é mais usado em lugar nenhum do site). */

/* ============ HERO ============ */
.cs-hero {
  background: radial-gradient(circle at 15% 20%, #fbe8f6, var(--bg) 65%);
  color: var(--ink);
  padding: 72px 24px 96px;
  position: relative;
  overflow: hidden;
}
.cs-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 15%, rgba(193,63,174,.12), transparent 45%);
  pointer-events: none;
}
.cs-hero-inner {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center;
  position: relative;
}
.cs-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: #f1e9fa; border: 1px solid var(--line); color: var(--purple-700);
  padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  letter-spacing: .02em; margin-bottom: 22px;
}
.cs-hero h1 { font-size: 42px; line-height: 1.15; font-weight: 800; margin-bottom: 18px; color: var(--purple-900); }
.cs-hero h1 span { color: var(--magenta); background: none; -webkit-text-fill-color: initial; }
.cs-hero p.lead { font-size: 16.5px; line-height: 1.6; color: var(--muted); max-width: 480px; margin-bottom: 30px; }
.cs-hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }
.cs-hero-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.cs-hero-stats div strong { display: block; font-size: 22px; font-weight: 800; color: var(--purple-900); }
.cs-hero-stats div span { font-size: 12.5px; color: var(--muted); }

.cs-hero-visual {
  position: relative;
}
.cs-hero-photo {
  width: 100%;
  display: block;
}

/* ============ SEÇÕES ============ */
.cs-section { max-width: 1240px; margin: 0 auto; padding: 70px 24px; }

/* ============ ATALHOS RÁPIDOS (O que você quer fazer hoje?) ============ */
.cs-quicklinks { padding-bottom: 20px; text-align: center; }
.cs-quicklinks .cs-section-head { display: block; text-align: center; margin-bottom: 40px; }
.cs-quicklinks .cs-section-head h2 { font-size: 26px; }
.cs-quicklinks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 24px; max-width: 760px; margin: 0 auto; }
.cs-quicklink { display: flex; flex-direction: column; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.cs-quicklink-icon-img {
  width: 88px; height: 88px; object-fit: contain;
  transition: transform .18s, filter .18s;
  filter: drop-shadow(0 10px 18px rgba(61,33,112,.25));
}
.cs-quicklink:hover .cs-quicklink-icon-img { transform: translateY(-3px); }
.cs-quicklink-label { font-size: 13.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--purple-900); }
.cs-section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 34px; flex-wrap: wrap; }
.cs-eyebrow-sm { font-size: 12.5px; font-weight: 700; color: var(--magenta-dark); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; display: block; }
.cs-section-head h2 { font-size: 28px; font-weight: 800; color: var(--purple-900); }
/* Título "Todos os Cursos"/"Todos os STLs" (todos-cursos.php/todos-stls.php) -
   um pouco menor que o padrão de 28px das outras seções. */
.cs-section-head h2.cs-titulo-catalogo-todos { font-size: 23px; }
.cs-section-head p { color: var(--muted); font-size: 14.5px; margin-top: 6px; max-width: 520px; }

/* ============ TABS DE FILTRO ============ */
.cs-tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.cs-tab {
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-size: 13.5px; font-weight: 600; color: var(--muted);
  cursor: pointer; text-decoration: none; transition: all .15s;
}
.cs-tab.active, .cs-tab:hover { background: var(--purple-700); border-color: var(--purple-700); color: #fff; }

/* ============ GRID DE CARDS ============ */
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 30px; }

/* ============ TIRA "RECENTES" DA HOME - 5 cards (4 itens + "Ver
   todos"), todos do mesmo tamanho ============ */
.cs-grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1000px) { .cs-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .cs-grid-5 { grid-template-columns: repeat(2, 1fr); } }

/* ============ GRID DE 4 - Meus Cursos / Meus STLs (área do aluno) ============ */
.cs-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .cs-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cs-grid-4 { grid-template-columns: repeat(1, 1fr); } }
.cs-card {
  background: var(--card); border: 2px solid #E3D6F0; border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--ink);
  transition: transform .18s, box-shadow .18s, border-color .18s; display: flex; flex-direction: column;
}
.cs-card:hover, .cs-card:focus-within { border-color: var(--magenta); transform: translateY(-4px); box-shadow: 0 16px 34px rgba(61,33,112,.18); }
.cs-card:active { border-color: var(--purple-700); transform: translateY(-1px); }
.cs-card-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--line); }
.cs-card-img.placeholder { display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--purple-600); background: linear-gradient(135deg,#f1e9fa,#fbe8f6); }
.cs-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.cs-badge { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; background: #f1e9fa; color: var(--purple-700); }
.cs-badge.stl { background: #fbe8f6; color: var(--magenta-dark); }
.cs-badge.precificadora { background: #fff3d6; color: #92660a; }

/* Selo "X% OFF no Pix" - aparece do lado de qualquer preço (card do
   catálogo, curso/stl, plano da Precifica 3D, carrinho, checkout)
   quando há desconto Pix configurado (Configurações > Pix, painel
   admin). Mesmo tom de verde já usado no site pra valores de desconto. */
.cs-pix-badge { display: inline-block; background: #e3f7ea; color: #0a8a3f; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.cs-price-pix-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cs-price-pix-stack { display: flex; flex-direction: column; gap: 2px; }
.cs-price-pix-full { color: #0a8a3f; }
.cs-price-pix-original { font-size: 11.5px; color: var(--muted); text-decoration: line-through; }
.cs-card-body h3 { font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.cs-card-body .cs-desc { font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cs-card-price { font-size: 17px; font-weight: 800; color: var(--purple-800); margin-top: 4px; }
.cs-card-price.cs-card-adquirido { font-size: 13.5px; font-weight: 700; color: #1c8a4c; }
.cs-card-price.cs-card-gratuito { color: var(--purple-700); }

/* ============ AÇÕES DO CARD (carrinho / comprar) ============ */
.cs-card-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; flex: 1; }
.cs-card-footer { padding: 0 18px 18px; }
.cs-card-price-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cs-card-price-row .cs-card-price { margin-top: 0; }
.cs-card-actions { display: flex; align-items: center; gap: 6px; }
.cs-card-cart-form, .cs-card-buy-form { margin: 0; }
.cs-card-cart-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line);
  background: #fff; color: var(--purple-700); font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.cs-card-cart-btn:hover { border-color: var(--magenta); color: var(--magenta-dark); background: #fbe8f6; }
.cs-card-buy-btn {
  padding: 8px 16px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, var(--magenta), var(--purple-600));
  transition: transform .15s, box-shadow .15s;
}
.cs-card-buy-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(193,63,174,.35); }

/* ============ CARD DE CURSO/STL - VISUAL v2 (topo em gradiente,
   preço + botão redondo com seta) ============ */
.cs-card-v2 .cs-card-media { position: relative; aspect-ratio: 16/11; overflow: hidden; }
.cs-card-v2 .cs-card-img { width: 100%; height: 100%; object-fit: cover; }
.cs-card-v2 .cs-card-img.placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 26px; color: rgba(255,255,255,.5);
  background: linear-gradient(155deg, #cfa3d6 0%, #8a4fae 55%, #6a3596 100%);
}
.cs-card-v2 .cs-card-type-chip {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  background: rgba(255,255,255,.85); color: var(--purple-700);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 999px;
}
.cs-card-v2 .cs-card-body { gap: 6px; }
.cs-card-v2 .cs-card-body h3 { font-size: 15px; font-weight: 800; }
.cs-card-v2 .cs-card-price { font-size: 16.5px; }
.cs-card-arrow-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, var(--magenta), var(--purple-600)); color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center; transition: transform .15s, box-shadow .15s;
}
.cs-card-arrow-btn:hover { transform: translateY(-2px) scale(1.06); box-shadow: 0 10px 20px rgba(193,63,174,.4); }

/* ============ CARD "VER TODOS" (último item do grid de recentes) ============ */
.cs-card-more {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 30px 20px; text-align: center; min-height: 220px;
  border: none; background: linear-gradient(160deg, var(--magenta) 0%, var(--purple-700) 100%);
}
.cs-card-more:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(61,33,112,.28); }
.cs-card-more-sparkle {
  width: 54px; height: 54px; background: #fff;
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
}
.cs-card-more-label { font-size: 13.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #fff; }

.cs-empty { padding: 50px 20px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 20px; }

/* ============ PAGINAÇÃO ============ */
.cs-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 34px; flex-wrap: wrap; }
.cs-page-link, .cs-page-arrow {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 700;
  text-decoration: none; transition: all .15s;
}
.cs-page-link:hover, .cs-page-arrow:hover { border-color: var(--purple-700); color: var(--purple-700); }
.cs-page-link.active { background: var(--purple-700); border-color: var(--purple-700); color: #fff; }
.cs-page-arrow.disabled { opacity: .35; pointer-events: none; }

/* ============ POR QUE ESTUDAR ============ */
.cs-why { background: var(--card); color: var(--ink); }
.cs-why .cs-section-head h2 { color: var(--purple-900); }
.cs-why .cs-section-head p { color: var(--muted); }
.cs-why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; margin-top: 30px; }
.cs-why-card {
  background: linear-gradient(135deg, var(--purple-700), var(--purple-900));
  border: none; border-radius: var(--radius); padding: 24px; color: #fff;
}
.cs-why-card .cs-why-icon { font-size: 26px; margin-bottom: 12px; }
.cs-why-card h3 { font-size: 15.5px; margin-bottom: 6px; color: #fff; }
.cs-why-card p { font-size: 13px; color: rgba(255,255,255,.75); line-height: 1.55; margin: 0; }

/* ============ CTA FINAL ============ */
.cs-cta-final {
  max-width: 1240px; margin: 60px auto 70px; padding: 46px 40px;
  background: linear-gradient(135deg, var(--magenta), var(--purple-700));
  border-radius: 24px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cs-cta-final h2 { font-size: 24px; margin-bottom: 6px; }
.cs-cta-final p { margin: 0; color: rgba(255,255,255,.85); font-size: 14px; }

/* ============ PROMO PRECIFICA 3D ============ */
.cs-precifica-promo { max-width: 1240px; margin: 20px auto 70px; padding: 0 24px; }
.cs-precifica-promo-inner {
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 30px; align-items: center;
  background: linear-gradient(135deg, #F6B708 0%, #F2D5F4 100%);
  border-radius: 26px; padding: 44px 46px; text-decoration: none; color: var(--purple-900);
  position: relative; overflow: hidden;
}
.cs-precifica-promo-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--purple-800); margin-bottom: 10px; }
.cs-precifica-promo-inner h2 { font-size: 34px; font-weight: 800; line-height: 1.1; margin-bottom: 8px; color: var(--purple-900); }
.cs-precifica-promo-inner p.lead { font-size: 15px; font-weight: 600; color: var(--purple-800); margin-bottom: 24px; }
.cs-precifica-promo-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 20px; }
.cs-precifica-feat { display: flex; align-items: center; gap: 10px; }
.cs-precifica-feat-icon {
  width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.55);
  color: var(--purple-800); font-size: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cs-precifica-feat span { font-size: 12.5px; font-weight: 700; color: var(--purple-900); line-height: 1.25; }
.cs-precifica-promo-visual { position: relative; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.cs-precifica-promo-photo { width: 100%; max-width: 420px; object-fit: contain; }
.cs-precifica-promo-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 26px;
  background: var(--purple-900); color: #fff; font-weight: 800; font-size: 13.5px;
  padding: 12px 26px; border-radius: 999px;
}
@media (max-width: 860px) {
  .cs-precifica-promo-inner { grid-template-columns: 1fr; }
  .cs-precifica-promo-visual { order: -1; }
  .cs-precifica-promo-feats { grid-template-columns: 1fr 1fr; }
}

/* ============ FOOTER ============ */
.cs-footer { background: var(--purple-900); color: rgba(255,255,255,.75); padding: 54px 24px 0; }
.cs-footer-inner { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.1); }
.cs-footer-brand p { font-size: 13px; line-height: 1.6; margin-top: 12px; color: rgba(255,255,255,.6); max-width: 280px; }
.cs-footer-col h4 { font-size: 13px; color: #fff; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .04em; }
.cs-footer-col a { display: block; font-size: 13.5px; color: rgba(255,255,255,.65); text-decoration: none; margin-bottom: 10px; }
.cs-footer-col a:hover { color: #fff; }
.cs-footer-bottom { max-width: 1240px; margin: 0 auto; padding: 20px 0; font-size: 12.5px; color: rgba(255,255,255,.45); }

@media (max-width: 900px) {
  .cs-hero-inner { grid-template-columns: 1fr; }
  .cs-nav, .cs-search { display: none; }
  .cs-footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .cs-hero h1 { font-size: 30px; }
  .cs-footer-inner { grid-template-columns: 1fr; }
}

/* ============================================================
   PÁGINA DE DETALHE (curso.php / stl.php)
============================================================ */
.cs-breadcrumb { max-width: 1240px; margin: 0 auto; padding: 18px 24px 0; font-size: 13px; color: var(--muted); }
.cs-breadcrumb a { color: var(--purple-700); text-decoration: none; }

.cs-detail { max-width: 1240px; margin: 0 auto; padding: 24px 24px 70px; display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 40px; align-items: start; }
.cs-detail-main img.cs-detail-cover { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--radius); background: var(--line); margin-bottom: 26px; }
.cs-detail-main .cs-detail-cover.placeholder { display: flex; align-items: center; justify-content: center; font-size: 60px; }
.cs-detail-stats { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0 24px; }
.cs-detail-stats div { font-size: 13px; color: var(--muted); }
.cs-detail-stats strong { display: block; font-size: 16px; color: var(--purple-800); font-weight: 800; }
.cs-detail-main h1 { font-size: 30px; font-weight: 800; color: var(--purple-900); margin-bottom: 10px; }
.cs-detail-main .cs-detail-desc { font-size: 15px; line-height: 1.7; color: var(--ink); white-space: pre-line; overflow-wrap: break-word; word-break: break-word; }
.cs-detail-main h2.cs-block-title { font-size: 19px; font-weight: 800; margin: 34px 0 16px; color: var(--purple-900); }

.cs-modulo { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; overflow: hidden; background: #fff; }
.cs-modulo-head { padding: 14px 18px; font-weight: 700; font-size: 14.5px; background: #f6f1fb; color: var(--purple-800); }
.cs-modulo-aulas { padding: 6px 18px 14px; }
.cs-aula-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.cs-aula-item:last-child { border-bottom: none; }
.cs-aula-item .cs-aula-icon { color: var(--muted); }
.cs-aula-item a { color: var(--purple-700); text-decoration: none; font-weight: 600; }
.cs-aula-item a:hover { text-decoration: underline; }
.cs-aula-item-btn {
  width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--line);
  cursor: pointer; text-align: left; font-family: inherit; border-radius: 8px;
  padding: 9px 8px; margin: 0 -8px; transition: background .15s;
}
.cs-aula-item-btn:last-child { border-bottom: none; }
.cs-aula-item-btn:hover { background: #f6f1fb; }
.cs-aula-item-btn span:nth-child(2) { color: var(--purple-700); font-weight: 600; font-size: 13.5px; flex: 1; }
.cs-aula-icon.assistida { color: #1c8a4c; font-weight: 800; }
.cs-aula-status { font-size: 11.5px; font-weight: 700; color: #1c8a4c; margin-left: auto; flex-shrink: 0; }
.cs-aula-anexos { margin: 4px 0 0 26px; display: flex; flex-direction: column; gap: 3px; }
.cs-aula-anexos a { font-size: 12.5px; color: var(--magenta-dark); text-decoration: none; overflow-wrap: break-word; word-break: break-word; }
.cs-aula-anexos a:hover { text-decoration: underline; }
.cs-aula-item a, .cs-aula-item span { overflow-wrap: break-word; word-break: break-word; }

.cs-arquivos-lista { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.cs-arquivo-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; font-size: 13.5px; }
.cs-arquivo-item { flex-wrap: wrap; }
.cs-arquivo-item span { overflow-wrap: break-word; word-break: break-word; }
.cs-arquivo-item a { color: var(--purple-700); font-weight: 700; text-decoration: none; overflow-wrap: break-word; word-break: break-word; }
.cs-arquivo-item a:hover { text-decoration: underline; }

.cs-buy-box { position: sticky; top: 90px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.cs-buy-box .cs-price { font-size: 30px; font-weight: 800; color: var(--purple-900); margin-bottom: 4px; }
.cs-buy-box .cs-price-note { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; }
.cs-buy-box .cs-btn { width: 100%; margin-bottom: 10px; padding: 14px; font-size: 15px; }
.cs-buy-box ul { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cs-buy-box ul li { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.cs-owned-badge { background: #e9f9ee; color: #1c8a4c; border: 1px solid #bfe9cf; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; text-align: center; margin-bottom: 14px; }

/* ============ CERTIFICADO DE CONCLUSÃO (bloco na página do curso) ============ */
.cs-cert-box { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
.cs-cert-btn { width: 100%; }
.cs-cert-btn:disabled { opacity: .5; cursor: not-allowed; }
.cs-cert-note { font-size: 12px; color: var(--muted); text-align: center; margin: 10px 0 0; line-height: 1.5; }

/* ============ MODAL DE AULA (assistir vídeo) ============ */
.cs-aula-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(29,18,48,.72);
  z-index: 200; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.cs-aula-modal-overlay.open { display: flex; }
.cs-aula-modal {
  background: #17102A; border-radius: 18px; width: 100%; max-width: 980px;
  max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.cs-aula-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.cs-aula-modal-head .cs-eyebrow-sm { color: var(--magenta); }
.cs-aula-modal-head h3 { font-size: 19px; font-weight: 800; color: #fff; margin-top: 4px; }
.cs-aula-modal-meta-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: 12.5px; color: rgba(255,255,255,.6); margin: 8px 0 0;
}
.cs-aula-modal-meta-line .sep { color: rgba(255,255,255,.25); }
.cs-aula-modal-meta-line #csAulaModalModulo { color: var(--magenta); font-weight: 600; }
.cs-aula-modal-close {
  width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06);
  font-size: 15px; cursor: pointer; flex-shrink: 0; color: rgba(255,255,255,.75);
}
.cs-aula-modal-close:hover { border-color: var(--magenta); color: var(--magenta); }
.cs-aula-modal-body { display: block; }
.cs-aula-modal-video-col { display: flex; flex-direction: column; background: #000; }
.cs-aula-modal-video { background: #000; aspect-ratio: 16/9; max-height: 56vh; }

/* Vídeo de apresentação da Precifica 3D (cursos/precifica3d.php),
   exibido direto na página (sem modal) entre a promo e os planos. */
.cs-precifica-video { background: #000; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(61,33,112,.18); }
.cs-precifica-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.cs-aula-modal-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.cs-aula-modal-video-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: linear-gradient(90deg, var(--purple-900), var(--purple-700));
}
.cs-aula-modal-video-brand {
  display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.8); font-size: 12px; font-weight: 600;
}
.cs-aula-modal-video-brand img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.cs-aula-modal-video-link {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25);
  padding: 7px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  transition: background .15s;
}
.cs-aula-modal-video-link:hover { background: var(--magenta); border-color: var(--magenta); }
.cs-aula-modal-anexos-full {
  display: none; padding: 14px 24px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.cs-aula-modal-anexos-full p.muted { font-size: 12.5px; color: rgba(255,255,255,.5); margin: 0 0 8px; }
.cs-aula-modal-anexos-full a { color: var(--magenta); font-weight: 600; text-decoration: none; }
.cs-aula-modal-anexos-full a:hover { color: #fff; }
.cs-aula-modal-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 24px; border-top: 1px solid rgba(255,255,255,.1); flex-wrap: wrap;
  background: #17102A;
}
.cs-aula-modal-foot .cs-btn { width: auto; padding: 11px 20px; font-size: 13.5px; margin: 0; }
.cs-aula-modal-foot .cs-btn:disabled { opacity: .45; cursor: not-allowed; }
.cs-aula-modal-foot .cs-btn-outline {
  background: transparent; color: #fff; border-color: rgba(255,255,255,.25);
}
.cs-aula-modal-foot .cs-btn-outline:hover { border-color: var(--magenta); color: var(--magenta); }
@media (max-width: 720px) {
  .cs-aula-modal-meta-line { font-size: 11.5px; }
  .cs-aula-modal-foot { justify-content: center; }
}

@media (max-width: 900px) {
  .cs-detail { grid-template-columns: 1fr; }
  .cs-buy-box { position: static; }
}

/* ============================================================
   CARRINHO
============================================================ */
.cs-page-wrap { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; }
.cs-page-wrap h1 { font-size: 26px; font-weight: 800; color: var(--purple-900); margin-bottom: 24px; }
.cs-cart-item { display: flex; align-items: center; gap: 16px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.cs-cart-item-info { min-width: 120px; }
.cs-cart-item-info h3 { overflow-wrap: break-word; word-break: break-word; }
.cs-cart-item img, .cs-cart-item .placeholder-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--line); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.cs-cart-item-info { flex: 1; }
.cs-cart-item-info .cs-badge { margin-bottom: 4px; }
.cs-cart-item-info h3 { font-size: 14.5px; font-weight: 700; }
.cs-cart-item-price { font-weight: 800; color: var(--purple-800); font-size: 15px; }
.cs-cart-remove { background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; line-height: 1; padding: 4px; }
.cs-cart-remove:hover { color: #d6412f; }
.cs-cart-summary { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cs-cart-summary .cs-total { font-size: 22px; font-weight: 800; color: var(--purple-900); }

/* ============================================================
   CHECKOUT (identificação + pagamento)
============================================================ */
.cs-checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: start; max-width: 1080px; margin: 0 auto; padding: 34px 24px 80px; }
.cs-step-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; margin-bottom: 20px; }
.cs-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cs-step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--purple-700); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.cs-step-head h2 { font-size: 18px; font-weight: 800; color: var(--purple-900); }
.cs-step-sub { font-size: 13px; color: var(--muted); margin: 0 0 20px 40px; }

.cs-identify-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.cs-identify-tab {
  flex: 1; display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fbfaff;
  font-size: 13.5px; font-weight: 700; color: var(--ink); transition: all .15s;
}
.cs-identify-tab .cs-tab-icon { font-size: 18px; }
.cs-identify-tab span.sub { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.cs-identify-tab.active { border-color: var(--purple-700); background: #f1e9fa; box-shadow: 0 0 0 3px rgba(78,44,140,.12); }

.cs-form-group { margin-bottom: 15px; }
.cs-form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.cs-form-group .opt { font-weight: 400; color: var(--muted); }
.cs-form-group input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fbfaff; outline: none; box-sizing: border-box;
}
.cs-form-group input:focus { border-color: var(--purple-700); background: #fff; }
.cs-form-row { display: flex; gap: 12px; }
.cs-form-row .cs-form-group { flex: 1; }
.cs-checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--muted); margin: 14px 0 18px; }
.cs-checkbox-row a { color: var(--purple-700); font-weight: 700; text-decoration: none; }
.cs-checkbox-row a:hover { text-decoration: underline; }
.cs-form-error { background: #fdeceb; color: #b3261e; border: 1px solid #f6cdd0; padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.cs-form-success { background: #eaf7ee; color: #1e7d3a; border: 1px solid #c9ecd4; padding: 11px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 16px; }
.cs-forgot-link { color: var(--purple-700); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.cs-forgot-link:hover { text-decoration: underline; }
.cs-logged-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f1e9fa; border-radius: 12px; padding: 14px 18px; font-size: 14px; }
.cs-logged-box a { font-size: 12.5px; color: var(--purple-700); }

.cs-pay-option { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px solid var(--purple-700); background: #f9f6fd; border-radius: 12px; }
.cs-pay-option .cs-pay-icon { font-size: 24px; }
.cs-pay-option strong { display: block; font-size: 14.5px; }
.cs-pay-option span { font-size: 12.5px; color: var(--muted); }

/* Escolha Crédito/Débito antes do formulário do cartão */
.cs-cartao-tipo-wrap { padding: 14px 16px; border: 1.5px dashed var(--line); border-radius: 12px; background: #faf8fd; }
.cs-cartao-tipo-opcoes { display: flex; gap: 10px; flex-wrap: wrap; }
.cs-cartao-tipo-btn {
  flex: 1; min-width: 140px; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
  font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; transition: all .15s;
}
.cs-cartao-tipo-btn:hover { border-color: var(--purple-700); }
.cs-cartao-tipo-btn.active { border-color: var(--purple-700); background: var(--purple-700); color: #fff; }

.cs-resumo { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: sticky; top: 90px; }
.cs-resumo h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 16px; }
.cs-resumo-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cs-resumo-item > span:first-child { overflow-wrap: break-word; word-break: break-word; }
.cs-resumo-item > span:last-child { white-space: nowrap; flex-shrink: 0; }
.cs-item-tipo { color: var(--muted); font-weight: 600; }
.cs-resumo-item-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cs-resumo-item-img { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); }
.cs-resumo-item-img.placeholder { display: flex; align-items: center; justify-content: center; background: var(--bg); font-size: 16px; }
.cs-resumo-total { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.cs-resumo-total strong { font-size: 21px; color: var(--purple-900); }
.cs-resumo .cs-btn { width: 100%; margin-top: 18px; }

@media (max-width: 860px) {
  .cs-checkout-grid { grid-template-columns: 1fr; }
  .cs-resumo { position: static; }
  .cs-form-row { flex-direction: column; }
}

/* ============================================================
   CONFIRMAÇÃO / PIX
============================================================ */
.cs-confirm-status { text-align: center; padding: 10px 0 26px; }
.cs-confirm-status .cs-status-icon { font-size: 44px; margin-bottom: 10px; }
.cs-confirm-status h1 { font-size: 22px; font-weight: 800; color: var(--purple-900); margin-bottom: 6px; }
.cs-confirm-status p { color: var(--muted); font-size: 14px; }
.cs-confirm-status .cs-codigo { font-family: monospace; background: var(--line); padding: 3px 9px; border-radius: 6px; font-size: 13px; }

.cs-pix-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-align: center; }
.cs-pix-box #csPixQr { display: flex; justify-content: center; margin: 10px 0 18px; }
.cs-pix-copia { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.cs-pix-copia input { flex: 1; min-width: 0; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 12px; background: #fbfaff; }
.cs-pix-valor { font-size: 26px; font-weight: 800; color: var(--purple-900); margin-bottom: 4px; }

.cs-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.cs-status-badge.pendente, .cs-status-badge.aguardando_confirmacao { background: #fff4de; color: #b8860b; }
.cs-status-badge.pago, .cs-status-badge.entregue { background: #e9f9ee; color: #1c8a4c; }
.cs-status-badge.cancelado { background: #fdeceb; color: #b3261e; }
.cs-status-badge.em_producao { background: #eef2ff; color: #4338ca; }
.cs-status-badge.enviado { background: #e8f0fe; color: #1a56db; }

/* Aviso "Novas mensagens" nos cards de Conteúdos recentes da Área do
   Aluno - só aparece quando a Camada respondeu e o aluno ainda não viu.
   Fica na mesma linha de foto/nome/% (flex-shrink:0 pra não espremer o
   nome, mas sem quebrar linha). */
.cs-recent-msg-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff4e9;
    color: #f38530;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
}
.cs-recent-msg-badge i { font-size: 13px; }
.cs-recent-msg-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f38530;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

/* ============================================================
   ÁREA DO ALUNO - DASHBOARD
============================================================ */
.cs-dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.cs-dash-head h1 { font-size: 28px; font-weight: 800; color: var(--purple-900); }
.cs-dash-head p { color: var(--muted); font-size: 14px; margin: 4px 0 0; }

.cs-dash-welcome {
  background: radial-gradient(circle at 20% 20%, var(--purple-700), var(--purple-900) 70%);
  color: #fff; border-radius: var(--radius); padding: 26px 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.cs-dash-welcome .cs-eyebrow-sm { color: var(--magenta); }
.cs-dash-welcome h2 { font-size: 21px; margin-top: 4px; }
.cs-dash-welcome p { font-size: 13.5px; color: rgba(255,255,255,.75); margin: 6px 0 0; }

.cs-dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.cs-dash-stat {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); transition: box-shadow .15s;
}
.cs-dash-stat:hover { box-shadow: 0 10px 24px rgba(61,33,112,.1); }
.cs-dash-stat.active { border-color: var(--purple-700); background: #f6f1fb; }
.cs-dash-stat .cs-dash-icon {
  width: 42px; height: 42px; border-radius: 12px; background: #f1e9fa; color: var(--purple-700);
  display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0;
}
.cs-dash-stat strong { display: block; font-size: 21px; font-weight: 800; }
.cs-dash-stat span { font-size: 12px; color: var(--muted); }

.cs-recent-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; text-decoration: none; color: var(--ink);
  flex-wrap: wrap;
}
.cs-recent-item img, .cs-recent-item .placeholder-thumb {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.cs-recent-item-info { flex: 1; min-width: 140px; }
.cs-recent-item-info span.cs-eyebrow-sm { margin: 0 0 2px; }
.cs-recent-item-info h3 { font-size: 14px; font-weight: 700; margin: 0; overflow-wrap: break-word; word-break: break-word; }

@media (max-width: 640px) {
  .cs-dash-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============ BARRA DE PROGRESSO (% de aulas assistidas) ============ */
.cs-progress-mini { display: flex; flex-direction: column; gap: 5px; min-width: 130px; }
.cs-progress-mini-top { font-size: 11.5px; font-weight: 700; color: var(--purple-700); }
.cs-progress-track { width: 100%; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cs-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--magenta), var(--purple-700)); }

/* ============ BARRA DE PROGRESSO "pill" (curso.php) ============
   Mesma linguagem visual da opção verde do live-poll-card: pill
   arredondada com borda verde e um preenchimento verde-claro que cresce
   por baixo do texto - a % começa em 0 e anima até o valor real toda
   vez que a página carrega (ver csAnimarProgresso em curso.php). */
.cs-progress-pill {
  position: relative;
  min-width: 190px;
  height: 40px;
  border-radius: 14px;
  border: 1.5px solid #22c55e;
  background: #fff;
  overflow: hidden;
}
.cs-progress-pill-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #dcf7e3;
}
.cs-progress-pill-row {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
}
.cs-progress-pill-mark {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 9px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.cs-progress-pill-label { font-size: 12px; font-weight: 700; color: #15803d; white-space: nowrap; }
.cs-progress-pill-pct { font-size: 13.5px; font-weight: 800; color: #15151f; }

/* ============ ÁREA DO ALUNO - MENU LATERAL ============ */
.cs-aluno-shell {
  max-width: 1200px; margin: 0 auto; padding: 40px 24px 80px;
  display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start;
}
.cs-aluno-content { min-width: 0; }
.cs-aluno-sidebar {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: sticky; top: 90px;
}
.cs-aluno-sidebar-head { padding-bottom: 16px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.cs-aluno-sidebar-head strong { display: block; font-size: 15px; color: var(--purple-900); }
.cs-aluno-sidebar-head span { font-size: 12px; color: var(--muted); }
.cs-aluno-nav { display: flex; flex-direction: column; gap: 3px; }
.cs-aluno-nav a {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px;
  text-decoration: none; color: var(--ink); font-size: 13.5px; font-weight: 600; transition: background .15s, color .15s;
}
.cs-aluno-nav a i { width: 16px; text-align: center; color: var(--muted); }
.cs-aluno-nav a:hover { background: #f6f1fb; }
.cs-aluno-nav a.active { background: linear-gradient(135deg, var(--magenta), var(--purple-700)); color: #fff; }
.cs-aluno-nav a.active i { color: #fff; }
.cs-aluno-nav-em-breve { color: var(--muted) !important; justify-content: flex-start; }
.cs-aluno-nav-em-breve .cs-nav-badge { margin-left: auto; }
.cs-aluno-nav-sair {
  margin-top: 10px; padding-top: 14px !important; border-top: 1px solid var(--line); border-radius: 0 !important;
  color: #d6412f !important;
}
.cs-aluno-nav-sair i { color: #d6412f !important; }
.cs-aluno-nav-sair:hover { background: #fdeceb !important; }

/* A partir de 1024px, o menu lateral fica travado na tela (position:fixed)
   e só o conteúdo da direita rola - mesmo comportamento já usado na
   Precificadora (cursos/precificadora.php). Abaixo de 1024px mantém o
   "sticky" simples de cima (acompanha até acabar o bloco), que já é
   suficiente pra telas menores. */
@media (min-width: 1024px) {
  .cs-aluno-shell { display: block; }
  .cs-aluno-sidebar {
    position: fixed;
    top: calc(var(--cs-header-h, 72px) + 24px);
    left: max(24px, calc((100vw - 1200px) / 2 + 24px));
    width: 240px;
    max-height: calc(100vh - var(--cs-header-h, 72px) - 44px);
    overflow-y: auto;
    z-index: 60;
  }
  .cs-aluno-content { margin-left: 268px; }
  /* O menu fixo (z-index:60) flutuaria por cima do rodapé no fim da
     página - z-index maior no rodapé garante que ele cubra naturalmente
     a parte de baixo do menu, sem precisar de JS pra "destravar" o fixed. */
  footer { position: relative; z-index: 120; }
}

@media (max-width: 860px) {
  .cs-aluno-shell { grid-template-columns: 1fr; }
  .cs-aluno-sidebar { position: static; }
}

/* ============================================================
   PÁGINAS LEGAIS (termos.php / politica.php) - menu lateral fixo
   com os tópicos, igual ao layout de referência hugocursos.com.br/termos
============================================================ */
.cs-legal-wrap {
  max-width: 1180px; margin: 0 auto; padding: 24px 24px 40px;
  display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: stretch;
  /* Altura fixa (viewport menos a topbar fixa, ~90px) - é isso que
     permite o menu e o conteúdo terem CADA UM a própria rolagem
     interna (ver overflow-y:auto abaixo), em vez de rolar a página
     inteira. Rolar em cima do menu não mexe no conteúdo e vice-versa. */
  height: calc(100vh - 90px);
}
.cs-legal-nav { position: static; height: 100%; min-height: 0; }
.cs-legal-nav-inner {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 18px; height: 100%; overflow-y: auto;
}
.cs-legal-nav-inner nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.cs-legal-nav-inner nav a {
  display: block; padding: 8px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  text-decoration: none; line-height: 1.4; transition: background .15s, color .15s;
}
.cs-legal-nav-inner nav a:hover { background: #f6f1fb; color: var(--purple-700); }
.cs-legal-nav-cross {
  display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 10px 0;
  border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 700;
  color: var(--purple-700); text-decoration: none;
}
.cs-legal-nav-cross:hover { color: var(--magenta-dark); }

.cs-legal-content {
  min-width: 0; height: 100%; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 38px;
}
.cs-legal-content h1 { font-size: 26px; font-weight: 800; color: var(--purple-900); margin-bottom: 18px; }
.cs-legal-intro { font-size: 14px; line-height: 1.7; color: var(--muted); margin: 0 0 14px; }
.cs-legal-section { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.cs-legal-section:first-of-type { margin-top: 26px; }
.cs-legal-section h2 { font-size: 17px; font-weight: 800; color: var(--purple-900); margin-bottom: 10px; }
.cs-legal-section p { font-size: 14px; line-height: 1.75; color: var(--ink); margin: 0 0 12px; }
.cs-legal-section p:last-child { margin-bottom: 0; }
.cs-legal-list { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.cs-legal-list li { font-size: 14px; line-height: 1.65; color: var(--ink); }
.cs-legal-contact { list-style: none; margin: 0 0 12px; padding: 16px 18px; background: #faf8fd; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 6px; }
.cs-legal-contact li { font-size: 13.5px; color: var(--ink); }
.cs-legal-contact a { color: var(--purple-700); font-weight: 700; text-decoration: none; }
.cs-legal-contact a:hover { text-decoration: underline; }

@media (max-width: 900px) {
  /* Em telas pequenas o layout de duas colunas com rolagem
     independente não cabe bem - volta pro modelo simples de uma
     coluna só, com a página inteira rolando normalmente. */
  .cs-legal-wrap { grid-template-columns: 1fr; height: auto; }
  .cs-legal-nav { position: static; height: auto; }
  .cs-legal-nav-inner { height: auto; max-height: none; overflow: visible; }
  .cs-legal-content { height: auto; overflow: visible; padding: 26px 22px; }
}

/* ============================================================
   CHAT DE DÚVIDAS / COMENTÁRIOS (curso.php e stl.php)
   Fica dentro de .cs-detail-side, embaixo do .cs-buy-box.
============================================================ */
.cs-detail-side { display: flex; flex-direction: column; gap: 24px; }

.cs-chat-box {
  background: #fff;
  border: 1px solid #d9d2ec;
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  position: relative;
  overflow: hidden;
}
.cs-chat-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f7b46a, #f38530);
}
.cs-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cs-chat-head h3 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; color: var(--purple-900); }
.cs-chat-head h3 i { color: #f38530; }
.cs-chat-badge {
  background: linear-gradient(135deg, #f7b46a, #f38530);
  color: #fff;
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 8px;
}
.cs-chat-toggle {
  display: flex; align-items: center; gap: 6px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.cs-chat-toggle:hover { border-color: #f38530; color: #f38530; }
.cs-chat-toggle i { font-size: 10px; }

.cs-chat-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
  margin-bottom: 14px;
}
.cs-chat-vazio { font-size: 13px; color: var(--muted); text-align: center; padding: 18px 0; }

.cs-chat-msg { display: flex; gap: 10px; }
.cs-chat-avatar {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 14px;
}
.cs-chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cs-chat-avatar-admin { background: #fff4e9; border: 2px solid #f3a653; color: #f38530; }
.cs-chat-avatar-aluno { background: var(--bg); border: 2px solid #c7c0dc; color: var(--muted); }
.cs-chat-msg-admin .cs-chat-avatar { width: 30px; height: 30px; }

/* Pergunta (aluno) e resposta (admin) usam o mesmo contorno/fundo -
   só a resposta é um pouco menor (avatar, espaçamento e texto), pra
   diferenciar visualmente sem parecer um bloco totalmente à parte.
   Contorno mais forte que var(--line) de propósito - com a linha
   clara padrão do site, o balão quase não aparecia. */
.cs-chat-bubble {
  flex: 1;
  min-width: 0;
  background: #fafbfc;
  border: 1.5px solid #c7c0dc;
  border-radius: 12px;
  padding: 10px 12px;
}
.cs-chat-msg-admin .cs-chat-bubble { padding: 8px 12px; }
.cs-chat-msg-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.cs-chat-msg-meta strong { font-size: 12.5px; font-weight: 700; color: var(--purple-900); }
.cs-chat-msg-admin .cs-chat-msg-meta strong { font-size: 12px; }
.cs-chat-time { font-size: 10.5px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.cs-chat-bubble p { font-size: 13.5px; line-height: 1.5; color: var(--ink); margin: 0; word-break: break-word; }
.cs-chat-msg-admin .cs-chat-bubble p { font-size: 12.5px; }

.cs-chat-input { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.cs-chat-input-avatar {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); border: 2px solid #c7c0dc;
  display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px;
}
.cs-chat-input-wrap {
  flex: 1; min-width: 0;
  background: var(--bg);
  border: 1.5px solid #c7c0dc;
  border-radius: 999px;
  padding: 4px 6px 4px 14px;
}
.cs-chat-input-wrap input {
  width: 100%; border: none; background: none; outline: none;
  font-size: 13.5px; font-family: inherit; color: var(--ink); padding: 7px 0;
}
.cs-chat-send {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #f7b46a, #f38530);
  color: #fff; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
}
.cs-chat-send:disabled { opacity: .6; cursor: default; }

@media (max-width: 900px) {
  .cs-chat-box { padding: 16px 16px 14px; }
  .cs-chat-list { max-height: 320px; }
}
