/* ============================================================
   CodeStart - Curso de HTML, CSS e JavaScript
   Folha de estilos principal
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- Tokens de design ---------- */
:root {
  --bg: #0b1020;
  --bg-soft: #121a33;
  --bg-card: #161f3d;
  --bg-elevated: #1c2750;
  --border: #26325c;
  --border-soft: #1d2748;

  --text: #eaf0ff;
  --text-soft: #a8b3d6;
  --text-muted: #6f7ca6;

  --brand: #6366f1;
  --brand-2: #22d3ee;
  --brand-3: #f472b6;
  --gradient: linear-gradient(120deg, #6366f1 0%, #22d3ee 55%, #f472b6 100%);

  --html: #e34c26;
  --css: #2965f1;
  --js: #f0db4f;

  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #ef4444;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(3, 7, 25, 0.55);
  --shadow-soft: 0 8px 24px rgba(3, 7, 25, 0.35);
  --maxw: 1180px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, monospace;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(900px 500px at 95% 0%, rgba(34, 211, 238, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: rgba(99, 102, 241, 0.5);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}

::-webkit-scrollbar-track {
  background: var(--bg-soft);
}

::-webkit-scrollbar-thumb {
  background: #2b3765;
  border-radius: 8px;
  border: 2px solid var(--bg-soft);
}

::-webkit-scrollbar-thumb:hover {
  background: #3a4a86;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 56px 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
}

.section-head p {
  color: var(--text-soft);
  max-width: 720px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 16, 32, 0.82);
  border-bottom: 1px solid var(--border-soft);
}

.navbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 66px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo:hover {
  text-decoration: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: #0b1020;
  font-weight: 700;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  list-style: none;
}

.nav-links a {
  color: var(--text-soft);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.94rem;
  font-weight: 600;
  transition: 0.18s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.14);
  text-decoration: none;
}

.nav-links a.active {
  color: #fff;
  background: rgba(99, 102, 241, 0.28);
}

.nav-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.82rem;
  color: var(--text-soft);
  white-space: nowrap;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: 0.18s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--gradient);
  color: #071022;
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.35);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
}

.btn-success {
  background: var(--ok);
  color: #04250f;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
}

/* ---------- Card ---------- */
.card {
  background: linear-gradient(180deg, rgba(28, 39, 80, 0.7), rgba(22, 31, 61, 0.9));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.card-hover {
  transition: 0.22s;
}

.card-hover:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

/* ---------- Hero ---------- */
.hero {
  padding: 74px 0 40px;
  position: relative;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(34, 211, 238, 0.08);
  color: var(--brand-2);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.5rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

.hero h1 .grad {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p.lead {
  color: var(--text-soft);
  font-size: 1.08rem;
  max-width: 640px;
  margin-bottom: 28px;
}

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

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  list-style: none;
}

.hero-stats strong {
  display: block;
  font-size: 1.5rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stats span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Code window ---------- */
.code-window {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0f22;
  box-shadow: var(--shadow);
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #0f1631;
  border-bottom: 1px solid var(--border-soft);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #33406e;
}

.dot.red {
  background: #ff5f57;
}
.dot.yellow {
  background: #febc2e;
}
.dot.green {
  background: #28c840;
}

.code-window-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.code-window pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.65;
  overflow-x: auto;
  color: #cfe3ff;
}

.tok-tag {
  color: #ff7b72;
}
.tok-attr {
  color: #ffc861;
}
.tok-str {
  color: #7ee787;
}
.tok-comment {
  color: #6b7aa8;
  font-style: italic;
}
.tok-prop {
  color: #79c0ff;
}
.tok-num {
  color: #f2cc60;
}

/* ---------- Módulos ---------- */
.module-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--module-color, var(--brand));
}

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.module-card h3 {
  font-size: 1.12rem;
}

.module-card p {
  color: var(--text-soft);
  font-size: 0.92rem;
  flex: 1;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.progress > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--gradient);
  transition: width 0.5s ease;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
}

.tag-html {
  color: #ff9b7a;
  border-color: rgba(227, 76, 38, 0.5);
  background: rgba(227, 76, 38, 0.12);
}
.tag-css {
  color: #8ab4ff;
  border-color: rgba(41, 101, 241, 0.5);
  background: rgba(41, 101, 241, 0.12);
}
.tag-js {
  color: #ffe97a;
  border-color: rgba(240, 219, 79, 0.4);
  background: rgba(240, 219, 79, 0.1);
}
.tag-ok {
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
}
.tag-xp {
  color: #c4b5fd;
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(99, 102, 241, 0.14);
}

