/* ==========================================================================
   RESET & VARIÁVEIS
   ========================================================================== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --bg: #f7f7f9;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef0f4;
  --text: #1a1b23;
  --text-muted: #63636f;
  --border: #e2e3e9;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef0ff;
  --success: #16a34a;
  --success-soft: #e8f8ee;
  --danger: #dc2626;
  --danger-soft: #fdeceb;
  --warning: #d97706;
  --warning-soft: #fef3e2;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 40, 0.06);
  --shadow: 0 4px 16px rgba(20, 20, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(20, 20, 40, 0.14);
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #14151c;
  --bg-elevated: #1c1e28;
  --bg-subtle: #23252f;
  --text: #eef0f6;
  --text-muted: #9a9cae;
  --border: #2d2f3b;
  --primary: #818cf8;
  --primary-dark: #6366f1;
  --primary-soft: #262a4a;
  --success: #4ade80;
  --success-soft: #163524;
  --danger: #f87171;
  --danger-soft: #3a1f22;
  --warning: #fbbf24;
  --warning-soft: #3a2e14;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14151c;
    --bg-elevated: #1c1e28;
    --bg-subtle: #23252f;
    --text: #eef0f6;
    --text-muted: #9a9cae;
    --border: #2d2f3b;
    --primary: #818cf8;
    --primary-dark: #6366f1;
    --primary-soft: #262a4a;
    --success: #4ade80;
    --success-soft: #163524;
    --danger: #f87171;
    --danger-soft: #3a1f22;
    --warning: #fbbf24;
    --warning-soft: #3a2e14;
  }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
a { color: var(--primary); text-decoration: none; }

.hidden { display: none !important; }

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */
#app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
  font-weight: 700;
  font-size: 17px;
}
.brand-logo { font-size: 22px; }

.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-size: 14.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--bg-subtle); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary-dark); }
.nav-item .nav-icon { font-size: 18px; width: 22px; text-align: center; }

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-title { font-size: 18px; font-weight: 700; }

.topbar-badges { display: flex; align-items: center; gap: 10px; }

.badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--bg-subtle);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-streak { background: var(--warning-soft); color: var(--warning); }
.badge-xp { background: var(--primary-soft); color: var(--primary-dark); }

.lang-toggle { display: flex; gap: 6px; background: var(--bg-subtle); border-radius: 999px; padding: 3px; }
.lang-toggle-btn {
  border: none; background: none; padding: 6px 12px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--text-muted);
}
.lang-toggle-btn.active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-sm); }

.view {
  flex: 1;
  padding: 26px 28px 100px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}

.hamburger-btn { display: none; background: none; border: none; font-size: 22px; }

.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
}
.bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; color: var(--text-muted); font-size: 11px;
  padding: 6px 8px; border-radius: var(--radius-sm); font-weight: 600;
}
.bottom-nav-item.active { color: var(--primary); }
.bottom-nav-item .nav-icon { font-size: 20px; }

@media (max-width: 860px) {
  .sidebar { display: none; }
  .bottom-nav { display: flex; }
  .view { padding: 18px 16px 90px; }
  .hamburger-btn { display: inline-flex; }
}

/* ==========================================================================
   BOTÕES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-subtle); color: var(--text); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: none; color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 24px; font-size: 16px; }
.icon-btn {
  background: var(--bg-subtle); border: none; border-radius: 999px;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}

/* ==========================================================================
   CARDS GENÉRICOS
   ========================================================================== */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.card-sub { color: var(--text-muted); font-size: 13.5px; }

.section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 14px;
}
.section-title:first-child { margin-top: 0; }

.page-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-muted); margin-top: 4px; font-size: 15px; }

/* ==========================================================================
   PROGRESS BAR
   ========================================================================== */
.progress-bar {
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.5s ease;
}
.progress-fill.success { background: var(--success); }
.progress-fill.warning { background: var(--warning); }

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.dashboard-greeting { margin-bottom: 22px; }
.dashboard-greeting h1 { font-size: 25px; font-weight: 800; }
.dashboard-greeting p { color: var(--text-muted); margin-top: 4px; }

