/* ==========================================================================
   GCP ACE Preparatório — Estilos
   Cores baseadas no site de referência gcp-ace.pages.dev
   ========================================================================== */

:root {
  --sec1: #2563eb;
  --sec2: #059669;
  --sec3: #ea580c;
  --sec4: #9333ea;

  --primary: #1e3a8a;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --radius: 12px;
  --radius-lg: 16px;
  --transition: all 0.25s ease;

  --nav-width: 280px;
  --header-height: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

ul, ol { list-style: none; }

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

code, kbd {
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.875em;
  color: var(--sec1);
  border: 1px solid var(--border);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Toast */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  white-space: nowrap;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== Tela de Login / Cadastro ===== */
.auth-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.brand-mark {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--sec1), var(--sec4));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1.25rem;
}

.auth-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.auth-form {
  display: none;
}
.auth-form.active {
  display: block;
}

.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.form-group input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--surface-2);
  transition: var(--transition);
}
.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
}

/* ===== Sidebar ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-name { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.5px; }
.brand-sub { font-size: 0.75rem; color: var(--text-muted); }

.btn-close-sidebar { font-size: 1.75rem; line-height: 1; color: var(--text-muted); }

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }

.nav-section { padding: 0 1.25rem; }
.nav-section-title {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-light); font-weight: 700; margin: 1.5rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.nav-section:first-child .nav-section-title { margin-top: 0; padding-top: 0; border-top: none; }

.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%; padding: 0.65rem 1rem;
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius);
  transition: var(--transition);
  text-align: left;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-item .nav-icon { font-size: 1.15rem; width: 24px; text-align: center; }
.nav-item .sec-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sec);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
  flex-shrink: 0;
}

.sidebar-user {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.75rem;
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--sec1), var(--sec4));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.9rem;
}
.user-info { flex: 1; }
.user-name { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.user-email { font-size: 0.75rem; color: var(--text-muted); }
.sidebar-user .btn-danger {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.sidebar-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.progress-card { }
.progress-card-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); font-weight: 700; margin-bottom: 0.5rem; }
.progress-bar-container { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 0.5rem; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--sec1), var(--sec4)); width: 0%; transition: width 0.5s ease; }
.progress-card-text { font-size: 0.8rem; color: var(--text-muted); }

/* Overlay */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.3);
  z-index: 90; display: none; backdrop-filter: blur(2px);
}

/* Page Container */
.page-container { display: flex; flex-direction: column; min-height: 100vh; }
.app-main { flex: 1; padding-top: var(--header-height); }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
}
.btn-toggle-sidebar {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 1.5rem; color: var(--text);
  border-radius: var(--radius);
  transition: var(--transition);
}
.btn-toggle-sidebar:hover { background: var(--surface-2); color: var(--primary); }

.header-title {
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  letter-spacing: -0.5px;
}

.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.btn-icon {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 1.25rem; color: var(--text-muted);
  border-radius: var(--radius); transition: var(--transition);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }
.user-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-muted);
}

