/* SimulaApp - Visual Clean Minimalista (PC & Mobile) */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --accent: #10b981;
  --accent-soft: #ecfdf5;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

/* Header */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.brand-text h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-text span {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

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

.timer-pill {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  font-variant-numeric: tabular-nums;
}

.timer-pill.active {
  display: inline-flex;
}

/* Main Container */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.crumb-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.crumb-btn:hover {
  background: var(--primary-soft);
}

.crumb-current {
  font-weight: 700;
  color: var(--text);
}

/* Hero Banner */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 60%, #059669 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.hero h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 650px;
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Responsive Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

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

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
}

.card.clickable {
  cursor: pointer;
}

.card.clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #93c5fd;
}

.card.disabled {
  opacity: 0.72;
  background: #f8fafc;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.folder-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.folder-icon.green {
  background: var(--accent-soft);
  color: var(--accent);
}

.folder-icon.muted {
  background: var(--surface-alt);
  color: var(--text-muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.pill-blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.pill-green {
  background: var(--accent-soft);
  color: #047857;
}

.pill-gray {
  background: var(--surface-alt);
  color: var(--text-muted);
}

.pill-amber {
  background: var(--warning-soft);
  color: #b45309;
}

.card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.card p {
  font-size: 13.5px;
  color: var(--text-muted);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--surface-alt);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* Progress Bar */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--surface-alt);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #059669;
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--surface-alt);
}

.btn-danger-soft {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid #fecaca;
}

.btn-danger-soft:hover {
  background: #fee2e2;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

/* Action Bar inside Lesson */
.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

/* Quiz Layout */
.quiz-wrapper {
  max-width: 820px;
  margin: 0 auto;
}

.quiz-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
}

.question-source {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.question-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  white-space: pre-line;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: all 0.15s ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.option-btn:disabled {
  cursor: default;
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.option-btn.correct {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-btn.correct .option-letter {
  background: var(--accent);
  color: #fff;
}

.option-btn.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.option-btn.wrong .option-letter {
  background: var(--danger);
  color: #fff;
}

/* Feedback Box */
.feedback-box {
  margin-top: 20px;
  border-radius: var(--radius-sm);
  padding: 18px;
  animation: fadeIn 0.2s ease;
}

.feedback-box.correct {
  background: var(--accent-soft);
  border: 1px solid #a7f3d0;
}

.feedback-box.wrong {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
}

.feedback-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-box.correct .feedback-title {
  color: #065f46;
}

.feedback-box.wrong .feedback-title {
  color: #991b1b;
}

.feedback-body {
  font-size: 14px;
  color: #1e293b;
  margin-bottom: 10px;
}

.feedback-trap {
  background: rgba(255, 255, 255, 0.78);
  border-left: 3px solid var(--warning);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13.5px;
  color: #78350f;
}

.quiz-nav {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Report View */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.stat-green { color: var(--accent); }
.stat-red { color: var(--danger); }
.stat-blue { color: var(--primary); }

.review-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}

.review-item.is-correct {
  border-left: 4px solid var(--accent);
}

.review-item.is-wrong {
  border-left: 4px solid var(--danger);
}

/* Study Guide / Quadro de Memorização */
.study-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.study-card h3 {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 14px;
}

.article-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-alt);
  font-size: 14px;
}

.article-item:last-child {
  border-bottom: none;
}

.table-scroll {
  overflow-x: auto;
}

table.study-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.study-table th,
table.study-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

table.study-table th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--text);
}

.mnemonic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .mnemonic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.mnemonic-box {
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 14px;
}

.mnemonic-box strong {
  display: block;
  color: var(--primary);
  margin-bottom: 4px;
  font-size: 14.5px;
}

.mnemonic-box p {
  font-size: 13.5px;
  color: var(--text);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