.lang-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
@media (max-width: 640px) { .lang-cards { grid-template-columns: 1fr; } }

.lang-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lang-card-head { display: flex; align-items: center; justify-content: space-between; }
.lang-card-flag { font-size: 26px; }
.lang-card-name { font-weight: 700; font-size: 16px; }
.lang-card-level {
  font-size: 12px; font-weight: 700; color: var(--primary-dark);
  background: var(--primary-soft); padding: 3px 9px; border-radius: 999px;
}
.lang-card-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); }
.lang-card-streak { font-size: 13px; font-weight: 600; color: var(--warning); }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
@media (max-width: 720px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: left;
}
.stat-tile-value { font-size: 21px; font-weight: 800; }
.stat-tile-label { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.goal-card { margin-bottom: 24px; }
.goal-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.goal-row strong { font-size: 14px; }
.goal-row span { font-size: 13px; color: var(--text-muted); }

.recommend-list { display: flex; flex-direction: column; gap: 10px; }
.recommend-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 100%;
  text-align: left;
  transition: box-shadow 0.15s, transform 0.1s;
}
.recommend-item:hover { box-shadow: var(--shadow); }
.recommend-item:active { transform: scale(0.99); }
.recommend-icon { font-size: 22px; }
.recommend-text { flex: 1; }
.recommend-title { font-weight: 600; font-size: 14.5px; }
.recommend-sub { font-size: 12.5px; color: var(--text-muted); }

/* ==========================================================================
   TRILHA / CURSO
   ========================================================================== */
.module-block { margin-bottom: 26px; }
.module-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.module-status-icon { font-size: 18px; }
.module-title { font-weight: 700; font-size: 16.5px; }
.module-progress-text { font-size: 12.5px; color: var(--text-muted); margin-left: auto; }

