/* =========================================================
   Minha Plataforma de Estudos — tema inspirado em TV Girl
   anos 90 · vintage · analógico · magenta sobre roxo-noite
   Paleta: #ed2788 · #740645 · #0f479f · #1a2c75 · #20062d
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;1,500;1,600;1,700&display=swap");

:root {
  /* paleta principal */
  --magenta: #ed2788;
  --wine: #740645;
  --blue: #0f479f;
  --navy: #1a2c75;
  --night: #20062d;

  /* derivados (tons da própria paleta) */
  --magenta-soft: #f25aa3;
  --magenta-glow: rgba(237, 39, 136, .35);
  --night-deep: #16031f;
  --surface: rgba(26, 44, 117, .22);
  --surface-solid: #241046;
  --surface-2: rgba(116, 6, 69, .28);
  --line: rgba(116, 6, 69, .9);
  --line-soft: rgba(237, 39, 136, .16);

  /* texto */
  --text: #f7eaf3;
  --text-2: #d9c4dd;
  --muted: #a98fb3;

  /* feedback (verde/vermelho mantidos, ajustados ao fundo escuro) */
  --ok: #3fd18b;
  --ok-bg: rgba(31, 170, 100, .14);
  --ok-line: #2fb877;
  --bad: #ff5c70;
  --bad-bg: rgba(229, 45, 70, .14);
  --bad-line: #f0445b;
  --warn: #ffb35c;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, .75);
  --shadow-sm: 0 8px 22px -14px rgba(0, 0, 0, .8);
  --glow: 0 10px 30px -10px var(--magenta-glow);

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, Consolas, monospace;

  --header-h: 128px;
  --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--wine) var(--night-deep); }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--night);
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(237, 39, 136, .55), transparent 60%),
    radial-gradient(1px 1px at 78% 9%, rgba(247, 234, 243, .45), transparent 60%),
    radial-gradient(1.2px 1.2px at 64% 72%, rgba(237, 39, 136, .4), transparent 60%),
    radial-gradient(1px 1px at 30% 88%, rgba(247, 234, 243, .35), transparent 60%),
    radial-gradient(1px 1px at 92% 52%, rgba(247, 234, 243, .3), transparent 60%),
    radial-gradient(ellipse 70% 55% at 0% 0%, rgba(116, 6, 69, .55), transparent 70%),
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(26, 44, 117, .7), transparent 70%),
    linear-gradient(160deg, #20062d 0%, #1d0833 55%, #1a0c3f 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* linhas de varredura de TV (bem sutis) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px);
}

/* grão de filme / impressão antiga */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: .09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, svg { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--magenta); color: #fff; }

:focus-visible {
  outline: 2px solid var(--magenta);
  outline-offset: 3px;
  border-radius: 8px;
}

h1, h2, h3, h4 {
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -.015em;
  color: var(--text);
}

p { margin: 0 0 1em; }
strong, b { font-weight: 600; color: #fff; }

code {
  font-family: var(--font-mono);
  font-size: .84em;
  color: #ffc4e1;
  background: rgba(237, 39, 136, .1);
  border: 1px solid rgba(237, 39, 136, .28);
  padding: .08em .38em;
  border-radius: 6px;
  word-break: break-word;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--night-deep); }
::-webkit-scrollbar-thumb { background: var(--wine); border-radius: 10px; border: 2px solid var(--night-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--magenta); }

/* ============ Cabeçalho + barra de categorias ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(22, 3, 31, .96), rgba(32, 6, 45, .9));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wine);
  box-shadow: 0 1px 0 rgba(237, 39, 136, .25), 0 12px 30px -20px rgba(0, 0, 0, .9);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 30%, #ff4fa3, var(--magenta) 45%, var(--wine) 100%);
  color: #fff;
  font-size: 20px;
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow: var(--glow), inset 0 0 0 3px rgba(32, 6, 45, .35);
  transition: transform .3s ease, box-shadow .3s ease;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.05); box-shadow: 0 10px 34px -6px var(--magenta-glow); }

.brand-text {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: -.01em;
}
.brand-text em {
  display: block;
  color: var(--magenta);
  font-style: italic;
  font-weight: 600;
  font-size: 14px;
}

.cat-nav {
  position: relative;
  display: flex;
  gap: 8px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  padding: 6px 4px 8px;
}
.cat-nav::-webkit-scrollbar { display: none; }

.cat-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 17px;
  border-radius: 10px;
  border: 1px solid var(--wine);
  background: linear-gradient(180deg, rgba(26, 44, 117, .85), rgba(26, 44, 117, .55));
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: .01em;
  white-space: nowrap;
  scroll-snap-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.cat-link:hover {
  transform: translateY(-2px);
  border-color: var(--magenta);
  background: linear-gradient(180deg, rgba(15, 71, 159, .9), rgba(26, 44, 117, .8));
  box-shadow: 0 8px 20px -10px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.cat-link:active { transform: translateY(0); }
.cat-link.is-active {
  background: var(--magenta);
  border-color: var(--magenta);
  color: #fff;
  box-shadow: 0 8px 24px -8px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.cat-link-icon { font-size: 16px; }

/* ============ Estrutura geral ============ */

main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 36px 20px 72px;
  outline: none;
  position: relative;
  z-index: 1;
}
main:focus, main:focus-visible { outline: none; }

.view { animation: fadeUp .5s ease both; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 30px 20px 38px;
  border-top: 1px solid var(--wine);
  background: linear-gradient(180deg, rgba(22, 3, 31, .9), rgba(26, 44, 117, .45));
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.site-footer p { margin: 0; }
.site-footer span[aria-hidden] { color: var(--magenta); }
.footer-small { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-top: 6px !important; letter-spacing: .02em; }

/* ============ Botões ============ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: var(--magenta);
  color: #fff;
  font-family: var(--font);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 18px -10px var(--magenta-glow), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  line-height: 1.2;
  text-align: center;
}
.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 12px 28px -10px rgba(237, 39, 136, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn:active { transform: translateY(0); filter: brightness(.96); }

.btn-primary, .btn-soft, .btn-sky, .btn-ghost { background: var(--magenta); color: #fff; }
.btn-block { width: 100%; }

.btn.is-disabled, .btn:disabled {
  opacity: .32;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
  filter: grayscale(.3);
}

/* ============ Barras de progresso ============ */

.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--navy);
  border: 1px solid rgba(15, 71, 159, .8);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .45);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--wine), var(--magenta) 60%, #ff5aa8);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(237, 39, 136, .6);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.bar-lg { height: 12px; }

/* ============ Página inicial ============ */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  max-width: 820px;
  align-items: center;
  padding: 24px 0 40px;
}

.sticker {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--magenta-soft);
  background: rgba(116, 6, 69, .35);
  border: 1px solid var(--wine);
  border-radius: 6px;
  padding: 6px 14px;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(40px, 6.6vw, 72px);
  line-height: 1.02;
  letter-spacing: -.035em;
  margin-bottom: 18px;
  text-shadow: 2px 2px 0 rgba(116, 6, 69, .7);
}
.hero h1 em {
  color: var(--magenta);
  font-style: italic;
  font-weight: 600;
  text-shadow: 0 0 28px rgba(237, 39, 136, .35);
}

.hero .subtitle {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-2);
  max-width: 34ch;
  margin-bottom: 30px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stat {
  background: var(--surface);
  border: 1px solid var(--wine);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .03em;
}
.hero-stat strong { font-size: 22px; font-weight: 700; color: #fff; display: block; line-height: 1.15; }

.marquee {
  overflow: hidden;
  border-block: 1px solid rgba(255, 255, 255, .15);
  background: linear-gradient(90deg, var(--wine), var(--magenta) 50%, var(--wine));
  color: #fff;
  margin: 14px -20px 48px;
  transform: rotate(-1deg);
  box-shadow: 0 10px 30px -14px var(--magenta-glow);
}
.marquee-track {
  display: flex;
  width: max-content;
  gap: 28px;
  padding: 10px 0;
  font-size: 17px;
  font-weight: 600;
  font-style: italic;
  letter-spacing: .02em;
  white-space: nowrap;
  animation: marquee 34s linear infinite;
}
@keyframes marquee { to { transform: translateX(-50%); } }

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 6px;
}
.section-title::after {
  content: "";
  display: block;
  width: 64px; height: 3px;
  margin-top: 12px;
  background: linear-gradient(90deg, var(--magenta), transparent);
  border-radius: 3px;
}
.section-lead { color: var(--text-2); margin-bottom: 30px; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.cat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(165deg, rgba(26, 44, 117, .5) 0%, rgba(32, 6, 45, .92) 65%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  overflow: hidden;
}
.cat-card::before {
  content: "";
  position: absolute;
  top: -50px; right: -50px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(rgba(237, 39, 136, .5) 1px, transparent 1.5px);
  background-size: 9px 9px;
  opacity: .35;
}
.cat-card::after {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(var(--magenta), transparent);
  opacity: .7;
}
.cat-card:hover {
  transform: translateY(-5px);
  border-color: var(--magenta);
  box-shadow: 0 26px 50px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(237, 39, 136, .25), var(--glow);
}

.cat-card-top { display: flex; align-items: center; justify-content: space-between; position: relative; }
.cat-card-icon {
  font-size: 30px;
  width: 60px; height: 60px;
  display: grid; place-items: center;
  border-radius: 14px;
  border: 1px solid var(--blue);
  background: linear-gradient(145deg, var(--navy), var(--night));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.cat-card-count {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
  padding: 4px 11px;
  border: 1px solid rgba(237, 39, 136, .5);
  border-radius: 6px;
  color: var(--magenta-soft);
  background: rgba(237, 39, 136, .08);
}
.cat-card h3 { font-size: 24px; margin: 4px 0 0; }
.cat-card p { color: var(--text-2); margin: 0; flex: 1; font-size: 15px; }
.mini-progress small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 7px; }

/* ============ Página da categoria ============ */

.crumbs {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.crumbs a { color: var(--text-2); text-decoration: none; border-bottom: 1px dashed rgba(237, 39, 136, .6); transition: color .2s ease; }
.crumbs a:hover { color: var(--magenta-soft); }
.crumbs span[aria-hidden] { color: var(--wine); }

.cat-hero {
  display: flex;
  gap: 26px;
  align-items: center;
  background: linear-gradient(120deg, rgba(116, 6, 69, .55) 0%, rgba(32, 6, 45, .85) 55%, rgba(26, 44, 117, .6) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.cat-hero::after {
  content: "";
  position: absolute;
  right: -70px; bottom: -90px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(rgba(237, 39, 136, .55) 1.2px, transparent 1.7px);
  background-size: 11px 11px;
  opacity: .45;
}
.cat-hero-icon {
  font-size: 46px;
  width: 92px; height: 92px;
  display: grid; place-items: center;
  border-radius: 20px;
  border: 1px solid var(--blue);
  background: linear-gradient(145deg, var(--navy), var(--night));
  flex-shrink: 0;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.cat-hero h1 { font-size: clamp(30px, 4.6vw, 46px); margin-bottom: 6px; }
.cat-hero p { color: var(--text-2); margin-bottom: 14px; max-width: 60ch; }
.cat-hero-body { flex: 1; position: relative; z-index: 1; min-width: 0; }
.cat-hero-progress { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text-2); }
.cat-hero-progress .bar { flex: 1; max-width: 320px; }

.lesson-list { display: grid; gap: 16px; }

.lesson-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  background: linear-gradient(100deg, rgba(26, 44, 117, .38), rgba(32, 6, 45, .9) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  overflow: hidden;
}
.lesson-card::before {
  content: "";
  position: absolute;
  left: 0; top: 18%; bottom: 18%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--magenta);
  opacity: .45;
  transition: opacity .22s ease, top .22s ease, bottom .22s ease;
}
.lesson-card:hover {
  transform: translateY(-3px);
  border-color: var(--magenta);
  box-shadow: 0 20px 40px -22px rgba(0, 0, 0, .9), var(--glow);
}
.lesson-card:hover::before { opacity: 1; top: 0; bottom: 0; }
.lesson-card:active { transform: translateY(0); }

.lesson-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
  width: 70px; height: 70px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  border-radius: 14px;
  border: 1px solid var(--wine);
  background: linear-gradient(145deg, rgba(116, 6, 69, .7), rgba(32, 6, 45, .9));
  color: var(--magenta-soft);
}
.lesson-num b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; display: block; color: #fff; }
.lesson-card.is-done .lesson-num { background: linear-gradient(145deg, rgba(31, 170, 100, .3), rgba(32, 6, 45, .9)); border-color: var(--ok-line); color: var(--ok); }

.lesson-body { min-width: 0; }
.lesson-body h3 { font-size: 19px; font-weight: 600; margin-bottom: 4px; }
.lesson-body p { color: var(--text-2); margin-bottom: 10px; font-size: 14.5px; overflow-wrap: anywhere; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.lesson-body .bar { height: 6px; max-width: 360px; }

.lesson-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.status {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .03em;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--wine);
  white-space: nowrap;
}
.status-idle { background: transparent; color: var(--muted); }
.status-doing { background: rgba(15, 71, 159, .35); border-color: var(--blue); color: #cfe0ff; }
.status-done { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.lesson-go {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--magenta);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 6px 16px -8px var(--magenta-glow);
  transition: transform .22s ease;
}
.lesson-card:hover .lesson-go { transform: translateX(4px); }

/* ============ Página da aula ============ */

.lesson-hero {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(237, 39, 136, .35), transparent 55%),
    linear-gradient(125deg, var(--wine) 0%, #3b0540 45%, var(--night) 75%, var(--navy) 100%);
  color: #fff;
  border: 1px solid rgba(237, 39, 136, .45);
  border-radius: var(--radius);
  padding: 36px 34px 32px;
  box-shadow: var(--shadow), 0 0 50px -25px var(--magenta-glow);
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.lesson-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.5px);
  background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(115deg, transparent 50%, #000 100%);
  mask-image: linear-gradient(115deg, transparent 50%, #000 100%);
}
.lesson-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .08) 0 1px, transparent 1px 3px);
  pointer-events: none;
}
.lesson-hero > * { position: relative; z-index: 1; }
.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  background: rgba(32, 6, 45, .55);
  color: var(--magenta-soft);
  border: 1px solid rgba(237, 39, 136, .5);
  border-radius: 6px;
  padding: 5px 12px;
  margin-bottom: 16px;
}
.lesson-hero h1 { font-size: clamp(28px, 4.6vw, 44px); margin-bottom: 10px; color: #fff; }
.lesson-hero p { font-size: 16.5px; color: var(--text-2); max-width: 62ch; margin-bottom: 14px; }
.lesson-hero .lesson-meta { color: var(--text-2); margin: 0; }

.lesson-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin: 22px 0;
  align-items: center;
}
.lesson-nav > :first-child { justify-self: start; }
.lesson-nav > :last-child { justify-self: end; }