/* Section badges */
.sec-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.7rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sec1 { background: #eff6ff; color: var(--sec1); border: 1px solid #bfdbfe; }
.sec2 { background: #f0fdfa; color: var(--sec2); border: 1px solid #86efac; }
.sec3 { background: #fff7ed; color: var(--sec3); border: 1px solid #fdba74; }
.sec4 { background: #faf5ff; color: var(--sec4); border: 1px solid #e9d5ff; }

.status-badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.status-nao-iniciado { background: #f1f5f9; color: #64748b; }
.status-estudando { background: #dbeafe; color: #1e40af; }
.status-em-revisao { background: #fef3c7; color: #92400e; }
.status-concluido { background: #dcfce7; color: #166534; }

.section-header {
  padding: 1.5rem 1.5rem 1rem;
  max-width: 1200px; margin: 0 auto; width: 100%;
}
.section-header h1 { font-size: 1.75rem; font-weight: 800; color: var(--text); margin-bottom: 0.25rem; }
.section-header p { color: var(--text-muted); font-size: 0.95rem; }

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 0 1.5rem 1.5rem;
  max-width: 1200px; margin: 0 auto; width: 100%;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.stat-card .stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-light); font-weight: 700; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text); }
.stat-card .stat-delta { font-size: 0.8rem; color: var(--text-muted); }
.stat-card .stat-icon { font-size: 1.75rem; }

/* Quick Actions */
.quick-actions {
  padding: 0 1.5rem 1.5rem;
  max-width: 1200px; margin: 0 auto; width: 100%;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.action-icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; }
.action-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text); }
.action-card p { font-size: 0.8rem; color: var(--text-muted); }

/* Cards Section */
.card-section { padding: 0 1.5rem 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.section-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-light); font-weight: 700; margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
}

/* Topics Grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.topic-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--sec1), var(--sec4));
}
.topic-card.sec1::before { background: var(--sec1); }
.topic-card.sec2::before { background: var(--sec2); }
.topic-card.sec3::before { background: var(--sec3); }
.topic-card.sec4::before { background: var(--sec4); }

.topic-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.topic-title { font-size: 0.95rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; line-height: 1.3; }
.topic-section { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.topic-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 0.6rem 1.2rem;
  border-radius: var(--radius); font-weight: 600;
  font-size: 0.9rem; transition: var(--transition);
  border: 1px solid transparent; cursor: pointer;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }

/* Topic Detail */
.topic-detail { padding: 0 1.5rem 2rem; max-width: 1000px; margin: 0 auto; width: 100%; }
.topic-nav {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap;
  padding: 0 1.5rem; max-width: 1000px; margin-left: auto; margin-right: auto;
}
.topic-header-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative; overflow: hidden;
}
.topic-header-detail::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px;
  background: linear-gradient(90deg, var(--sec1), var(--sec4));
}
.topic-header-detail.sec1::before { background: var(--sec1); }
.topic-header-detail.sec2::before { background: var(--sec2); }
.topic-header-detail.sec3::before { background: var(--sec3); }
.topic-header-detail.sec4::before { background: var(--sec4); }

.topic-meta-bar {
  display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.topic-meta-item { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-muted); }

.topic-body { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 900px) {
  .topic-body { grid-template-columns: 1fr 360px; }
}

.content-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.content-panel h3 {
  font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.content-panel h3 .emoji { font-size: 1.25rem; }
.content-panel p { color: var(--text-muted); margin-bottom: 0.75rem; line-height: 1.7; }
.content-panel ul { margin-bottom: 0.75rem; padding-left: 1.2rem; }
.content-panel li { margin-bottom: 0.5rem; color: var(--text); position: relative; }
.content-panel li::before { content: '▸'; position: absolute; left: -1.1rem; color: var(--primary); font-weight: 700; }
.content-panel blockquote {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
  padding: 0.75rem 1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
  font-style: italic; color: var(--text);
}
.content-panel code { font-size: 0.85em; }

.command-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0.75rem 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
  border: 1px solid #1e293b;
}
.command-box .cmd-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: #94a3b8; margin-bottom: 0.5rem; display: block;
}

.sidebar-panel {
  display: flex; flex-direction: column; gap: 1rem;
}
.study-controls {
  display: flex; gap: 0.5rem; margin-bottom: 1rem;
}
.study-controls .btn { flex: 1; }

