/* ============ Trilha Web — estilos ============ */
:root {
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1e293b;
  --muted: #64748b;
  --accent: #f97316;
  --accent-2: #2563eb;
  --border: #e2e8f0;
  --ok: #16a34a;
  --sidebar-bg: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #1e293b;
  --code-bg: #0d1117;
  --code-text: #e6edf3;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ---------- topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: 56px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: var(--sidebar-bg);
  color: #fff;
}
.topbar .brand { font-weight: 700; color: #fff; text-decoration: none; font-size: 17px; white-space: nowrap; }
#btn-menu { display: none; background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }
.top-progress { flex: 1; max-width: 340px; display: flex; align-items: center; gap: 10px; }
.top-progress-track { flex: 1; height: 8px; background: #334155; border-radius: 99px; overflow: hidden; }
.top-progress-track.big { height: 14px; }
.top-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #fbbf24); border-radius: 99px; transition: width .35s ease; }
#contador-geral { font-size: 13px; color: #94a3b8; white-space: nowrap; }
#busca {
  flex: 0 1 220px; margin-left: auto;
  padding: 7px 12px; border-radius: 8px; border: 1px solid #334155;
  background: #1e293b; color: #fff; font-size: 13px; outline: none;
}
#busca::placeholder { color: #64748b; }

/* ---------- sidebar ---------- */
#sidebar {
  position: fixed; top: 56px; bottom: 0; left: 0; z-index: 40;
  width: 272px; overflow-y: auto;
  background: var(--sidebar-bg); color: var(--sidebar-text);
  padding: 14px 10px 20px;
  display: flex; flex-direction: column;
}
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 0 10px 8px; }
.side-title { font-weight: 700; color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
#btn-reset {
  background: none; border: 1px solid #334155; color: #94a3b8; border-radius: 6px;
  cursor: pointer; font-size: 13px; padding: 2px 8px;
}
#btn-reset:hover { color: #f87171; border-color: #f87171; }
#nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
#nav a {
  color: var(--sidebar-text); text-decoration: none;
  font-size: 13.5px; padding: 6px 10px; border-radius: 7px;
  display: flex; align-items: center; gap: 8px;
}
#nav a:hover { background: var(--sidebar-active); color: #fff; }
#nav a .dia-num {
  flex: 0 0 26px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  background: #1e293b; color: #94a3b8; border-radius: 6px; font-size: 11.5px; font-weight: 700;
}
#nav a.done .dia-num { background: #14532d; color: #4ade80; }
#nav .grupo {
  margin-top: 12px; padding: 6px 10px 2px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: #64748b;
}
.side-foot { padding: 10px; border-top: 1px solid #1e293b; margin-top: 12px; }
.side-foot a { color: var(--accent); font-size: 13px; text-decoration: none; font-weight: 600; }
#overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }

/* ---------- conteúdo ---------- */
#conteudo {
  margin-left: 272px;
  padding: 86px 26px 60px;
  max-width: 980px;
}
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff; border-radius: var(--radius);
  padding: 34px 34px 26px; margin-bottom: 30px;
}
.hero h1 { margin: 0 0 6px; font-size: 34px; }
.hero-sub { color: #cbd5e1; margin: 0 0 18px; font-size: 16px; }
.hero-sub strong { color: #fff; }
.hero-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.hero-card {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px; padding: 10px 16px; font-size: 13px; color: #cbd5e1;
}
.hero-num { font-size: 22px; font-weight: 800; color: var(--accent); margin-right: 6px; }
.hero-progress { margin: 6px 0 18px; max-width: 420px; }
.hero-acoes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.btn {
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
}
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.4); }
.drive-links-titulo { margin: 14px 0 4px; font-size: 13px; color: #94a3b8; }
.drive-links { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 0; }
.drive-link {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; text-decoration: none; font-size: 13px;
  padding: 7px 12px; border-radius: 8px;
}
.drive-link:hover { background: rgba(255,255,255,.2); }
.hero .dica { margin-top: 14px; font-size: 13px; color: #94a3b8; }
.muted { color: var(--muted); }
a { color: var(--accent-2); }

/* ---------- tipografia do conteúdo ---------- */
h2 { font-size: 24px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
h2.divisor {
  background: var(--sidebar-bg); color: #fff; border: none;
  padding: 16px 20px; border-radius: var(--radius); font-size: 20px;
}
h2.divisor span { color: var(--accent); font-size: 12px; letter-spacing: .12em; margin-right: 8px; }
h3 { font-size: 18px; margin: 30px 0 10px; color: #0f172a; }
h4 { font-size: 15.5px; margin: 22px 0 8px; }
p { margin: 10px 0; }
strong { color: #0f172a; }
blockquote {
  margin: 14px 0; padding: 12px 16px;
  background: #fff7ed; border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0; color: #7c2d12; font-size: 14.5px;
}
hr { border: none; border-top: 1px dashed var(--border); margin: 28px 0; }
code {
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  background: #eef2f7; color: #b91c1c; font-size: .88em;
  padding: 1px 6px; border-radius: 5px;
}

/* ---------- tabelas ---------- */
.tabela-wrap { overflow-x: auto; margin: 14px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--surface); }
th, td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
th { background: #f1f5f9; font-weight: 700; }
tr:nth-child(even) td { background: #fafbfd; }

/* ---------- blocos de código ---------- */
.codigo { margin: 14px 0; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.codigo-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: #161b22; padding: 6px 12px;
}
.codigo-lang { color: #8b949e; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.codigo pre { margin: 0; padding: 14px 16px; overflow-x: auto; background: var(--code-bg); }
.codigo code {
  font-family: "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13px; line-height: 1.55; color: var(--code-text);
  background: none; padding: 0;
}
.btn-copiar {
  background: #21262d; color: #8b949e; border: 1px solid #30363d;
  font-size: 11px; padding: 3px 10px; border-radius: 6px; cursor: pointer;
}
.btn-copiar:hover { color: #fff; border-color: #8b949e; }
.btn-copiar.ok { color: #3fb950; border-color: #3fb950; }

/* sintaxe */
.cm { color: #8b949e; font-style: italic; }
.st { color: #a5d6ff; }
.tk { color: #ff7b72; }
.nm { color: #79c0ff; }
.tg { color: #7ee787; }
.at { color: #ffa657; }
.pr { color: #d2a8ff; }

/* ---------- exercícios ---------- */
ol.exercicios, ul.exercicios { list-style: none; padding: 0; margin: 14px 0; }
ol.exercicios li, ul.exercicios li { margin: 6px 0; }
label.ex {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; cursor: pointer;
  font-size: 14.5px; transition: border-color .2s, background .2s;
}
label.ex:hover { border-color: #fbbf24; }
label.ex input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--ok); flex-shrink: 0; }
label.ex.feita { background: #f0fdf4; border-color: #bbf7d0; }
label.ex.feita span { text-decoration: line-through; color: var(--muted); }

/* ---------- navegação de dia ---------- */
.dia-nav {
  display: flex; justify-content: space-between; gap: 10px;
  margin: 26px 0 8px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.dia-nav a {
  text-decoration: none; font-weight: 600; font-size: 14px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 8px; color: var(--accent-2);
}
.dia-nav a:hover { border-color: var(--accent-2); }

footer { margin-top: 50px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13.5px; }
footer p { margin: 4px 0; }

/* ---------- responsivo ---------- */
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); transition: transform .25s ease; width: 280px; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  #sidebar.aberta { transform: translateX(0); }
  #overlay.mostra { display: block; }
  #btn-menu { display: block; }
  #conteudo { margin-left: 0; padding: 76px 14px 50px; }
  #busca { display: none; }
}