/* caixa de progresso (fica no fim da aula, na seção de desempenho) */
.progress-box {
  background: linear-gradient(180deg, rgba(26, 44, 117, .35), rgba(22, 3, 31, .7));
  border: 1px solid var(--wine);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 9px;
  font-size: 14px;
}
.progress-row strong { font-weight: 600; }
.progress-counters { display: flex; gap: 8px; font-size: 12.5px; font-weight: 600; }
.pc { padding: 2px 10px; border-radius: 6px; border: 1px solid; }
.pc-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.pc-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.pc-pct { color: #fff; background: rgba(237, 39, 136, .2); border-color: var(--magenta); }

.jump { display: flex; gap: 6px; margin-top: 11px; overflow-x: auto; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump button {
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1px solid var(--navy);
  background: rgba(26, 44, 117, .45);
  color: var(--text-2);
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.jump button:hover { border-color: var(--magenta); color: #fff; }
.jump button.is-current { background: var(--magenta); border-color: var(--magenta); color: #fff; }

.panel {
  background: linear-gradient(180deg, rgba(26, 44, 117, .22), rgba(32, 6, 45, .82) 30%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 38px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--header-h) + 20px);
  min-width: 0;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(24px, 3.2vw, 32px);
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--wine);
  position: relative;
}
.section-head::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 90px; height: 2px;
  background: var(--magenta);
  box-shadow: 0 0 10px var(--magenta-glow);
}
.section-sub { color: var(--text-2); margin-top: -8px; margin-bottom: 26px; font-size: 15px; }

/* ----- Blocos do resumo ----- */
.resumo { max-width: 76ch; min-width: 0; color: var(--text); }
.resumo .r-h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 40px 0 14px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.resumo .r-h2::before { content: "✦"; color: var(--magenta); font-size: 15px; }
.resumo > .r-h2:first-child { margin-top: 0; }
.resumo .r-h3 { font-weight: 600; font-size: 17px; margin: 26px 0 8px; color: var(--magenta-soft); }
.resumo ul, .resumo ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.resumo li { margin-bottom: .45em; }
.resumo li::marker { color: var(--magenta); }

.r-steps { list-style: none; padding: 0 !important; counter-reset: passo; }
.r-steps li {
  counter-increment: passo;
  position: relative;
  padding: 11px 15px 11px 56px;
  margin-bottom: 10px !important;
  background: rgba(26, 44, 117, .3);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 71, 159, .55);
}
.r-steps li::before {
  content: counter(passo);
  position: absolute;
  left: 13px; top: 10px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: var(--magenta);
  color: #fff;
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 4px 12px -6px var(--magenta-glow);
}

.r-formula {
  background: linear-gradient(135deg, var(--navy), var(--night-deep));
  color: #fff;
  border: 1px solid var(--blue);
  border-left: 3px solid var(--magenta);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 1.2em;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.r-formula-label { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--magenta-soft); margin-bottom: 6px; }
.r-formula-expr { font-size: 20px; font-weight: 500; line-height: 1.5; overflow-x: auto; }
.r-formula-expr sub, .r-formula-expr sup { font-size: .62em; }
.r-formula-note { display: block; font-size: 13px; color: var(--text-2); margin-top: 8px; }

.r-code {
  background: var(--night-deep);
  color: #ffd6ea;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0 0 1.2em;
  border: 1px solid var(--wine);
  border-top: 3px solid var(--blue);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .4);
}
.r-code code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; word-break: normal; }

.r-table-wrap { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--wine); border-radius: var(--radius-sm); }
.r-table { border-collapse: collapse; width: 100%; font-size: 14.5px; background: rgba(32, 6, 45, .6); }
.r-table th, .r-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid rgba(116, 6, 69, .5); vertical-align: top; }
.r-table th { background: linear-gradient(180deg, var(--wine), #5a0436); color: #fff; font-weight: 600; border-bottom: 1px solid var(--magenta); }
.r-table tr:last-child td { border-bottom: 0; }
.r-table tr:nth-child(even) td { background: rgba(26, 44, 117, .22); }

.callout {
  border: 1px solid;
  border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 1.3em;
  position: relative;
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.callout ul { margin-bottom: 0; }
.callout-exemplo { background: rgba(15, 71, 159, .2); border-color: var(--blue); }
.callout-exemplo .callout-title { color: #b9d0ff; }
.callout-destaque { background: linear-gradient(135deg, rgba(116, 6, 69, .55), rgba(32, 6, 45, .6)); border-color: var(--magenta); box-shadow: 0 10px 30px -20px var(--magenta-glow); }
.callout-destaque .callout-title { color: var(--magenta-soft); }
.callout-dica { background: var(--ok-bg); border-color: var(--ok-line); }
.callout-dica .callout-title { color: var(--ok); }
.callout-cuidado { background: var(--bad-bg); border-color: var(--bad-line); }
.callout-cuidado .callout-title { color: var(--bad); }
.callout-cuidado li::marker { color: var(--bad); }
.callout-dica li::marker { color: var(--ok); }

/* ----- Questões objetivas ----- */
.q-list { display: grid; gap: 20px; }

.q-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  background: linear-gradient(180deg, rgba(26, 44, 117, .28), rgba(22, 3, 31, .7));
  box-shadow: var(--shadow-sm);
  transition: border-color .3s ease, box-shadow .3s ease;
  min-width: 0;
}
.q-card.card-ok { border-color: var(--ok-line); box-shadow: 0 0 0 1px rgba(47, 184, 119, .25), var(--shadow-sm); }
.q-card.card-bad { border-color: var(--bad-line); box-shadow: 0 0 0 1px rgba(240, 68, 91, .25), var(--shadow-sm); }

.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.q-num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--magenta-soft);
  background: rgba(237, 39, 136, .1);
  border: 1px solid rgba(237, 39, 136, .45);
  border-radius: 6px;
  padding: 3px 10px;
}
.q-badge { font-size: 12.5px; font-weight: 600; padding: 3px 11px; border-radius: 6px; }
.q-badge.ok { color: var(--ok); background: var(--ok-bg); }
.q-badge.bad { color: var(--bad); background: var(--bad-bg); }

.q-text { font-size: 17px; font-weight: 500; margin-bottom: 16px; overflow-wrap: anywhere; }

.options { display: grid; gap: 10px; }
.option {
  display: grid;
  grid-template-columns: 36px 1fr 24px;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 12px 15px;
  border: 1px solid rgba(116, 6, 69, .75);
  border-radius: var(--radius-sm);
  background: rgba(22, 3, 31, .75);
  color: var(--text);
  cursor: pointer;
  font-size: 15.5px;
  line-height: 1.5;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease, opacity .3s ease;
}
.option:hover:not(:disabled) {
  border-color: var(--magenta);
  background: rgba(237, 39, 136, .09);
  transform: translateX(4px);
  box-shadow: 0 6px 18px -12px var(--magenta-glow);
}
.option:active:not(:disabled) { transform: scale(.99); }
.option:disabled { cursor: default; }
.opt-text { min-width: 0; overflow-wrap: anywhere; }
.letter {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--wine);
  background: var(--night);
  color: var(--magenta-soft);
  font-weight: 700;
  font-size: 14px;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.option:hover:not(:disabled) .letter { background: var(--magenta); border-color: var(--magenta); color: #fff; }
.opt-icon { font-weight: 700; font-size: 18px; text-align: center; }

.option.is-correct { border-color: var(--ok-line); background: var(--ok-bg); animation: pop .4s ease; }
.option.is-correct .letter { background: var(--ok-line); color: #06210f; border-color: var(--ok-line); }
.option.is-correct .opt-icon { color: var(--ok); }

.option.is-wrong { border-color: var(--bad-line); background: var(--bad-bg); animation: shake .42s ease; }
.option.is-wrong .letter { background: var(--bad-line); color: #fff; border-color: var(--bad-line); }
.option.is-wrong .opt-icon { color: var(--bad); }

.option.is-answer { border-color: var(--ok-line); border-style: dashed; background: rgba(31, 170, 100, .07); }
.option.is-answer .letter { background: transparent; border-color: var(--ok-line); color: var(--ok); }
.option.is-answer .opt-icon { color: var(--ok); }
.option.is-dim { opacity: .42; }

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.02); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.feedback {
  margin-top: 16px;
  border-radius: var(--radius-sm);
  padding: 16px 18px 16px 20px;
  border: 1px solid;
  border-left-width: 4px;
  font-size: 15px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, .2);
}
.feedback.reveal { animation: fadeUp .35s ease both; }
.feedback > :last-child { margin-bottom: 0; }
.feedback-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.feedback-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.fb-title { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.feedback-ok .fb-title { color: var(--ok); }
.feedback-bad .fb-title { color: var(--bad); }
.fb-sub { font-weight: 600; font-size: 13.5px; letter-spacing: .02em; margin: 12px 0 2px; }
.fb-sub.ok { color: var(--ok); }
.fb-sub.bad { color: var(--bad); }
.feedback p { margin-bottom: .5em; color: var(--text); }

/* ----- Questões discursivas ----- */
.disc-list { display: grid; gap: 20px; }
.disc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  background: linear-gradient(180deg, rgba(116, 6, 69, .18), rgba(22, 3, 31, .7));
  box-shadow: var(--shadow-sm);
  transition: border-color .3s ease, box-shadow .3s ease;
  min-width: 0;
}
.disc-card.is-sent { border-color: var(--blue); box-shadow: 0 0 0 1px rgba(15, 71, 159, .45), var(--shadow-sm); }
.disc-q { display: block; font-size: 16.5px; font-weight: 500; margin-bottom: 14px; }
.disc-q .q-num { margin-right: 8px; vertical-align: 2px; }
.disc-card textarea {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: 14px 16px;
  border: 1px solid var(--wine);
  border-radius: var(--radius-sm);
  background: rgba(22, 3, 31, .85);
  font: inherit;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.disc-card textarea::placeholder { color: var(--muted); }
.disc-card textarea:focus { outline: none; border-color: var(--magenta); box-shadow: 0 0 0 3px rgba(237, 39, 136, .2); }
.disc-card textarea.shake { animation: shake .42s ease; border-color: var(--bad-line); }
.disc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.disc-info { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.disc-count { color: var(--muted); }
.disc-status { font-weight: 600; min-height: 1.2em; }
.disc-status.ok { color: var(--ok); }
.disc-status.warn { color: var(--bad); }
.disc-status.pending { color: var(--warn); }

/* ----- Desempenho ----- */
.done-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(120deg, var(--wine), var(--night) 70%);
  border: 1px solid var(--magenta);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: var(--glow);
  animation: fadeUp .5s ease both;
}
.done-banner .big { font-size: 38px; line-height: 1; }
.done-banner h3 { margin: 0 0 2px; font-size: 22px; }
.done-banner p { margin: 0; color: var(--text-2); }

.result-hint {
  background: rgba(15, 71, 159, .18);
  border: 1px dashed var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 22px;
  color: var(--text-2);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: linear-gradient(180deg, rgba(26, 44, 117, .35), rgba(22, 3, 31, .7));
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  align-items: center;
  justify-content: center;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .03em; line-height: 1.3; }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1; color: #fff; }
.stat-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.stat-ok .stat-value { color: var(--ok); }
.stat-bad { background: var(--bad-bg); border-color: var(--bad-line); }
.stat-bad .stat-value { color: var(--bad); }

.ring {
  --p: 0;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: conic-gradient(var(--magenta) calc(var(--p) * 1%), var(--navy) 0);
  display: grid;
  place-items: center;
  box-shadow: 0 0 20px -6px var(--magenta-glow);
}
.ring span {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--night);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 17px;
  color: #fff;
}

.result-message { font-size: 16px; margin-bottom: 20px; color: var(--text-2); }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* corações da conclusão */
.hearts { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.hearts span {
  position: absolute;
  bottom: -40px;
  font-size: 26px;
  color: var(--magenta);
  text-shadow: 0 0 12px var(--magenta-glow);
  animation: rise 2.8s ease-in forwards;
}
@keyframes rise {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateY(-105vh) rotate(40deg); opacity: 0; }
}

/* 404 */
.empty {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(180deg, rgba(26, 44, 117, .35), rgba(32, 6, 45, .85));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty .big { font-size: 60px; }
.empty p { color: var(--text-2); }

/* ============ Responsivo ============ */

@media (max-width: 960px) {
  .result-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .header-inner { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 16px 4px; }
  .brand { justify-content: center; }
  .cat-nav { margin: 0 -16px; padding: 4px 16px 10px; }
  .hero { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .hero .subtitle { margin-inline: auto; }
  .hero-actions, .hero-stats { justify-content: center; }
  }

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  main { padding: 22px 16px 52px; }
  .marquee { margin-inline: -16px; }
  .panel { padding: 24px 18px; }
  .cat-hero { flex-direction: column; align-items: flex-start; padding: 22px; gap: 16px; }
  .cat-hero-icon { width: 72px; height: 72px; font-size: 36px; }
  .lesson-card { grid-template-columns: auto 1fr; gap: 14px; padding: 16px; }
  .lesson-num { width: 56px; height: 56px; font-size: 10px; }
  .lesson-num b { font-size: 21px; }
  .lesson-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .lesson-body h3 { font-size: 17px; }
  .lesson-hero { padding: 26px 20px; }
  .lesson-nav { grid-template-columns: 1fr 1fr; }
  .lesson-nav > :nth-child(2) { grid-column: 1 / -1; grid-row: 1; justify-self: stretch; }
  .lesson-nav > :first-child, .lesson-nav > :last-child { justify-self: stretch; }
  .lesson-nav .btn { padding: 10px 12px; font-size: 13.5px; }
  .progress-box { padding: 12px 14px; }
  .progress-row { font-size: 13px; }
  .q-card, .disc-card { padding: 18px 16px; }
  .q-text { font-size: 16px; }
  .option { grid-template-columns: 32px 1fr 20px; gap: 10px; padding: 10px 12px; font-size: 15px; }
  .letter { width: 30px; height: 30px; font-size: 13px; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid .stat:last-child { grid-column: 1 / -1; }
  .r-formula-expr { font-size: 17px; }
  .resumo .r-h2 { font-size: 21px; }
  .disc-foot .btn { width: 100%; }
  .cat-link { padding: 8px 14px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .marquee-track { animation: none; }
}

/* =========================================================
   Botão de tema (claro / escuro)
   ========================================================= */

:root { color-scheme: dark; }
.header-inner { position: relative; }

.theme-toggle {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--wine);
  background: linear-gradient(180deg, rgba(26, 44, 117, .85), rgba(26, 44, 117, .55));
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.theme-toggle:hover { transform: translateY(-2px) rotate(-10deg); border-color: var(--magenta); box-shadow: 0 8px 20px -10px var(--magenta-glow); }
.theme-icon { grid-area: 1 / 1; transition: opacity .25s ease, transform .35s ease; }
/* no escuro aparece o sol (vai para o claro); no claro aparece a lua */
.theme-icon-moon { opacity: 0; transform: scale(.5) rotate(-60deg); }
:root[data-theme="light"] .theme-icon-sun { opacity: 0; transform: scale(.5) rotate(60deg); }
:root[data-theme="light"] .theme-icon-moon { opacity: 1; transform: none; }

@media (max-width: 860px) {
  .theme-toggle { position: absolute; top: 10px; right: 16px; width: 40px; height: 40px; }
}

/* =========================================================
   TEMA CLARO — mesma paleta, fundo papel rosado
   ========================================================= */

:root[data-theme="light"] {
  color-scheme: light;
  --text: #22082f;
  --text-2: #4b3057;
  --muted: #76607f;
  --magenta-soft: #b8126a;
  --magenta-glow: rgba(237, 39, 136, .28);
  --line: rgba(116, 6, 69, .24);
  --line-soft: rgba(237, 39, 136, .14);
  --surface: #ffffff;
  --ok: #13784a;
  --ok-bg: rgba(31, 170, 100, .1);
  --ok-line: #2a9d66;
  --bad: #c41d38;
  --bad-bg: rgba(229, 45, 70, .08);
  --bad-line: #de3f56;
  --warn: #a85a00;
  --shadow: 0 18px 40px -26px rgba(32, 6, 45, .35);
  --shadow-sm: 0 8px 22px -16px rgba(32, 6, 45, .35);
  --glow: 0 12px 30px -14px var(--magenta-glow);
  scrollbar-color: #d9b3c9 #f6edf3;
}

:root[data-theme="light"] body {
  background-color: #fbf4f8;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(237, 39, 136, .45), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 9%, rgba(15, 71, 159, .35), transparent 60%),
    radial-gradient(1.4px 1.4px at 64% 72%, rgba(237, 39, 136, .35), transparent 60%),
    radial-gradient(1.2px 1.2px at 30% 88%, rgba(15, 71, 159, .3), transparent 60%),
    radial-gradient(ellipse 70% 55% at 0% 0%, rgba(237, 39, 136, .12), transparent 70%),
    radial-gradient(ellipse 70% 60% at 100% 100%, rgba(15, 71, 159, .12), transparent 70%),
    linear-gradient(160deg, #fdf6fa 0%, #f8f0f7 55%, #f1f1fb 100%);
}
:root[data-theme="light"] body::before { background: repeating-linear-gradient(0deg, rgba(32, 6, 45, .018) 0 1px, transparent 1px 3px); }
:root[data-theme="light"] body::after { opacity: .07; mix-blend-mode: multiply; }
:root[data-theme="light"] ::-webkit-scrollbar-track { background: #f6edf3; }
:root[data-theme="light"] ::-webkit-scrollbar-thumb { background: #d9b3c9; border-color: #f6edf3; }

:root[data-theme="light"] strong,
:root[data-theme="light"] b { color: var(--text); }
:root[data-theme="light"] code { color: #a3155f; background: rgba(237, 39, 136, .07); border-color: rgba(237, 39, 136, .25); }

/* cabeçalho, menu e rodapé */
:root[data-theme="light"] .site-header {
  background: rgba(255, 251, 253, .92);
  border-bottom-color: rgba(116, 6, 69, .2);
  box-shadow: 0 1px 0 rgba(237, 39, 136, .2), 0 10px 26px -22px rgba(32, 6, 45, .5);
}
:root[data-theme="light"] .cat-link,
:root[data-theme="light"] .theme-toggle {
  background: #ffffff;
  color: var(--navy);
  border-color: rgba(116, 6, 69, .25);
  box-shadow: 0 2px 6px -4px rgba(32, 6, 45, .3);
}
:root[data-theme="light"] .cat-link:hover,
:root[data-theme="light"] .theme-toggle:hover { background: #fff0f7; border-color: var(--magenta); }
:root[data-theme="light"] .cat-link.is-active { background: var(--magenta); color: #fff; border-color: var(--magenta); }
:root[data-theme="light"] .site-footer { background: linear-gradient(180deg, #fff, #f3e7f0); border-top-color: rgba(116, 6, 69, .2); color: var(--text); }

/* página inicial */
:root[data-theme="light"] .hero h1 { text-shadow: 2px 2px 0 rgba(237, 39, 136, .14); }
:root[data-theme="light"] .hero h1 em { text-shadow: none; }
:root[data-theme="light"] .sticker { background: rgba(237, 39, 136, .07); border-color: rgba(116, 6, 69, .25); }
:root[data-theme="light"] .hero-stat { background: #fff; border-color: var(--line); }
:root[data-theme="light"] .hero-stat strong { color: var(--text); }
:root[data-theme="light"] .cat-card { background: linear-gradient(165deg, #ffffff 0%, #fbf3f8 100%); }
:root[data-theme="light"] .cat-card-icon,
:root[data-theme="light"] .cat-hero-icon { background: linear-gradient(145deg, #eef2fc, #ffffff); border-color: rgba(15, 71, 159, .3); }
:root[data-theme="light"] .cat-card-count { background: rgba(237, 39, 136, .06); }

/* lista de aulas */
:root[data-theme="light"] .cat-hero { background: linear-gradient(120deg, rgba(237, 39, 136, .12) 0%, #ffffff 55%, rgba(15, 71, 159, .1) 100%); }
:root[data-theme="light"] .lesson-card { background: linear-gradient(100deg, #f2f4fc, #ffffff 70%); }
:root[data-theme="light"] .lesson-num { background: linear-gradient(145deg, #fde4f0, #ffffff); border-color: rgba(116, 6, 69, .3); }
:root[data-theme="light"] .lesson-num b { color: var(--text); }
:root[data-theme="light"] .lesson-card.is-done .lesson-num { background: linear-gradient(145deg, #dcf4e7, #ffffff); }
:root[data-theme="light"] .status-doing { background: rgba(15, 71, 159, .09); color: var(--navy); }

/* aula */
:root[data-theme="light"] .lesson-hero {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(237, 39, 136, .22), transparent 55%),
    linear-gradient(125deg, #fde2ef 0%, #ffffff 55%, #e7ecfb 100%);
  color: var(--text);
  border-color: rgba(237, 39, 136, .35);
  box-shadow: var(--shadow);
}
:root[data-theme="light"] .lesson-hero::before { background-image: radial-gradient(rgba(237, 39, 136, .22) 1px, transparent 1.5px); }
:root[data-theme="light"] .lesson-hero::after { background: none; }
:root[data-theme="light"] .lesson-hero h1 { color: var(--text); }
:root[data-theme="light"] .kicker { background: #fff; border-color: rgba(237, 39, 136, .4); }
:root[data-theme="light"] .panel { background: linear-gradient(180deg, #f3f5fc, #ffffff 30%); }
:root[data-theme="light"] .section-head { border-bottom-color: rgba(116, 6, 69, .18); }

/* resumo */
:root[data-theme="light"] .r-steps li { background: rgba(15, 71, 159, .05); border-color: rgba(15, 71, 159, .22); }
:root[data-theme="light"] .r-table { background: #fff; }
:root[data-theme="light"] .r-table td { border-bottom-color: rgba(116, 6, 69, .12); }
:root[data-theme="light"] .r-table tr:nth-child(even) td { background: rgba(26, 44, 117, .04); }
:root[data-theme="light"] .callout-exemplo { background: rgba(15, 71, 159, .07); }
:root[data-theme="light"] .callout-exemplo .callout-title { color: var(--navy); }
:root[data-theme="light"] .callout-destaque { background: linear-gradient(135deg, rgba(237, 39, 136, .1), #ffffff); }

/* questões */
:root[data-theme="light"] .q-card,
:root[data-theme="light"] .disc-card { background: #ffffff; }
:root[data-theme="light"] .q-num { background: rgba(237, 39, 136, .06); }
:root[data-theme="light"] .option { background: #fcf8fb; border-color: rgba(116, 6, 69, .22); }
:root[data-theme="light"] .option:hover:not(:disabled) { background: #fff0f7; }
:root[data-theme="light"] .letter { background: #ffffff; border-color: rgba(116, 6, 69, .3); }
:root[data-theme="light"] .option.is-correct .letter { background: var(--ok-line); border-color: var(--ok-line); color: #fff; }
:root[data-theme="light"] .option.is-wrong .letter { background: var(--bad-line); border-color: var(--bad-line); color: #fff; }
:root[data-theme="light"] .option:hover:not(:disabled) .letter { background: var(--magenta); border-color: var(--magenta); color: #fff; }
:root[data-theme="light"] .option.is-answer { background: rgba(31, 170, 100, .05); }
:root[data-theme="light"] .option.is-answer .letter { background: #fff; }
:root[data-theme="light"] .feedback { box-shadow: none; }
:root[data-theme="light"] .disc-card textarea { background: #fdf9fc; border-color: rgba(116, 6, 69, .28); }

/* progresso e desempenho */
:root[data-theme="light"] .bar { background: rgba(26, 44, 117, .12); border-color: rgba(15, 71, 159, .3); box-shadow: inset 0 1px 2px rgba(32, 6, 45, .12); }
:root[data-theme="light"] .bar > span { box-shadow: 0 0 8px rgba(237, 39, 136, .35); }
:root[data-theme="light"] .progress-box,
:root[data-theme="light"] .stat { background: linear-gradient(180deg, #f3f5fc, #ffffff); border-color: var(--line); }
:root[data-theme="light"] .pc-pct { color: var(--text); background: rgba(237, 39, 136, .1); }
:root[data-theme="light"] .stat-value { color: var(--text); }
:root[data-theme="light"] .stat-ok { background: var(--ok-bg); border-color: var(--ok-line); }
:root[data-theme="light"] .stat-ok .stat-value { color: var(--ok); }
:root[data-theme="light"] .stat-bad { background: var(--bad-bg); border-color: var(--bad-line); }
:root[data-theme="light"] .stat-bad .stat-value { color: var(--bad); }
:root[data-theme="light"] .ring { background: conic-gradient(var(--magenta) calc(var(--p) * 1%), rgba(26, 44, 117, .15) 0); }
:root[data-theme="light"] .ring span { background: #ffffff; color: var(--text); }
:root[data-theme="light"] .done-banner { background: linear-gradient(120deg, #fde2ef, #ffffff 70%); }
:root[data-theme="light"] .result-hint { background: rgba(15, 71, 159, .06); }
:root[data-theme="light"] .empty { background: #ffffff; }

/* =========================================================
   Resposta de referência das discursivas
   ========================================================= */

.disc-ref {
  margin-top: 16px;
  padding: 16px 18px 16px 20px;
  border: 1px solid var(--blue);
  border-left: 4px solid var(--magenta);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(15, 71, 159, .22), rgba(116, 6, 69, .18));
}
.disc-ref.reveal { animation: fadeUp .35s ease both; }
.disc-ref-title { font-weight: 700; font-size: 15.5px; color: var(--magenta-soft); margin-bottom: 2px; }
.disc-ref-note { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.disc-ref-body { font-size: 15px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.disc-ref-body code { white-space: pre-wrap; }

/* =========================================================
   Simulado
   ========================================================= */

.sim-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 28px;
  padding: 22px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--magenta);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(237, 39, 136, .3), transparent 60%),
    linear-gradient(120deg, rgba(116, 6, 69, .6), rgba(32, 6, 45, .9) 60%, rgba(26, 44, 117, .6));
  text-decoration: none;
  box-shadow: var(--glow);
  transition: transform .22s ease, box-shadow .22s ease;
}
.sim-banner:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -22px rgba(237, 39, 136, .6); }
.sim-banner-icon {
  font-size: 34px;
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(32, 6, 45, .6);
  border: 1px solid rgba(237, 39, 136, .5);
}
.sim-banner-body { min-width: 0; }
.sim-banner-body h2 { font-size: 21px; margin: 0 0 2px; }
.sim-banner-body p { margin: 0 0 4px; color: var(--text-2); font-size: 14.5px; }
.sim-banner-body small { font-size: 13px; color: var(--muted); }
.sim-banner-body small strong { color: var(--magenta-soft); }

.sim-tag {
  margin-left: auto;
  margin-right: 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(15, 71, 159, .25);
  border: 1px solid rgba(15, 71, 159, .7);
  border-radius: 6px;
  padding: 3px 10px;
  max-width: 55%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* alternativa escolhida (antes de finalizar) */
.option.is-selected {
  border-color: var(--magenta);
  background: rgba(237, 39, 136, .14);
  box-shadow: 0 0 0 1px var(--magenta) inset;
}
.option.is-selected .letter { background: var(--magenta); border-color: var(--magenta); color: #fff; }

.sim-sub { font-size: 18px; margin: 8px 0 12px; }
.sim-table { display: grid; gap: 8px; margin-bottom: 22px; }
.sim-row {
  display: grid;
  grid-template-columns: 1fr auto 140px auto;
  gap: 14px;
  align-items: center;
  padding: 11px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(26, 44, 117, .22);
  text-decoration: none;
  font-size: 14.5px;
  transition: border-color .2s ease, transform .2s ease;
}
.sim-row:hover { border-color: var(--magenta); transform: translateX(3px); }
.sim-row-name { min-width: 0; overflow-wrap: anywhere; }
.sim-row-name b { color: var(--magenta-soft); font-weight: 600; margin-right: 4px; }
.sim-row-score { font-weight: 700; }
.sim-row .bar { height: 7px; }
.sim-row-tag { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sim-row.is-weak { border-color: var(--bad-line); background: var(--bad-bg); }
.sim-row.is-weak .sim-row-tag { color: var(--bad); }

@media (max-width: 640px) {
  .sim-banner { grid-template-columns: auto 1fr; padding: 18px; gap: 14px; }
  .sim-banner .btn { grid-column: 1 / -1; }
  .sim-banner-icon { width: 52px; height: 52px; font-size: 28px; }
  .sim-row { grid-template-columns: 1fr auto; }
  .sim-row .bar { grid-column: 1 / -1; }
  .sim-row-tag { display: none; }
  .sim-tag { display: none; }
}

/* tema claro */
:root[data-theme="light"] .disc-ref { background: linear-gradient(135deg, rgba(15, 71, 159, .06), rgba(237, 39, 136, .06)); border-color: rgba(15, 71, 159, .35); border-left-color: var(--magenta); }
:root[data-theme="light"] .sim-banner {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(237, 39, 136, .18), transparent 60%),
    linear-gradient(120deg, #fde2ef, #ffffff 60%, #e7ecfb);
  box-shadow: var(--shadow);
}
:root[data-theme="light"] .sim-banner-icon { background: #fff; }
:root[data-theme="light"] .sim-tag { background: rgba(15, 71, 159, .08); border-color: rgba(15, 71, 159, .35); }
:root[data-theme="light"] .option.is-selected { background: #ffe8f3; }
:root[data-theme="light"] .option.is-selected .letter { background: var(--magenta); border-color: var(--magenta); color: #fff; }
:root[data-theme="light"] .sim-row { background: #fff; }
:root[data-theme="light"] .sim-row.is-weak { background: var(--bad-bg); }

/* =========================================================
   Caixa de confirmação (substitui window.confirm)
   ========================================================= */

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(22, 3, 31, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeUp .2s ease both;
}
.confirm-box {
  width: min(440px, 100%);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--magenta);
  background: linear-gradient(160deg, var(--surface-solid), var(--night));
  box-shadow: var(--shadow), var(--glow);
}
.confirm-box p { margin: 0 0 20px; font-size: 16px; font-weight: 500; color: var(--text); }
.confirm-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
:root[data-theme="light"] .confirm-overlay { background: rgba(32, 6, 45, .35); }
:root[data-theme="light"] .confirm-box { background: #ffffff; }

/* cabeçalho fixo respeita a área segura do celular */
.site-header { top: env(safe-area-inset-top, 0px); }

/* =========================================================
   Entrega da sprint (checklist) e link do rodapé
   ========================================================= */

.entrega { margin-bottom: 44px; }
.entrega .progress-box { margin-bottom: 22px; }
.entrega-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-bottom: 18px; }
.entrega-grupo h3 { font-size: 17px; margin-bottom: 12px; }
.entrega-grupo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.entrega-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(22, 3, 31, .55);
  transition: border-color .2s ease, background .2s ease;
}
.entrega-item:hover { border-color: var(--magenta); }
.entrega-item.is-done { border-color: var(--ok-line); background: var(--ok-bg); }
.entrega-item input {
  width: 20px; height: 20px;
  margin: 2px 0 0;
  accent-color: var(--magenta);
  cursor: pointer;
}
.entrega-texto { min-width: 0; display: grid; gap: 6px; }
.entrega-texto label { font-size: 15px; font-weight: 500; line-height: 1.5; cursor: pointer; overflow-wrap: anywhere; }
.entrega-item.is-done .entrega-texto label { text-decoration: line-through; text-decoration-color: var(--ok-line); color: var(--text-2); }
.entrega-pontos {
  justify-self: start;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 2px 9px;
  border-radius: 6px;
  color: var(--magenta-soft);
  background: rgba(237, 39, 136, .1);
  border: 1px solid rgba(237, 39, 136, .4);
}
.entrega-links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.entrega-link { font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; border-bottom: 1px dashed rgba(237, 39, 136, .55); }
.entrega-link:hover { color: var(--magenta-soft); }

.footer-link { color: var(--magenta-soft); text-decoration: none; border-bottom: 1px dashed currentColor; }
.footer-link:hover { color: var(--magenta); }

:root[data-theme="light"] .entrega-item { background: #ffffff; }
:root[data-theme="light"] .entrega-item.is-done { background: var(--ok-bg); }

@media (max-width: 640px) {
  .entrega-grid { grid-template-columns: 1fr; }
}