/* Flashcards */
.flashcard-page { padding: 0 1.5rem 2rem; max-width: 1000px; margin: 0 auto; width: 100%; }
.fc-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; padding: 0 1.5rem;
  flex-wrap: wrap; gap: 1rem;
}
.fc-stats { display: flex; gap: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.fc-stat { display: flex; align-items: center; gap: 0.4rem; font-weight: 600; color: var(--text); }

.fc-stage {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 1.5rem 2rem;
}
.fc-counter { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.5rem; font-weight: 600; }

.fc-card-wrapper {
  perspective: 1000px;
  width: 100%; max-width: 420px;
  height: 320px;
  position: relative;
  margin-bottom: 1.5rem;
}
.fc-card {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}
.fc-card.flipped { transform: rotateY(180deg); }

.fc-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  display: flex; flex-direction: column;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-sizing: border-box;
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.fc-face.front { background: linear-gradient(135deg, var(--primary), var(--primary-hover)); z-index: 2; }
.fc-face.back {
  background: linear-gradient(135deg, var(--sec1), var(--sec4));
  transform: rotateY(180deg);
}

.fc-topic { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; opacity: 0.9; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.fc-question { font-size: 1.3rem; font-weight: 700; line-height: 1.4; }
.fc-answer { font-size: 1.1rem; line-height: 1.6; color: rgba(255,255,255,0.95); }
.fc-hint { font-size: 0.9rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.3); opacity: 0.9; }

.fc-actions {
  display: flex; gap: 0.5rem; padding: 0 1.5rem 1rem;
  justify-content: center; flex-wrap: wrap;
}
.fc-btn {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}
.fc-btn:hover { transform: scale(1.05); }
.fc-errei { background: var(--danger); }
.fc-dificil { background: var(--warning); color: #7c3a00; }
.fc-acertou { background: var(--success); }
.fc-facil { background: #10b981; }

.fc-empty {
  text-align: center; padding: 3rem; color: var(--text-muted);
}

/* Simulado */
.practice-page { padding: 0 1.5rem 2rem; max-width: 1000px; margin: 0 auto; width: 100%; }
.practice-controls {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  margin-bottom: 1.5rem; padding: 0 1.5rem;
}
.practice-progress {
  padding: 0 1.5rem; margin-bottom: 1rem;
}
.practice-bar-container { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; margin-bottom: 0.5rem; }
.practice-bar { height: 100%; background: linear-gradient(90deg, var(--sec1), var(--sec4)); width: 0%; transition: width 0.3s ease; }

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.question-meta { font-size: 0.8rem; color: var(--text-light); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.question-text { font-size: 1.15rem; font-weight: 700; color: var(--text); line-height: 1.6; margin-bottom: 1.5rem; }
.options-list { display: grid; gap: 0.75rem; }
.option-btn {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; padding: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left; font-size: 1rem; font-weight: 500;
  transition: var(--transition); cursor: pointer;
}
.option-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.option-btn.selected { border-color: var(--primary); background: var(--primary-light); }
.option-btn.correct { border-color: var(--success); background: #dcfce7; color: var(--success); }
.option-btn.wrong { border-color: var(--danger); background: #fee2e2; color: var(--danger); }
.option-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted);
  font-weight: 800; font-size: 0.9rem; display: grid; place-items: center; flex-shrink: 0;
}

.answer-feedback {
  margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem;
}
.answer-feedback h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text); }
.answer-feedback p { font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

.practice-actions {
  display: flex; gap: 0.75rem; justify-content: center;
  padding: 1rem 1.5rem; flex-wrap: wrap;
}

.practice-empty, .result-screen {
  text-align: center; padding: 4rem 1rem; color: var(--text-muted);
}
.result-screen h2 { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; color: var(--text); }
.result-score { font-size: 3.5rem; font-weight: 900; margin: 1rem 0; }
.result-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }

/* Labs */
.labs-page { padding: 0 1.5rem 2rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.labs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}
.lab-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: var(--transition);
}
.lab-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border); }
.lab-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.lab-title { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.lab-sec { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.lab-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.lab-steps { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }
.lab-steps b { color: var(--text); }
.lab-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }

/* Caderno */
.caderno-page { padding: 0 1.5rem 2rem; max-width: 1000px; margin: 0 auto; width: 100%; }
.caderno-empty {
  text-align: center; padding: 4rem 1rem; color: var(--text-muted);
}

/* Backup */
.backup-page { padding: 0 1.5rem 2rem; max-width: 700px; margin: 0 auto; width: 100%; }
.backup-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.backup-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* Sobre */
.sobre-page { padding: 0 1.5rem 2rem; max-width: 700px; margin: 0 auto; width: 100%; }

/* Modals */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal.open { opacity: 1; visibility: visible; }
.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 560px;
  max-height: 85vh; overflow-y: auto;
  transform: translateY(30px); transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.modal.open .modal-content { transform: translateY(0); }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.modal-close { font-size: 1.75rem; line-height: 1; color: var(--text-muted); }

/* Install PWA Prompt */
.install-prompt {
  position: fixed;
  bottom: 2rem;
  left: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}
.install-icon { font-size: 1.5rem; }
.install-content { flex: 1; }
.install-content > div:first-child { font-weight: 700; color: var(--text); }
.install-content > div:last-child { font-size: 0.8rem; color: var(--text-muted); }
.install-prompt .btn-sm { font-size: 0.8rem; padding: 0.5rem 1rem; }

/* Responsive */
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .topic-body { grid-template-columns: 1fr; }
  .nav-section-title { margin-top: 1rem; padding-top: 0.75rem; }
  .fc-question { font-size: 1.1rem; }
  .fc-card-wrapper { height: 280px; }
  .header-actions { gap: 0.25rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .action-grid { grid-template-columns: 1fr; }
  .fc-card-wrapper { height: 260px; }
  .fc-card { height: 260px; }
}

/* Utility */
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.hidden { display: none !important; }

/* Dark theme (reservado) */
body.dark {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #334155;
}