.lesson-list { display: flex; flex-direction: column; gap: 8px; padding-left: 6px; border-left: 2px solid var(--border); margin-left: 12px; }
.lesson-node {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-left: 10px;
  width: calc(100% - 10px);
  text-align: left;
}
.lesson-node:hover:not(:disabled) { box-shadow: var(--shadow); }
.lesson-node:disabled { opacity: 0.55; cursor: not-allowed; }
.lesson-node.completed { border-color: var(--success); }
.lesson-node.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.lesson-node-icon { font-size: 20px; width: 24px; text-align: center; }
.lesson-node-title { font-weight: 600; font-size: 14.5px; }
.lesson-node-sub { font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   AULA (fluxo)
   ========================================================================== */
.lesson-flow-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.step-dots { display: flex; gap: 6px; flex: 1; }
.step-dot { height: 5px; flex: 1; border-radius: 999px; background: var(--bg-subtle); }
.step-dot.done { background: var(--success); }
.step-dot.active { background: var(--primary); }

.lesson-intro-card { text-align: center; padding: 36px 24px; }
.lesson-intro-icon { font-size: 40px; margin-bottom: 10px; }
.lesson-intro-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.lesson-intro-objective { color: var(--text-muted); margin-bottom: 20px; }

.note-card {
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 10px 0;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.note-card.tip { background: var(--success-soft); color: var(--text); }
.note-card.warning { background: var(--warning-soft); color: var(--text); }
.note-icon { font-size: 18px; }

.flashcard-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.flashcard {
  width: 100%;
  max-width: 460px;
  min-height: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.2s;
}
.flashcard:active { transform: scale(0.99); }
.flashcard-lang { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; }
.flashcard-front { font-size: 26px; font-weight: 800; }
.flashcard-back { font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.flashcard-example { font-size: 14px; color: var(--text-muted); font-style: italic; margin-top: 6px; }
.flashcard-example-translation { font-size: 13px; color: var(--text-muted); }
.flashcard-hint { font-size: 12.5px; color: var(--text-muted); }

.rating-row { display: flex; gap: 10px; width: 100%; max-width: 460px; }
.rating-btn {
  flex: 1;
  padding: 14px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-weight: 700;
  font-size: 13.5px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.rating-btn .rating-emoji { font-size: 20px; }
.rating-btn.again:hover { border-color: var(--danger); color: var(--danger); }
.rating-btn.good:hover { border-color: var(--warning); color: var(--warning); }
.rating-btn.easy:hover { border-color: var(--success); color: var(--success); }

.progress-counter { font-size: 13px; color: var(--text-muted); text-align: center; }

/* ==========================================================================
   EXERCÍCIOS
   ========================================================================== */
.exercise-card { padding: 26px; }
.ex-prompt { font-size: 19px; font-weight: 700; margin-bottom: 18px; }
.ex-options { display: flex; flex-direction: column; gap: 10px; }
.ex-option-btn {
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.ex-option-btn:hover:not(:disabled) { border-color: var(--primary); }
.ex-option-btn:disabled { cursor: default; }
.ex-option-btn.is-correct { border-color: var(--success); background: var(--success-soft); }
.ex-option-btn.is-wrong { border-color: var(--danger); background: var(--danger-soft); }

.ex-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.ex-input-row { display: flex; gap: 10px; }
.ex-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
.ex-input:focus { border-color: var(--primary); }

.ex-bank, .ex-built {
  display: flex; flex-wrap: wrap; gap: 8px; min-height: 44px;
  padding: 10px; border-radius: var(--radius); background: var(--bg-subtle);
}
.ex-built { margin-bottom: 4px; background: none; border: 1.5px dashed var(--border); }
.ex-chip {
  padding: 9px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg-elevated); font-size: 14.5px; font-weight: 600;
}
.ex-chip:hover:not(:disabled) { border-color: var(--primary); }
.ex-chip-built { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); }

.ex-feedback { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); }
.ex-feedback-correct { background: var(--success-soft); }
.ex-feedback-wrong { background: var(--danger-soft); }
.ex-feedback-title { font-weight: 700; margin-bottom: 4px; }
.ex-explain { font-size: 13.5px; color: var(--text-muted); }

.exercise-footer { display: flex; justify-content: flex-end; margin-top: 18px; }

/* ==========================================================================
   CONVERSAÇÃO
   ========================================================================== */
.conv-line { display: flex; gap: 10px; margin-bottom: 12px; align-items: flex-start; }
.conv-line.speaker-b { flex-direction: row-reverse; }
.conv-bubble {
  background: var(--bg-subtle);
  border-radius: var(--radius);
  padding: 12px 14px;
  max-width: 78%;
}
.conv-line.speaker-b .conv-bubble { background: var(--primary-soft); }
.conv-bubble-text { font-weight: 600; font-size: 14.5px; }
.conv-bubble-translation { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }
.conv-speak-btn { flex-shrink: 0; }

.chat-window { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.chat-input-row { display: flex; gap: 10px; }

/* ==========================================================================
   PROFESSOR IA
   ========================================================================== */
.tutor-offline-banner {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--warning-soft); color: var(--text);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-size: 13.5px;
}
.correction-card {
  background: var(--danger-soft); border: 1px solid var(--danger);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; font-size: 13.5px;
}
.correction-row { margin-bottom: 4px; }
.correction-label { font-weight: 700; }
.correction-explain-btn { margin-top: 6px; }
.typing-indicator { display: flex; gap: 4px; padding: 10px 14px; }
.typing-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--text-muted);
  animation: typingBounce 1s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

.eval-score-row { margin-bottom: 12px; }
.eval-score-label { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.eval-list { text-align: left; margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; }
.eval-list li { margin-bottom: 4px; }
.difficulty-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-dark); padding: 3px 10px; border-radius: 999px;
}

/* ==========================================================================
   GRAMÁTICA
   ========================================================================== */
.grammar-card { margin-bottom: 16px; }
.grammar-table-wrap { overflow-x: auto; margin: 12px 0; }
.grammar-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.grammar-table th, .grammar-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.grammar-table th { background: var(--bg-subtle); font-weight: 700; }
.grammar-examples { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.grammar-example-row { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-style: italic; }

/* ==========================================================================
   VOCABULÁRIO / CATEGORIAS / SITUAÇÕES
   ========================================================================== */
.category-grid, .situation-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 720px) { .category-grid, .situation-grid { grid-template-columns: repeat(2, 1fr); } }
.category-tile, .situation-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.category-tile:hover, .situation-tile:hover { box-shadow: var(--shadow); }
.category-tile-icon, .situation-tile-icon { font-size: 28px; }
.category-tile-label, .situation-tile-label { font-weight: 700; font-size: 13.5px; }
.category-tile-count { font-size: 12px; color: var(--text-muted); }