/* ---------- Lista de aulas ---------- */
.lesson-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  color: var(--text);
  transition: 0.16s;
}

.lesson-item:hover {
  border-color: var(--brand);
  background: var(--bg-elevated);
  text-decoration: none;
  transform: translateX(3px);
}

.lesson-item .num {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.lesson-item.done .num {
  background: var(--ok);
  color: #04250f;
  border-color: var(--ok);
}

.lesson-item .title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.lesson-item .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- Página da aula ---------- */
.lesson-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  padding-right: 6px;
}

.sidebar h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin: 18px 0 10px;
}

.sidebar h4:first-child {
  margin-top: 0;
}

.side-lesson {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 11px;
  border-radius: 9px;
  color: var(--text-soft);
  font-size: 0.87rem;
  transition: 0.15s;
}

.side-lesson:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  text-decoration: none;
}

.side-lesson.active {
  background: rgba(99, 102, 241, 0.22);
  color: #fff;
  font-weight: 700;
}

.side-lesson .bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3a4a86;
  flex: 0 0 8px;
}

.side-lesson.done .bullet {
  background: var(--ok);
}

/* ---------- Conteúdo da aula ---------- */
.lesson-body {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 34px clamp(18px, 4vw, 42px);
  box-shadow: var(--shadow-soft);
}

.lesson-body h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.lesson-body h2 {
  font-size: 1.3rem;
  margin: 32px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.lesson-body h3 {
  font-size: 1.06rem;
  margin: 22px 0 8px;
}

.lesson-body p {
  margin-bottom: 14px;
  color: #d5def7;
}

.lesson-body ul,
.lesson-body ol {
  margin: 0 0 16px 22px;
  color: #d5def7;
}

.lesson-body li {
  margin-bottom: 7px;
}

.lesson-body strong {
  color: #fff;
}

.lesson-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.28);
  padding: 2px 7px;
  border-radius: 6px;
  color: #c7d6ff;
}

.lesson-body pre {
  background: #0a0f22;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 18px;
}

.lesson-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: #cfe3ff;
}

.callout {
  border-radius: 12px;
  padding: 15px 18px;
  margin: 18px 0;
  border-left: 4px solid var(--brand);
  background: rgba(99, 102, 241, 0.1);
  font-size: 0.93rem;
}

.callout.tip {
  border-color: var(--brand-2);
  background: rgba(34, 211, 238, 0.1);
}

.callout.warn {
  border-color: var(--warn);
  background: rgba(245, 158, 11, 0.1);
}

.callout strong {
  display: block;
  margin-bottom: 4px;
}

.lesson-figure {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 18px 0;
}

/* ---------- Playground ---------- */
.playground {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0f22;
  margin: 20px 0;
}

.pg-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  background: #0f1631;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.pg-tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--mono);
  cursor: pointer;
  transition: 0.15s;
}

.pg-tab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.pg-tab.active {
  background: rgba(99, 102, 241, 0.25);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.5);
}

.pg-spacer {
  flex: 1;
}

.pg-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 260px;
}

.pg-editors {
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
}

.pg-editor {
  display: none;
  flex: 1;
}

.pg-editor.active {
  display: block;
}

.pg-editor textarea {
  width: 100%;
  height: 100%;
  min-height: 260px;
  resize: vertical;
  border: none;
  outline: none;
  background: #0a0f22;
  color: #cfe3ff;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 14px 16px;
  tab-size: 2;
}

.pg-editor textarea::placeholder {
  color: #4d5c8a;
}

.pg-preview {
  background: #fff;
  display: flex;
  flex-direction: column;
}

.pg-preview-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #eef1fa;
  border-bottom: 1px solid #dbe1f0;
  font-size: 0.76rem;
  font-weight: 700;
  color: #55608a;
  font-family: var(--mono);
}

.pg-preview iframe {
  flex: 1;
  width: 100%;
  min-height: 232px;
  border: none;
  background: #fff;
}

/* ---------- Exercício ---------- */
.exercise {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.1), rgba(22, 31, 61, 0.7));
  margin: 26px 0;
}

.exercise-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.exercise-head h3 {
  margin: 0;
  font-size: 1.12rem;
}

.exercise ol {
  margin-bottom: 16px;
}

.checks {
  list-style: none;
  margin: 0 0 16px 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text-soft);
  margin: 0;
}

.checks li .mark {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
}

.checks li.pass {
  color: #86efac;
}

.checks li.pass .mark {
  background: var(--ok);
  color: #04250f;
  border-color: var(--ok);
}

.checks li.fail .mark {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.6);
}

.hint {
  font-size: 0.87rem;
  color: #ffe97a;
  background: rgba(240, 219, 79, 0.08);
  border: 1px dashed rgba(240, 219, 79, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}

.feedback {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 12px;
  display: none;
}

.feedback.show {
  display: block;
}

.feedback.ok {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: #86efac;
}

.feedback.err {
  background: rgba(239, 68, 68, 0.13);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* ---------- Quiz ---------- */
.quiz {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg-soft);
  margin: 26px 0;
}

.quiz-q {
  font-weight: 700;
  margin-bottom: 14px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.quiz-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
  transition: 0.15s;
}

.quiz-opt:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--bg-elevated);
}

.quiz-opt .key {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.07);
}

.quiz-opt.correct {
  border-color: var(--ok);
  background: rgba(34, 197, 94, 0.16);
}

.quiz-opt.wrong {
  border-color: var(--err);
  background: rgba(239, 68, 68, 0.14);
}

.quiz-opt:disabled {
  cursor: default;
}

/* ---------- Navegação da aula ---------- */
.lesson-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

/* ---------- Perfil ---------- */
.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  padding: 30px;
}

.avatar {
  width: 104px;
  height: 104px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  background: linear-gradient(140deg, rgba(99, 102, 241, 0.4), rgba(34, 211, 238, 0.25));
  border: 2px solid var(--border);
  cursor: pointer;
  transition: 0.2s;
}

.avatar:hover {
  transform: scale(1.04);
  border-color: var(--brand);
}

.profile-name {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.level-badge {
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--gradient);
  color: #071022;
  font-size: 0.8rem;
  font-weight: 800;
}

.xp-bar {
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 12px 0 8px;
  border: 1px solid var(--border);
}

.xp-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gradient);
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.avatar-choice {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: 0.15s;
}

.avatar-choice:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.avatar-choice.active {
  border-color: var(--brand-2);
  background: rgba(34, 211, 238, 0.16);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat {
  text-align: center;
  padding: 18px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Conquistas ---------- */
.ach-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.ach {
  text-align: center;
  padding: 20px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-soft);
  opacity: 0.5;
  filter: grayscale(1);
  transition: 0.25s;
  position: relative;
}

.ach.unlocked {
  opacity: 1;
  filter: none;
  border-color: rgba(240, 219, 79, 0.5);
  background: linear-gradient(180deg, rgba(240, 219, 79, 0.12), rgba(22, 31, 61, 0.9));
  box-shadow: 0 0 0 1px rgba(240, 219, 79, 0.15), 0 12px 30px rgba(240, 219, 79, 0.12);
}

.ach-icon {
  font-size: 2.1rem;
  margin-bottom: 8px;
  display: block;
}

.ach h4 {
  font-size: 0.92rem;
  margin-bottom: 5px;
}

.ach p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.ach .lock {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.85rem;
  opacity: 0.65;
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 40px));
}

.toast {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: toastIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.ach-toast {
  border-color: rgba(240, 219, 79, 0.55);
  background: linear-gradient(140deg, rgba(240, 219, 79, 0.16), var(--bg-elevated));
}

.toast .t-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.toast strong {
  display: block;
  font-size: 0.92rem;
}

.toast span {
  font-size: 0.82rem;
  color: var(--text-soft);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Modal ---------- */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 18, 0.8);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  z-index: 300;
  padding: 20px;
}

.modal-back.open {
  display: grid;
}

.modal {
  width: min(560px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  flex-wrap: wrap;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-soft);
}

.field input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  outline: none;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  padding: 30px 0;
  margin-top: 50px;
  color: var(--text-muted);
  font-size: 0.87rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Utilitários ---------- */
.muted {
  color: var(--text-muted);
}
.center {
  text-align: center;
}
.mt-2 {
  margin-top: 14px;
}
.mb-2 {
  margin-bottom: 14px;
}
.flex {
  display: flex;
}
.gap {
  gap: 10px;
}
.wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.hidden {
  display: none !important;
}

.empty {
  padding: 26px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* ---------- Responsivo ---------- */
@media (max-width: 980px) {
  .lesson-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    max-height: none;
  }
  .grid-3,
  .grid-4,
  .ach-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pg-body {
    grid-template-columns: 1fr;
  }
  .pg-editors {
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
  }
  .profile-hero {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
  }
  .profile-name {
    justify-content: center;
  }
}

@media (max-width: 620px) {
  .navbar-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 0;
  }
  .nav-links {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .grid-2,
  .grid-3,
  .grid-4,
  .ach-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 44px 0 24px;
  }
  .lesson-body {
    padding: 22px 16px;
  }
}
