/* ============================================================
   ConcurseIA — Design System (Light Theme)
   ============================================================ */
@import '_variables.css?v=3';

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--c-bg5); border-radius: var(--radius-full); }
::-webkit-scrollbar-track { background: transparent; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ── Utility ───────────────────────────────────────────────── */
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.grid   { display: grid; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-4); }
.center   { text-align: center; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full   { width: 100%; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4  { padding: var(--space-4); }
.hidden   { display: none !important; }
.relative { position: relative; }
.overflow-y { overflow-y: auto; }
.min-h-screen { min-height: 100vh; }

/* ── App Shell ─────────────────────────────────────────────── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  background: var(--c-bg1);
  border-right: 0.5px solid var(--c-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.25s ease;
}
.sidebar-logo {
  padding: 18px 16px 14px;
  border-bottom: 0.5px solid var(--c-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--c-blue);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 16px; height: 16px; fill: white; stroke: white; }
.logo-text { font-size: 16px; font-weight: 600; color: var(--c-text); letter-spacing: -0.3px; }
.logo-text em { color: var(--c-blue); font-style: normal; }

.sidebar-nav { flex: 1; padding: 8px; }
.nav-section-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--c-text4);
  padding: 12px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  color: var(--c-text2);
  font-size: 13px; font-weight: 400;
  border: none; background: none; width: 100%;
  text-align: left; margin-bottom: 1px;
  transition: background .12s, color .12s;
}
.nav-item .ti { font-size: 14px; opacity: .7; flex-shrink: 0; }
.nav-item svg { width: 14px; height: 14px; opacity: .7; flex-shrink: 0; }
.nav-item:hover { color: var(--c-text); background: var(--c-bg4); }
.nav-item.active { color: var(--c-blue); background: var(--c-blue-bg); font-weight: 500; }
.nav-item.active .ti { opacity: 1; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 700;
  background: var(--c-red-bg); color: var(--c-red);
  padding: 2px 7px; border-radius: var(--radius-full);
  border: 1px solid var(--c-red-bd);
}
.nav-badge.blue {
  background: var(--c-blue-bg); color: var(--c-blue);
  border-color: var(--c-blue-bd);
}

/* Rodapé de perfil/logout da sidebar removido — perfil e logout vivem no
   painel "Minha Conta" (avatar do topbar). .sidebar-nav (flex:1) ocupa o
   espaço restante naturalmente. */

.hamburger {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-md); background: none; color: var(--c-text2);
}
.hamburger svg { width: 18px; height: 18px; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35); z-index: 99;
}

/* ── Main Layout ───────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-w));
}

/* ── Topbar ────────────────────────────────────────────────── */
#topbar { min-height: var(--topbar-h); }

.topbar {
  height: var(--topbar-h);
  background: var(--c-bg1);
  border-bottom: 0.5px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 40;
  flex-shrink: 0;
}
.topbar-greeting {
  font-size: 14px; font-weight: 500; color: var(--c-text);
}
.topbar-greeting span { color: var(--c-text2); font-weight: 400; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--c-text3); }
.breadcrumb .crumb-current { color: var(--c-text); font-weight: 500; }
.breadcrumb-sep { width: 12px; height: 12px; opacity: .4; }

.timer-pill {
  display: none; align-items: center; gap: 4px;
  background: var(--c-amber-bg); border: 0.5px solid var(--c-amber-bd);
  color: var(--c-amber-l); padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.timer-pill.show { display: flex; }
.timer-pill svg { width: 12px; height: 12px; }

.api-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-full);
  background: var(--c-bg3); border: 0.5px solid var(--c-border2);
  font-size: 11px; color: var(--c-text3); cursor: pointer;
  transition: all .15s;
}
.api-status-pill .status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-amber); transition: background .2s;
}
.api-status-pill.ready { border-color: var(--c-green-bd); background: var(--c-green-bg); color: var(--c-green-l); }
.api-status-pill.ready .status-dot { background: var(--c-green); }
.api-status-pill.pending { border-color: var(--c-amber-bd); background: var(--c-amber-bg); color: var(--c-amber-l); }
.api-status-pill.pending .status-dot { background: var(--c-amber); }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  border: 0.5px solid var(--c-border2); background: none;
  color: var(--c-text2); display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.icon-btn:hover { background: var(--c-bg4); color: var(--c-text); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn .ti { font-size: 17px; }

/* ── Content ───────────────────────────────────────────────── */
.content { flex: 1; padding: 28px 28px 64px; overflow-y: auto; }

.page { display: none; animation: fadeUp .2s ease both; }
.page.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-title { font-size: 20px; font-weight: 600; color: var(--c-text); letter-spacing: -0.3px; }
.page-subtitle { font-size: 13px; color: var(--c-text3); margin-top: 2px; margin-bottom: 20px; }
.section-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--c-text3);
  font-weight: 600; margin-bottom: 10px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--c-bg2);
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-sm { padding: var(--space-4); border-radius: var(--radius-md); }

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
  background: var(--c-bg2);
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.stat-card.blue::after  { background: var(--c-blue); }
.stat-card.green::after { background: var(--c-green); }
.stat-card.amber::after { background: var(--c-amber); }
.stat-card.red::after   { background: var(--c-red); }
.stat-label { font-size: 12px; font-weight: 500; color: var(--c-text3); margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1; }
.stat-sub   { font-size: 11.5px; color: var(--c-text3); margin-top: 4px; }
.stat-card.blue  .stat-value { color: var(--c-blue); }
.stat-card.green .stat-value { color: var(--c-green-l); }
.stat-card.amber .stat-value { color: var(--c-amber-l); }
.stat-card.red   .stat-value { color: var(--c-red-l); }

.chart-card { background: var(--c-bg2); border: 0.5px solid var(--c-border2); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); }
.chart-card h4 { font-size: 13.5px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.chart-wrap { position: relative; height: 200px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-md);
  border: 0.5px solid var(--c-border2); background: var(--c-bg3);
  color: var(--c-text2); font-size: 13px; font-weight: 500;
  transition: all .12s;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn .ti { font-size: 15px; }
.btn:hover { background: var(--c-bg4); color: var(--c-text); border-color: var(--c-border3); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: #fff; }
.btn-primary:disabled { background: var(--c-bg5); border-color: var(--c-bg5); color: var(--c-text4); cursor: not-allowed; }
.btn-success { background: var(--c-green-bg); border-color: var(--c-green-bd); color: var(--c-green-l); }
.btn-danger  { background: var(--c-red-bg);   border-color: var(--c-red-bd);   color: var(--c-red-l); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ── Tags ──────────────────────────────────────────────────── */
.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 5px 14px; border-radius: var(--radius-full);
  border: 0.5px solid var(--c-border2); color: var(--c-text3);
  font-size: 13px; cursor: pointer;
  background: var(--c-bg3);
  transition: all .12s; user-select: none;
}
.tag:hover { border-color: var(--c-blue-bd); color: var(--c-blue); background: var(--c-blue-bg); }
.tag.sel { border-color: var(--c-blue); color: var(--c-blue); background: var(--c-blue-bg); font-weight: 500; }

/* ── Toggle ────────────────────────────────────────────────── */
.toggle {
  width: 36px; height: 20px; border-radius: var(--radius-full);
  background: var(--c-bg5); position: relative; cursor: pointer;
  border: none; flex-shrink: 0; transition: background .2s;
}
.toggle.on { background: var(--c-blue); }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle.on::after { transform: translateX(16px); }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0; border-bottom: 0.5px solid var(--c-border);
}
.toggle-row:last-child { border: none; padding-bottom: 0; }
.toggle-row span { font-size: 13px; color: var(--c-text2); }

/* ── Wizard ────────────────────────────────────────────────── */
.wizard { display: flex; align-items: center; margin-bottom: 24px; overflow-x: auto; }
.ws { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ws-num {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1.5px solid var(--c-border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--c-text3);
  transition: all .2s;
}
.ws-lbl { font-size: 13px; color: var(--c-text3); white-space: nowrap; }
.ws.active .ws-num { border-color: var(--c-blue); color: var(--c-blue); background: var(--c-blue-bg); }
.ws.active .ws-lbl { color: var(--c-text); font-weight: 500; }
.ws.done .ws-num { border-color: var(--c-green); background: var(--c-green); color: #fff; font-size: 10px; }
.ws.done .ws-lbl { color: var(--c-green-l); }
.ws-line { flex: 1; height: 1px; background: var(--c-border2); margin: 0 8px; min-width: 16px; }
.ws-line.done { background: var(--c-green); }

/* ── Upload Zone ───────────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed var(--c-border2); border-radius: var(--radius-lg);
  padding: 40px 24px; text-align: center; cursor: pointer;
  transition: all .2s; position: relative; display: block;
  background: var(--c-bg3);
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--c-blue); background: var(--c-blue-bg); }
.upload-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-zone svg.upload-ico { width: 40px; height: 40px; margin: 0 auto 12px; display: block; color: var(--c-blue); opacity: .6; }
.upload-zone h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.upload-zone p { font-size: 13px; color: var(--c-text3); }
.ext-badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 4px; background: var(--c-bg5); color: var(--c-text2); border: 0.5px solid var(--c-border2); margin: 2px; }

.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--c-bg3); border: 0.5px solid var(--c-border);
  border-radius: var(--radius-md); padding: 12px 16px;
}
.file-ext {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; flex-shrink: 0;
}
.file-ext.pdf  { background: var(--c-red-bg);  color: var(--c-red-l);  border: 0.5px solid var(--c-red-bd); }
.file-ext.docx { background: var(--c-blue-bg); color: var(--c-blue-l); border: 0.5px solid var(--c-blue-bd); }
.file-info { flex: 1; min-width: 0; }
.file-name { font-size: 13px; font-weight: 500; }
.file-size { font-size: 11px; color: var(--c-text3); margin-top: 1px; }
.file-rm { background: none; border: none; color: var(--c-text3); font-size: 18px; padding: 4px; transition: color .12s; line-height: 1; }
.file-rm:hover { color: var(--c-red); }

/* ── Config Grid ───────────────────────────────────────────── */
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.config-block { background: var(--c-bg3); border: 0.5px solid var(--c-border); border-radius: var(--radius-lg); padding: 20px; }
.config-label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--c-text3); font-weight: 600; margin-bottom: 16px; display: block; }
.qty-row { display: flex; align-items: center; gap: 16px; }
.qty-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 0.5px solid var(--c-border2); background: none;
  color: var(--c-text); font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.qty-btn:hover { border-color: var(--c-blue); color: var(--c-blue); background: var(--c-blue-bg); }
.qty-val { font-size: 26px; font-weight: 700; min-width: 44px; text-align: center; }

/* ── Summary Card ──────────────────────────────────────────── */
.summary-card { background: var(--c-bg3); border: 0.5px solid var(--c-border); border-radius: var(--radius-lg); padding: 16px 20px; }
.summary-card h4 { font-size: 11px; color: var(--c-text3); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; margin-bottom: 12px; }
.sum-row { display: flex; gap: 12px; padding: 5px 0; font-size: 13px; align-items: flex-start; }
.sum-k { color: var(--c-text3); width: 110px; flex-shrink: 0; }
.sum-v { color: var(--c-text); }

/* ── Banca Panel ───────────────────────────────────────────── */
.banca-panel {
  background: var(--c-blue-bg); border: 0.5px solid var(--c-blue-bd);
  border-radius: var(--radius-lg); padding: 20px;
  margin-bottom: 16px;
}
.banca-panel-title { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.banca-panel-title span { font-size: 12px; font-weight: 600; color: var(--c-blue); text-transform: uppercase; letter-spacing: .07em; }
.ai-badge { font-size: 10px; font-weight: 700; background: var(--c-blue); color: #fff; padding: 2px 7px; border-radius: var(--radius-full); }
.banca-panel-desc { font-size: 13px; color: var(--c-text2); line-height: 1.65; margin-bottom: 16px; }

/* ── Loading ───────────────────────────────────────────────── */
.loading-view {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 400px; text-align: center;
}
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--c-bg5); border-top-color: var(--c-blue); animation: spin .7s linear infinite; margin-bottom: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-step  { font-size: 15px; font-weight: 500; margin-bottom: 4px; }
.load-sub   { font-size: 13px; color: var(--c-text3); margin-bottom: 20px; }
.prog-track { width: 280px; height: 4px; background: var(--c-bg5); border-radius: var(--radius-full); overflow: hidden; }
.prog-fill  { height: 100%; background: var(--c-blue); border-radius: var(--radius-full); transition: width .5s ease; }

/* ── Quiz ──────────────────────────────────────────────────── */
.quiz-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.quiz-meta { font-size: 13.5px; color: var(--c-text3); }
.quiz-badges { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.q-badge-subj { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: var(--radius-full); background: var(--c-blue-bg); color: var(--c-blue); border: 0.5px solid var(--c-blue-bd); }
.q-badge-banca { font-size: 11px; font-weight: 600; padding: 3px 12px; border-radius: var(--radius-full); background: var(--c-violet-bg); color: var(--c-violet-l); border: 0.5px solid var(--c-violet-bd); }

.quiz-prog { height: 4px; background: var(--c-bg5); border-radius: var(--radius-full); margin-bottom: 24px; }
.quiz-prog-fill { height: 100%; background: var(--c-blue); border-radius: var(--radius-full); transition: width .35s ease; }

.quiz-stats-strip { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.qs-item { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--c-text3); }
.qs-item svg { width: 13px; height: 13px; }
.qs-item strong { color: var(--c-text); }

.question-card { background: var(--c-bg2); border: 0.5px solid var(--c-border2); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.q-text { font-size: 15px; line-height: 1.78; margin-bottom: 20px; }
.options { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-radius: var(--radius-md);
  border: 0.5px solid var(--c-border2); cursor: pointer;
  background: var(--c-bg3);
  transition: all .12s;
}
.opt:hover:not(.locked) { border-color: var(--c-blue-bd); background: var(--c-blue-bg); }
.opt.picked  { border-color: var(--c-blue-bd);  background: var(--c-blue-bg); }
.opt.correct { border-color: var(--c-green-bd); background: var(--c-green-bg); }
.opt.wrong   { border-color: var(--c-red-bd);   background: var(--c-red-bg); }
.opt.faded   { opacity: .45; }
.opt.locked  { cursor: default; }
.opt-key {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--c-border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--c-text3);
  flex-shrink: 0; margin-top: 1px; background: var(--c-bg2);
}
.opt.picked  .opt-key { background: var(--c-blue);  border-color: var(--c-blue);  color: #fff; }
.opt.correct .opt-key { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.opt.wrong   .opt-key { background: var(--c-red);   border-color: var(--c-red);   color: #fff; }
.opt-txt { font-size: 14px; line-height: 1.58; color: var(--c-text); }

.feedback { margin-top: 16px; padding: 16px; border-radius: var(--radius-md); font-size: 13.5px; line-height: 1.65; display: none; }
.feedback.show { display: block; }
.feedback.ok   { background: var(--c-green-bg); border: 0.5px solid var(--c-green-bd); color: var(--c-green-l); }
.feedback.fail { background: var(--c-red-bg);   border: 0.5px solid var(--c-red-bd);   color: var(--c-red-l); }
.fb-head { font-weight: 700; margin-bottom: 5px; font-size: 14px; }
.fb-section-lbl { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; margin-top: 8px; margin-bottom: 2px; }
.fb-artigo-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  background: var(--c-violet-bg); color: var(--c-violet-l);
  border: 0.5px solid var(--c-violet-bd);
  border-radius: var(--radius-full); padding: 2px 10px; margin-bottom: 8px;
}
.fb-text { font-size: 13px; margin: 0 0 2px; line-height: 1.6; }
.fb-peg  { opacity: .85; }
.fb-analise { margin-top: 6px; display: flex; flex-direction: column; gap: 5px; }
.fb-analise-item { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; line-height: 1.55; }
.fb-analise-letra { flex-shrink: 0; width: 20px; height: 20px; border-radius: 4px; background: var(--c-bg5); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--c-text2); }
.fb-analise-txt { color: var(--c-text2); }

.quiz-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; flex-wrap: wrap; gap: 12px; }
.breadcrumb-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.bd { width: 8px; height: 8px; border-radius: 50%; background: var(--c-bg5); transition: background .2s; cursor: pointer; }
.bd.cur       { background: var(--c-blue); }
.bd.ok-done   { background: var(--c-green); }
.bd.fail-done { background: var(--c-red); }
.bd.skipped   { background: var(--c-amber); }

/* ── Results ───────────────────────────────────────────────── */
.result-hero {
  text-align: center; background: var(--c-bg2); border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-lg); padding: 40px 24px;
  margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.res-pct { font-size: 72px; line-height: 1; font-weight: 700; }
.res-pct.great { color: var(--c-green-l); }
.res-pct.ok    { color: var(--c-amber-l); }
.res-pct.bad   { color: var(--c-red-l); }
.res-msg { font-size: 14px; color: var(--c-text2); margin: 8px 0 20px; }
.res-bar-wrap { max-width: 340px; margin: 0 auto; }
.res-bar { height: 4px; background: var(--c-bg5); border-radius: var(--radius-full); overflow: hidden; }
.res-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.res-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 20px; }
.rs { background: var(--c-bg3); border: 0.5px solid var(--c-border); border-radius: var(--radius-md); padding: 16px 8px; text-align: center; }
.rs-v { font-size: 26px; font-weight: 700; }
.rs-l { font-size: 12px; color: var(--c-text3); margin-top: 4px; }
.rs.ok   .rs-v { color: var(--c-green-l); }
.rs.fail .rs-v { color: var(--c-red-l); }

.bm-row { margin-bottom: 12px; }
.bm-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; color: var(--c-text2); }
.bm-bar { height: 5px; background: var(--c-bg5); border-radius: var(--radius-full); overflow: hidden; }
.bm-fill { height: 100%; border-radius: var(--radius-full); }

/* ── Review Items ──────────────────────────────────────────── */
.review-item {
  background: var(--c-bg2); border-radius: var(--radius-lg);
  border: 0.5px solid var(--c-border2); border-left: 3px solid var(--c-border2);
  padding: 16px; margin-bottom: 8px;
  cursor: pointer; transition: border-color .12s;
  box-shadow: var(--shadow-sm);
}
.review-item.ok   { border-left-color: var(--c-green); }
.review-item.fail { border-left-color: var(--c-red); }
.review-item:hover { border-color: var(--c-border3); }
.ri-q   { font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--c-text); }
.ri-ans { font-size: 12.5px; color: var(--c-text3); }
.ri-ans .ok   { color: var(--c-green-l); font-weight: 600; }
.ri-ans .fail { color: var(--c-red-l);   font-weight: 600; }
.ri-explain { font-size: 13px; color: var(--c-text2); margin-top: 12px; padding-top: 12px; border-top: 0.5px solid var(--c-border); display: none; line-height: 1.68; }
.review-item.open .ri-explain { display: block; }

/* ── History Items ─────────────────────────────────────────── */
.history-item {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
  background: var(--c-bg2); border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-md); margin-bottom: 6px;
  cursor: pointer; transition: all .12s;
  box-shadow: var(--shadow-sm);
}
.history-item:hover { border-color: var(--c-border3); box-shadow: var(--shadow-md); }
.hi-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hi-main { flex: 1; min-width: 0; }
.hi-title { font-size: 13.5px; font-weight: 500; color: var(--c-text); }
.hi-meta  { font-size: 11px; color: var(--c-text3); margin-top: 2px; }
.hi-badge { font-size: 11px; color: var(--c-text3); background: var(--c-bg4); padding: 3px 9px; border-radius: var(--radius-full); white-space: nowrap; border: 0.5px solid var(--c-border); }
.score-pill { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: var(--radius-full); white-space: nowrap; }
.score-pill.g { background: var(--c-green-bg); color: var(--c-green-l); border: 0.5px solid var(--c-green-bd); }
.score-pill.a { background: var(--c-amber-bg); color: var(--c-amber-l); border: 0.5px solid var(--c-amber-bd); }
.score-pill.r { background: var(--c-red-bg);   color: var(--c-red-l);   border: 0.5px solid var(--c-red-bd); }

/* ── Matérias ──────────────────────────────────────────────── */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; }
.mat-card { background: var(--c-bg2); border: 0.5px solid var(--c-border2); border-radius: var(--radius-lg); padding: 16px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow-sm); }
.mat-card:hover { border-color: var(--c-border3); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.mat-icon { width: 34px; height: 34px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; margin-bottom: 12px; font-size: 17px; }
.mat-name  { font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--c-text); }
.mat-bar   { height: 4px; background: var(--c-bg5); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 8px; }
.mat-fill  { height: 100%; border-radius: var(--radius-full); }
.mat-stats { font-size: 11px; color: var(--c-text3); }

/* ── Cronograma ────────────────────────────────────────────── */
.week-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 8px; margin-bottom: 20px; }
.day-cell { background: var(--c-bg2); border: 0.5px solid var(--c-border); border-radius: var(--radius-md); padding: 12px 8px; text-align: center; box-shadow: var(--shadow-sm); }
.day-cell.today { border-color: var(--c-blue); background: var(--c-blue-bg); }
.day-cell.today .day-num { color: var(--c-blue); }
.day-name { font-size: 10px; color: var(--c-text3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.day-num  { font-size: 17px; font-weight: 700; margin-bottom: 4px; color: var(--c-text); }
.day-dot  { width: 5px; height: 5px; border-radius: 50%; background: var(--c-blue); margin: 0 auto; display: none; }
.day-cell.has-tasks .day-dot { display: block; }

.task-item { display: flex; align-items: center; gap: 12px; background: var(--c-bg2); border: 0.5px solid var(--c-border); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 8px; transition: border-color .12s; }
.task-item:hover { border-color: var(--c-border2); }
.task-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--c-border2); flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; background: white; }
.task-check.done { background: var(--c-green); border-color: var(--c-green); }
.task-check.done::after { content: '✓'; font-size: 10px; color: #fff; font-weight: 700; }
.task-info { flex: 1; }
.task-name { font-size: 13px; font-weight: 500; color: var(--c-text); }
.task-sub  { font-size: 11px; color: var(--c-text3); margin-top: 1px; }
.task-badge { font-size: 10px; padding: 3px 8px; border-radius: var(--radius-full); font-weight: 600; }
.cron-prog-wrap { background: var(--c-bg2); border: 0.5px solid var(--c-border); border-radius: var(--radius-lg); padding: 16px 20px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.cron-prog-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; color: var(--c-text); }
.cron-prog-bar { height: 5px; background: var(--c-bg5); border-radius: var(--radius-full); overflow: hidden; }
.cron-prog-fill { height: 100%; border-radius: var(--radius-full); background: var(--c-green); transition: width .6s ease; }

/* ── Flashcards ────────────────────────────────────────────── */
.flashcard { width: 100%; max-width: 560px; margin: 0 auto; height: 220px; position: relative; cursor: pointer; transform-style: preserve-3d; transition: transform .5s; }
.flashcard.flipped { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; background: var(--c-bg2); border: 0.5px solid var(--c-border2); border-radius: var(--radius-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; box-shadow: var(--shadow-sm); }
.fc-face.back { transform: rotateY(180deg); }
.fc-lbl  { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--c-text4); font-weight: 600; margin-bottom: 12px; }
.fc-text { font-size: 16px; font-weight: 500; line-height: 1.6; color: var(--c-text); }
.fc-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

.srs-btn { padding: 8px 16px; border-radius: var(--radius-md); border: 0.5px solid var(--c-border2); background: none; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .12s; }
.srs-btn.hard  { color: var(--c-red-l);   background: var(--c-red-bg);   border-color: var(--c-red-bd); }
.srs-btn.medium{ color: var(--c-amber-l); background: var(--c-amber-bg); border-color: var(--c-amber-bd); }
.srs-btn.easy  { color: var(--c-green-l); background: var(--c-green-bg); border-color: var(--c-green-bd); }

/* ── Chat ──────────────────────────────────────────────────── */
.chat-wrap { display: flex; flex-direction: column; height: calc(100dvh - 230px); min-height: 380px; }
.chat-msgs { flex: 1; min-height: 0; max-height: none; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 0; margin-bottom: 16px; }
.msg { display: flex; gap: 8px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.msg.ai   .msg-avatar { background: var(--c-blue); color: #fff; }
.msg.user .msg-avatar { background: var(--c-bg5); color: var(--c-text2); }
.msg-bubble { max-width: 80%; padding: 11px 16px; font-size: 13.5px; line-height: 1.65; }
.msg.ai   .msg-bubble { background: var(--c-bg3); border: 0.5px solid var(--c-border); border-radius: 2px var(--radius-lg) var(--radius-lg) var(--radius-lg); color: var(--c-text); }
.msg.user .msg-bubble { background: var(--c-blue); color: #fff; border-radius: var(--radius-lg) 2px var(--radius-lg) var(--radius-lg); }
.chat-input-row { display: flex; gap: 8px; border-top: 0.5px solid var(--c-border); padding-top: 16px; }
.chat-input { flex: 1; background: var(--c-bg3); border: 0.5px solid var(--c-border2); border-radius: var(--radius-lg); padding: 10px 16px; color: var(--c-text); font-size: 13.5px; resize: none; min-height: 42px; max-height: 120px; transition: border-color .15s; }
.chat-input:focus { outline: none; border-color: var(--c-blue); background: white; }
.chat-input::placeholder { color: var(--c-text4); }
.chat-send { width: 42px; height: 42px; border-radius: var(--radius-md); background: var(--c-blue); border: none; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background .12s; }
.chat-send:hover { background: var(--c-blue-l); }
.chat-send svg { width: 16px; height: 16px; }
.chat-typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c-text3); animation: bounce 1.2s infinite; margin: 0 1px; }
.chat-typing span:nth-child(2) { animation-delay: .2s; }
.chat-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,80%,100%{transform:translateY(0)}40%{transform:translateY(-5px)} }

/* ── Empty States ──────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 16px; color: var(--c-text3); }
.empty-state svg { width: 40px; height: 40px; margin: 0 auto 12px; display: block; opacity: .25; }
.empty-state p { font-size: 13px; }
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--c-text2); margin-bottom: 6px; }
.empty-state-desc { font-size: 13px; max-width: 320px; margin: 0 auto 16px; line-height: 1.6; }

/* ── Toast ─────────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 11px 16px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; animation: tin .2s ease; max-width: 300px; pointer-events: all; box-shadow: var(--shadow-md); }
.toast.ok   { background: var(--c-green-bg); border: 0.5px solid var(--c-green-bd); color: var(--c-green-l); }
.toast.err  { background: var(--c-red-bg);   border: 0.5px solid var(--c-red-bd);   color: var(--c-red-l); }
.toast.info { background: var(--c-blue-bg);  border: 0.5px solid var(--c-blue-bd);  color: var(--c-blue); }
@keyframes tin { from{transform:translateX(40px);opacity:0} to{transform:translateX(0);opacity:1} }

/* ── Dashboard Hero ────────────────────────────────────────── */
.dash-hero { background: var(--c-bg2); border: 0.5px solid var(--c-border2); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.dash-hero h2 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.dash-hero p  { font-size: 13px; color: var(--c-text2); }

/* ── Rank Items ────────────────────────────────────────────── */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 0.5px solid var(--c-border); }
.rank-item:last-child { border: none; }
.rank-num { width: 22px; font-size: 12px; font-weight: 700; color: var(--c-text4); flex-shrink: 0; }
.rank-name { flex: 1; font-size: 13px; color: var(--c-text); }
.rank-bar-wrap { width: 80px; }
.rank-bar { height: 4px; background: var(--c-bg5); border-radius: var(--radius-full); overflow: hidden; }
.rank-fill { height: 100%; border-radius: var(--radius-full); }
.rank-pct { width: 36px; font-size: 12px; font-weight: 600; text-align: right; }

/* ── Wizard Collapse Animation ──────────────────────────────── */
.step2-materias { transition: opacity .18s ease, transform .18s ease; opacity: 1; transform: translateY(0); }
.step2-materias.collapsed { opacity: 0; transform: translateY(-6px); pointer-events: none; height: 0; overflow: hidden; }

/* ── Skeleton ──────────────────────────────────────────────── */
@keyframes skeleton { 0%{background-position:-200% 0}100%{background-position:200% 0} }
.skeleton, .sk {
  background: linear-gradient(90deg, var(--c-bg4) 25%, var(--c-bg5) 50%, var(--c-bg4) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ── Focus Mode ─────────────────────────────────────────────── */
body.focus-mode .sidebar { transform: translateX(-100%); }
body.focus-mode .main-wrap { margin-left: 0 !important; }
body.focus-mode .quiz-topbar { max-width: 800px; margin: 0 auto; background: transparent; border: none; padding: 16px 24px; }
body.focus-mode .quiz-stats-strip { max-width: 800px; margin: 0 auto 8px; padding: 8px 24px; background: transparent; border: none; }
body.focus-mode .question-card { max-width: 800px; margin: 0 auto 16px; padding: 32px; }
body.focus-mode .quiz-foot { max-width: 800px; margin: 0 auto; padding: 16px 24px; }
body.focus-mode .quiz-prog { max-width: 800px; margin: 0 auto 12px; }
body.focus-mode .q-text { font-size: 16px; line-height: 1.75; }

.focus-toggle { background: transparent; border: 0.5px solid var(--c-border2); border-radius: 8px; padding: 6px 12px; color: var(--c-text3); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; transition: all .12s; }
.focus-toggle:hover { border-color: var(--c-blue-bd); color: var(--c-blue); background: var(--c-blue-bg); }
.focus-toggle.active { border-color: var(--c-blue-bd); color: var(--c-blue); background: var(--c-blue-bg); }

/* ── Edital / Extra ─────────────────────────────────────────── */
.edital-loading { display:flex; flex-direction:column; align-items:center; justify-content:center; padding: 32px; text-align:center; gap:12px; }
.edital-loading .ring { width:32px; height:32px; border:3px solid var(--c-bg5); border-top-color:var(--c-blue); border-radius:50%; animation:spin .7s linear infinite; }
.extracted-badge { display:inline-flex; align-items:center; gap:6px; font-size:11px; font-weight:600; padding:3px 10px; border-radius:var(--radius-full); background:var(--c-green-bg); color:var(--c-green-l); border:0.5px solid var(--c-green-bd); }
.extracted-badge.warn { background:var(--c-amber-bg); color:var(--c-amber-l); border-color:var(--c-amber-bd); }
.cargo-materia-map { background:var(--c-bg3); border:0.5px solid var(--c-border); border-radius:var(--radius-md); padding:10px 14px; margin-top:8px; font-size:12px; color:var(--c-text3); line-height:1.6; max-height:120px; overflow-y:auto; }
.step2-source-badge { font-size:12px; padding:4px 12px; border-radius:var(--radius-full); margin-bottom:14px; display:inline-flex; align-items:center; gap:6px; }
.step2-source-badge.from-edital { background:var(--c-blue-bg); color:var(--c-blue); border:0.5px solid var(--c-blue-bd); }
.step2-source-badge.from-default { background:var(--c-bg4); color:var(--c-text3); border:0.5px solid var(--c-border2); }
.q-topico { font-size:11px; color:var(--c-text3); margin:6px 0 12px; font-style:italic; padding:4px 8px; background:var(--c-bg4); border-radius:6px; display:inline-block; }

/* ── Forms ─────────────────────────────────────────────────── */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  background: var(--c-bg3);
  border: 0.5px solid var(--c-border2);
  border-radius: var(--radius-md);
  color: var(--c-text);
  padding: 9px 12px;
  font-size: 13.5px;
  width: 100%;
  transition: border-color .15s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--c-primary); background: var(--c-bg2); box-shadow: 0 0 0 3px var(--c-primary-bg); }
input::placeholder { color: var(--c-text4); }

/* ── Auth ──────────────────────────────────────────────────── */
#app-container { display: none !important; }
#login-overlay { display: flex !important; }
body.auth-ready #app-container { display: block !important; }
body.auth-ready #login-overlay { display: none !important; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrap { margin-left: 0; width: 100%; }
  .hamburger { display: flex; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-2, .config-grid { grid-template-columns: 1fr; }
  .week-grid { grid-template-columns: repeat(4,1fr); }
}
@media (max-width: 640px) {
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .main-wrap { margin-left: 0; width: 100%; }
  .hamburger { display: flex; }
  .content { padding: 16px 16px 64px; }
  .topbar { padding: 0 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .res-stats { grid-template-columns: repeat(3,1fr); }
  .week-grid { grid-template-columns: repeat(4,1fr); }
  .quiz-stats-strip { flex-direction: column; align-items: flex-start; }
  .wizard { gap: 0; }
  .ws-lbl { display: none; }
  .history-item .hi-badge { display: none; }
}

/* === Acessibilidade: foco visível por teclado (WCAG 2.4.7) === */
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 3px; }
button:focus-visible, a:focus-visible, .btn:focus-visible, .nav-item:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ── Chips de sugestão do Professor IA ─────────────────── */
.chat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px 38px; }
.chat-chip {
  background: var(--c-bg2); border: 1px solid var(--c-border2); border-radius: 999px;
  color: var(--c-text2); font-size: 12.5px; font-family: inherit; padding: 8px 14px;
  cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.chat-chip:hover { border-color: rgba(202,138,4,.5); color: var(--c-text1); background: var(--c-bg3); }