.phrase-list { display: flex; flex-direction: column; gap: 10px; }
.phrase-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 16px;
}
.phrase-target { font-weight: 700; font-size: 15px; }
.phrase-pt { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.vocab-card-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 16px; margin-bottom: 8px;
}
.vocab-card-front { font-weight: 700; }
.vocab-card-back { font-size: 13.5px; color: var(--text-muted); }
.mastery-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }

/* ==========================================================================
   ONBOARDING
   ========================================================================== */
.onboarding-screen {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px;
  text-align: center;
}
.onboarding-inner { max-width: 480px; width: 100%; }
.onboarding-emoji { font-size: 48px; margin-bottom: 14px; }
.onboarding-title { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.onboarding-sub { color: var(--text-muted); margin-bottom: 28px; }
.onboarding-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.onboarding-option {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: var(--radius); border: 1.5px solid var(--border);
  background: var(--bg-elevated); text-align: left; font-weight: 600;
}
.onboarding-option:hover { border-color: var(--primary); }
.onboarding-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.onboarding-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 26px; }
.onboarding-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--bg-subtle); }
.onboarding-dot.active { background: var(--primary); }

/* ==========================================================================
   MODAL / TOAST
   ========================================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 20, 0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 440px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.18s ease;
}
.modal-title { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.sheet-list { display: flex; flex-direction: column; gap: 4px; }
.sheet-item {
  display: flex; align-items: center; gap: 14px; padding: 12px 10px;
  border-radius: var(--radius-sm); background: none; border: none; width: 100%; text-align: left;
  font-size: 15px; font-weight: 600; color: var(--text);
}
.sheet-item:hover { background: var(--bg-subtle); }

.toast-root { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  border-radius: var(--radius); padding: 12px 18px; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
  animation: slideIn 0.2s ease;
}
.toast-xp { color: var(--primary-dark); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes confettiFall { from { transform: translateY(-20px) rotate(0deg); opacity: 1; } to { transform: translateY(340px) rotate(360deg); opacity: 0; } }

.confetti-piece {
  position: absolute; top: 0; width: 8px; height: 14px; border-radius: 2px;
  animation: confettiFall 1.6s ease-in forwards;
}

/* ==========================================================================
   RESUMO DE AULA / CONQUISTAS
   ========================================================================== */
.summary-card { text-align: center; padding: 40px 24px; position: relative; overflow: hidden; }
.summary-emoji { font-size: 52px; margin-bottom: 12px; }
.summary-title { font-size: 24px; font-weight: 800; margin-bottom: 6px; }
.summary-score { font-size: 16px; color: var(--text-muted); margin-bottom: 20px; }
.summary-stats { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.summary-stat-value { font-size: 22px; font-weight: 800; color: var(--primary-dark); }
.summary-stat-label { font-size: 12px; color: var(--text-muted); }

/* ==========================================================================
   UTILITÁRIOS
   ========================================================================== */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state-emoji { font-size: 38px; margin-bottom: 10px; }

.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  gap: 16px;
}
.settings-row:last-child { border-bottom: none; }
.settings-label { font-weight: 600; font-size: 14.5px; }
.settings-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.toggle-switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--bg-subtle); border-radius: 999px;
  transition: background 0.2s; cursor: pointer; border: 1px solid var(--border);
}
.toggle-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: var(--shadow-sm);
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

select.select-input {
  padding: 9px 12px; border-radius: var(--radius-sm); border: 1.5px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 14px;
}

.pill-group { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-btn {
  padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--border);
  background: var(--bg-elevated); font-size: 13.5px; font-weight: 600; color: var(--text-muted);
}
.pill-btn.active { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }
