:root{
  --bg:#12162B; --bg-alt:#171C38; --surface:#20264A; --surface-2:#262d57;
  --line: rgba(244,241,232,0.10); --text:#F4F1E8; --text-muted:#9AA3C7;
  --amber:#F2A93C; --amber-soft: rgba(242,169,60,0.14);
  --violet:#8D7FE0; --violet-soft: rgba(141,127,224,0.16);
  --radius:14px;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{background:var(--bg); color:var(--text); font-family:'Inter',sans-serif; margin:0; line-height:1.6; -webkit-font-smoothing:antialiased;}
img{max-width:100%; height:auto; display:block;}
.mono{font-family:'IBM Plex Mono',monospace;}
h1,h2,h3{font-family:'Fraunces',serif; font-weight:600; letter-spacing:-0.01em;}
h1{font-size:32px; margin:0 0 10px;}
a{color:inherit;}
::selection{background:var(--amber); color:#12162B;}
.wrap{max-width:1120px; margin:0 auto; padding:0 24px;}

header.site{border-bottom:1px solid var(--line); padding:16px 0; position:sticky; top:0; background:rgba(18,22,43,0.88); backdrop-filter:blur(10px); z-index:20;}
header.site .row{display:flex; align-items:center; justify-content:space-between;}
.logo{display:flex; align-items:center; gap:9px; font-family:'Fraunces',serif; font-weight:600; font-size:18px; text-decoration:none;}
nav a{font-size:14.5px; color:var(--text-muted); text-decoration:none; transition:color .15s;}
nav a:hover{color:var(--text);}
header.site nav{display:flex; gap:24px; align-items:center;}

/* Menu hambúrguer mobile — checkbox escondido + label como botão, sem JS.
   Em telas largas o input/label somem e o nav volta a ser a linha normal. */
.nav-toggle-input{display:none;}
.nav-toggle-btn{display:none; flex-direction:column; justify-content:center; gap:5px; width:34px; height:34px; cursor:pointer; padding:6px; margin-left:12px;}
.nav-toggle-btn span{display:block; width:100%; height:2px; background:var(--text); border-radius:2px; transition:transform .18s ease, opacity .18s ease;}
.nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(1){transform:translateY(7px) rotate(45deg);}
.nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(2){opacity:0;}
.nav-toggle-input:checked ~ .nav-toggle-btn span:nth-child(3){transform:translateY(-7px) rotate(-45deg);}

.page-main{padding:36px 24px 64px;}
@media(max-width:600px){
  .page-main{padding:28px 18px;}
  h1{font-size:24px;}
  .prose-page h2{font-size:19px; margin-top:28px;}
  .hero-grid, .grid-2{grid-template-columns:1fr !important;}
  .admin-stats-row{grid-template-columns:repeat(auto-fit,minmax(140px,1fr));}
}

.admin-table-wrap{overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--line); border-radius:var(--radius);}
.admin-table-wrap .admin-table{border:none; min-width:560px;}

header.site nav a.btn{border-radius:999px; padding:10px 20px;}
@media(max-width:820px){
  header.site .row{flex-wrap:wrap;}
  .nav-toggle-btn{display:flex;}
  header.site nav{
    order:3; width:100%; display:flex; flex-direction:column; align-items:flex-start; gap:4px;
    max-height:0; overflow:hidden; transition:max-height .22s ease;
  }
  .nav-toggle-input:checked ~ nav{
    max-height:320px; margin-top:16px; padding-top:16px; border-top:1px solid var(--line);
  }
  header.site nav a{padding:12px 2px; width:100%; font-size:15.5px; border-bottom:1px solid var(--line);}
  header.site nav a:last-of-type{border-bottom:none;}
  header.site nav a.btn{border-bottom:none;}
  header.site nav a.btn{width:auto; margin-top:6px; align-self:flex-start;}
}

.btn{display:inline-block; padding:11px 20px; border-radius:9px; font-weight:600; font-size:14.5px; text-decoration:none; border:1px solid transparent; cursor:pointer; transition:transform .12s ease, opacity .12s ease, border-color .12s ease; font-family:inherit;}
.btn:hover{transform:translateY(-1px);}
.btn:active{transform:translateY(0);}
.btn-amber{background:var(--amber); color:#1b1204;}
.btn-amber:hover{opacity:.92;}
.btn-outline{border-color:var(--line); color:var(--text); background:transparent;}
.btn-outline:hover{border-color:var(--amber);}

.card{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:26px 24px; box-shadow:0 12px 30px -18px rgba(0,0,0,.5); transition:border-color .15s, transform .15s;}
a.card:hover{border-color:var(--violet); transform:translateY(-2px); text-decoration:none;}

.badge{font-family:'IBM Plex Mono',monospace; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em; padding:5px 10px; border-radius:6px; background:var(--violet-soft); color:var(--violet); width:fit-content;}
.grid-courses{display:grid; grid-template-columns:repeat(auto-fill, minmax(260px,1fr)); gap:20px; margin-top:32px;}

/* Card de curso do catálogo: enxuto (ícone, título, 1 linha de descrição,
   preço) — o detalhamento de módulos/aulas fica na página do curso, não
   repetido aqui, pra não virar parede de texto. */
.course-card{
  display:flex; flex-direction:column; gap:14px; text-decoration:none; color:var(--text);
  background:linear-gradient(180deg, var(--surface), var(--surface-2));
  border:1.5px solid var(--line); border-radius:16px; padding:22px;
  box-shadow:0 16px 36px -24px rgba(0,0,0,.65); transition:border-color .18s, transform .18s, box-shadow .18s;
}
.course-card:hover{border-color:var(--amber); transform:translateY(-3px); box-shadow:0 20px 40px -20px rgba(242,169,60,.22); text-decoration:none;}
.course-card-cover{width:100%; max-width:100%; height:auto; aspect-ratio:16/7.5; object-fit:cover; display:block; border-radius:10px; background:var(--bg-alt);}
.course-card-top{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.course-card-icon{
  width:38px; height:38px; border-radius:10px; background:var(--amber-soft);
  display:flex; align-items:center; justify-content:center; font-size:18px; flex-shrink:0;
}
.course-card-chip{
  font-family:'IBM Plex Mono',monospace; font-size:11px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--text-muted); background:var(--bg-alt); border:1px solid var(--line);
  padding:4px 10px; border-radius:999px; white-space:nowrap;
}
.course-card-title{font-family:'Fraunces',serif; font-size:18px; font-weight:600; line-height:1.3; margin:0;}
.course-card-desc{font-size:13.5px; line-height:1.55; color:var(--text-muted); margin:0; flex:1; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
.course-card-footer{display:flex; align-items:center; justify-content:space-between; gap:10px; padding-top:14px; border-top:1px solid var(--line);}
.course-card-price{font-size:13.5px; font-weight:600; color:var(--amber);}
.course-card-arrow{color:var(--text-muted); font-size:15px; transition:transform .15s, color .15s;}
.course-card:hover .course-card-arrow{transform:translateX(3px); color:var(--amber);}

.course-search{
  display:flex; align-items:center; gap:10px; max-width:360px; margin-top:24px;
  background:var(--bg-alt); border:1px solid var(--line); border-radius:10px; padding:10px 14px;
}
.course-search input{flex:1; background:none; border:none; outline:none; color:var(--text); font-family:inherit; font-size:14px;}
.course-search input::placeholder{color:var(--text-muted);}

.progress-bar{height:5px; border-radius:99px; background:var(--line); overflow:hidden;}
.progress-bar span{display:block; height:100%; background:var(--amber);}

footer.site{border-top:1px solid var(--line); padding:44px 0 24px; margin-top:80px; color:var(--text-muted); font-size:13.5px;}
.footer-grid{display:grid; grid-template-columns:1.4fr 1fr 1fr; gap:32px;}
.footer-heading{font-family:'IBM Plex Mono',monospace; font-size:11.5px; text-transform:uppercase; letter-spacing:.05em; color:var(--text); margin-bottom:12px;}
footer.site a{display:block; color:var(--text-muted); text-decoration:none; font-size:13.5px; margin-bottom:8px; transition:color .15s;}
footer.site a:hover{color:var(--amber);}
@media(max-width:700px){.footer-grid{grid-template-columns:1fr;}}

input[type=text], input[type=email], input[type=password], input[type=tel], select, textarea{
  background:var(--bg-alt); border:1px solid var(--line); color:var(--text);
  border-radius:8px; padding:10px 12px; font-family:inherit; font-size:14.5px;
  transition:border-color .15s;
}
input:focus, select:focus, textarea:focus{outline:none; border-color:var(--amber);}

/* Páginas institucionais (termos, privacidade etc.) */
.prose-page{max-width:760px; margin:0 auto;}
.prose-page h2{font-size:21px; margin-top:32px; margin-bottom:10px;}
.prose-page p, .prose-page li{color:var(--text-muted); font-size:15px;}
.prose-page ul{padding-left:20px;}
.prose-page .updated{font-family:'IBM Plex Mono',monospace; font-size:12.5px; color:var(--text-muted); margin-bottom:20px;}

/* ===== Conteúdo de aula renderizado a partir de Markdown ===== */
.lesson-content{max-width:720px; font-size:16px; line-height:1.75; color:var(--text);}
.lesson-content .md-h{margin-top:34px; margin-bottom:12px; font-size:22px;}
.lesson-content h2.md-h{font-size:23px; border-top:1px solid var(--line); padding-top:26px;}
.lesson-content h2.md-h:first-child{border-top:none; padding-top:0;}
.lesson-content h3.md-h{font-size:19px;}
.lesson-content h4.md-h{font-size:16px; font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:.04em; color:var(--amber);}
.lesson-content p{margin:0 0 16px; color:var(--text);}
.lesson-content .md-list{margin:0 0 16px; padding-left:22px; display:flex; flex-direction:column; gap:6px;}
.lesson-content .md-list li{color:var(--text);}
.lesson-content strong{color:var(--text); font-weight:700;}
.lesson-content .md-inline-code{
  background:var(--bg-alt); border:1px solid var(--line); border-radius:4px;
  padding:2px 6px; font-family:'IBM Plex Mono',monospace; font-size:0.9em; color:var(--amber);
}
.lesson-content .md-code{
  background:#0c0f1e; border:1px solid var(--line); border-radius:10px;
  padding:16px 18px; overflow-x:auto; margin:0 0 18px; font-family:'IBM Plex Mono',monospace;
  font-size:13.5px; line-height:1.6;
}
.lesson-content .md-code code{color:#c9d6f5; background:none; padding:0; border:none;}
.lesson-content .md-callout{
  background:var(--violet-soft); border-left:3px solid var(--violet); border-radius:0 8px 8px 0;
  padding:14px 18px; margin:0 0 18px; color:var(--text); font-size:15px;
}
.lesson-content .md-hr{border:none; border-top:1px solid var(--line); margin:28px 0;}
.lesson-content .md-table-wrap{overflow-x:auto; margin:0 0 20px; border:1px solid var(--line); border-radius:10px;}
.lesson-content .md-table{width:100%; border-collapse:collapse; font-size:14.5px;}
.lesson-content .md-table th{
  background:var(--surface-2); text-align:left; padding:10px 14px; font-family:'IBM Plex Mono',monospace;
  font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--amber); border-bottom:1px solid var(--line);
}
.lesson-content .md-table td{padding:10px 14px; border-bottom:1px solid var(--line); color:var(--text-muted);}
.lesson-content .md-table tr:last-child td{border-bottom:none;}

/* Reveal suave ao rolar — sem exagero, só tira a sensação de "página estática" */
.reveal-on-scroll{opacity:0; transform:translateY(10px); transition:opacity .5s ease, transform .5s ease;}
.reveal-on-scroll.is-visible{opacity:1; transform:translateY(0);}

/* ===== Tutor IA — chat de verdade, não "comentário de blog" ===== */
.tutor-chat{
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  display:flex; flex-direction:column; overflow:hidden;
  box-shadow:0 20px 50px -25px rgba(0,0,0,.6);
}
.tutor-chat-head{
  display:flex; align-items:center; gap:10px; padding:14px 18px;
  border-bottom:1px solid var(--line); background:var(--surface-2);
}
.tutor-chat-avatar{
  width:30px; height:30px; border-radius:9px; background:var(--amber-soft); color:var(--amber);
  display:flex; align-items:center; justify-content:center; flex:none;
}
.tutor-chat-head .name{font-weight:600; font-size:14.5px;}
.tutor-chat-head .status{display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-muted); font-family:'IBM Plex Mono',monospace;}
.tutor-chat-head .status .dot{width:6px; height:6px; border-radius:50%; background:#3ddc84; box-shadow:0 0 0 3px rgba(61,220,132,.15);}

.tutor-chat-body{
  display:flex; flex-direction:column; gap:14px; padding:18px; max-height:420px; min-height:160px;
  overflow-y:auto; scroll-behavior:smooth;
}
.tutor-msg{display:flex; gap:10px; max-width:88%;}
.tutor-msg.from-user{align-self:flex-end; flex-direction:row-reverse;}
.tutor-msg .avatar{
  width:26px; height:26px; border-radius:8px; flex:none; display:flex; align-items:center; justify-content:center;
  font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:600;
}
.tutor-msg.from-bot .avatar{background:var(--violet-soft); color:var(--violet);}
.tutor-msg.from-user .avatar{background:var(--amber-soft); color:var(--amber);}
.tutor-msg .bubble{
  padding:10px 14px; border-radius:14px; font-size:14.5px; line-height:1.55; color:var(--text);
  white-space:pre-wrap;
}
.tutor-msg.from-bot .bubble{background:var(--bg-alt); border:1px solid var(--line); border-bottom-left-radius:4px;}
.tutor-msg.from-user .bubble{background:var(--amber); color:#1b1204; border-bottom-right-radius:4px;}

.tutor-typing{display:flex; gap:4px; align-items:center; padding:4px 2px;}
.tutor-typing span{width:6px; height:6px; border-radius:50%; background:var(--text-muted); animation:tutor-blink 1.2s infinite ease-in-out;}
.tutor-typing span:nth-child(2){animation-delay:.15s;}
.tutor-typing span:nth-child(3){animation-delay:.3s;}
@keyframes tutor-blink{0%,80%,100%{opacity:.25; transform:scale(.85);} 40%{opacity:1; transform:scale(1);}}

.tutor-chat-input{display:flex; gap:8px; padding:14px 16px; border-top:1px solid var(--line); background:var(--surface-2);}
.tutor-chat-input input{
  flex:1; background:var(--bg-alt); border:1px solid var(--line); color:var(--text);
  border-radius:10px; padding:11px 14px; font-size:14.5px; font-family:inherit;
}
.tutor-chat-input input:focus{outline:none; border-color:var(--amber);}
.tutor-chat-input button{
  width:42px; height:42px; border-radius:10px; background:var(--amber); border:none; color:#1b1204;
  display:flex; align-items:center; justify-content:center; cursor:pointer; flex:none; transition:opacity .15s;
}
.tutor-chat-input button:hover{opacity:.9;}
.tutor-chat-input button:disabled{opacity:.5; cursor:default;}
.tutor-chat-suggestions{display:flex; gap:8px; flex-wrap:wrap; padding:0 16px 14px;}
.tutor-suggestion{
  font-size:12.5px; padding:6px 12px; border-radius:999px; border:1px solid var(--line);
  color:var(--text-muted); background:transparent; cursor:pointer; transition:border-color .15s, color .15s;
}
.tutor-suggestion:hover{border-color:var(--amber); color:var(--amber);}

/* Grade de planos (planos.php) — 2 colunas no desktop, empilhado no celular */
.plan-grid{display:grid; grid-template-columns:1fr 1fr; gap:20px;}
@media(max-width:640px){
  .plan-grid{grid-template-columns:1fr;}
}

/* ===== Modal de checkout (Stripe Embedded Checkout com a cara do site) ===== */
.checkout-modal-overlay{
  position:fixed; inset:0; background:rgba(10,12,26,0.72); backdrop-filter:blur(4px);
  display:flex; align-items:center; justify-content:center; padding:20px;
  z-index:200; opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.checkout-modal-overlay.is-open{opacity:1; pointer-events:auto;}
.checkout-modal{
  background:var(--surface); border:1px solid var(--line); border-radius:18px;
  width:100%; max-width:480px; max-height:88vh; display:flex; flex-direction:column;
  overflow:hidden; box-shadow:0 40px 90px -30px rgba(0,0,0,.7);
  transform:translateY(8px); transition:transform .18s ease;
}
.checkout-modal-overlay.is-open .checkout-modal{transform:translateY(0);}
.checkout-modal-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 20px; border-bottom:1px solid var(--line); background:var(--surface-2);
}
.checkout-modal-brand{display:flex; align-items:center; gap:8px; font-family:'Fraunces',serif; font-weight:600; font-size:16px;}
.checkout-modal-close{
  background:transparent; border:none; color:var(--text-muted); font-size:22px; line-height:1;
  cursor:pointer; padding:4px 8px; border-radius:6px; transition:color .15s, background .15s;
}
.checkout-modal-close:hover{color:var(--text); background:var(--bg-alt);}
.checkout-modal-summary{
  padding:12px 20px; font-family:'IBM Plex Mono',monospace; font-size:13px; color:var(--amber);
  border-bottom:1px solid var(--line); background:var(--bg-alt);
}
.checkout-modal-body{flex:1; overflow-y:auto; min-height:280px; position:relative;}
.checkout-modal-loading{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px;
  padding:60px 20px; color:var(--text-muted); font-size:14px; text-align:center;
}
.checkout-modal-error{padding:24px 20px; color:#ff8a8a; font-size:14px; text-align:center;}
.checkout-modal-foot{
  display:flex; align-items:center; justify-content:center; gap:7px; padding:12px 20px;
  border-top:1px solid var(--line); background:var(--surface-2);
  font-size:12px; color:var(--text-muted);
}

/* ---------- Admin: navegação por abas ---------- */
.admin-nav{display:flex; gap:6px; flex-wrap:wrap; margin-bottom:28px; padding-bottom:16px; border-bottom:1px solid var(--line);}
.admin-nav a{
  font-size:13.5px; font-weight:600; color:var(--text-muted); padding:9px 16px; border-radius:8px;
  text-decoration:none; transition:background .15s, color .15s; white-space:nowrap;
}
.admin-nav a:hover{color:var(--text); background:var(--bg-alt);}
.admin-nav a.active{color:#1b1204; background:var(--amber);}

/* ---------- Admin: cartões de estatística ---------- */
.admin-stats-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:14px; margin-bottom:28px;}
.admin-stat{background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:18px 20px;}
.admin-stat .num{font-family:'Fraunces',serif; font-size:26px; font-weight:600;}
.admin-stat .label{font-size:11.5px; color:var(--text-muted); font-family:'IBM Plex Mono',monospace; text-transform:uppercase; letter-spacing:.04em; margin-top:6px;}

/* ---------- Admin: tabelas ---------- */
.admin-table{width:100%; border-collapse:collapse; font-size:13.5px;}
.admin-table th{
  text-align:left; padding:12px 16px; color:var(--text-muted); font-family:'IBM Plex Mono',monospace;
  font-size:11px; text-transform:uppercase; letter-spacing:.04em; border-bottom:1px solid var(--line);
  white-space:nowrap;
}
.admin-table td{padding:12px 16px; border-bottom:1px solid var(--line); color:var(--text); vertical-align:top;}
.admin-table tr:last-child td{border-bottom:none;}
.admin-table tr:hover td{background:var(--bg-alt);}
