:root {
  --bg: #0b1020;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --primary: #22c55e;
  --accent: #60a5fa;
  --danger: #ef4444;
  --warning: #f59e0b;
  --ok: #10b981;
  --card: #0b1220;
  --hero-offset: 140px;
  /* Altura total ocupada pelo cabeçalho fixo */
  --header-offset: 100px;
  /* Padding vertical do header (usado no cálculo do favicon) */
  --header-py: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 70% -10%, rgba(124,156,255,.2), transparent 60%),
              radial-gradient(800px 600px at 10% 110%, rgba(34,197,94,.12), transparent 60%),
              var(--bg);
  color: var(--text);
  padding-top: var(--header-offset);
}

html { scroll-behavior: smooth; }
section, .card { scroll-margin-top: var(--hero-offset); }

/* Imagens responsivas (evita que logos/figuras estourem a largura no mobile) */
img { max-width: 100%; height: auto; }

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: var(--header-py) 20px;
  background: #111827;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  backdrop-filter: none;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.brand { display: flex; flex-direction: column; }
.brand-title { font-weight: 800; letter-spacing: 0.5px; color: var(--primary); }
.brand-subtitle { font-size: 12px; color: var(--muted); }
.brand-row { display: flex; align-items: center; gap: 8px; }
.brand-icon { width: 32px; height: 32px; border-radius: 8px; }

/* No mobile, exibir o favicon à esquerda da frase da legenda */
@media (max-width: 700px) {
  .brand-row .brand-icon { display: none; }
  .brand-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .brand-subtitle::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background: url('/MAPEARFavicon.png') no-repeat center / contain;
    border-radius: 4px;
  }
}

.main-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.main-nav a:not(.btn) {
  text-decoration: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.main-nav a:not(.btn):hover { background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.3); }
.main-nav a.active:not(.btn) { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); }

/* Submenu fixo logo abaixo do header principal */
.sub-nav {
  position: sticky;
  top: var(--header-offset);
  z-index: 9998;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px 20px;
  background: #0f162b;
  border-bottom: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  overflow-x: auto;
}
@media (max-width: 700px) {
  :root { --header-offset: 160px; }
  .sub-nav { position: static; top: auto; }
}

/* Compactar botões do menu principal para reduzir a altura do cabeçalho */
.main-nav .btn { padding: 8px 10px; border-radius: 10px; }
.sub-nav a {
  text-decoration: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.sub-nav a:hover { background: rgba(96,165,250,0.1); border-color: rgba(96,165,250,0.3); }
.sub-nav a.active { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.35); }

/* Botões no estilo do curso MAPEAR */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .2px;
  color: #0b1225;
  background: linear-gradient(180deg, #c8d6ff, #95adff);
  box-shadow: 0 8px 20px rgba(124,156,255,.35);
  text-decoration: none;
}
.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: none;
}

.app-container {
  max-width: 1000px;
  margin: 24px auto;
  padding: 24px 16px 80px;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.hero-actions .button.cta {
  width: 100%;
  justify-content: center;
  padding: 18px 20px;
  font-size: 18px;
  line-height: 1.2;
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0,0,0,0.45);
}
@media (max-width: 700px) {
  .hero-actions { grid-template-columns: 1fr; }
}

.card {
  background: linear-gradient(180deg, rgba(16,24,39,0.8), rgba(16,24,39,0.6));
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { .grid.cols-2 { grid-template-columns: 1fr; } }

h1, h2, h3 { margin: 0 0 10px; }
h1 { font-size: 28px; }
h2 { font-size: 22px; color: var(--accent); }
h3 { font-size: 18px; color: var(--primary); }

p { color: var(--text); line-height: 1.6; }
.muted { color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(34,197,94,0.15);
  color: var(--text);
  border: 1px solid rgba(34,197,94,0.4);
  border-radius: 10px;
  cursor: pointer;
}
.button:hover { background: rgba(34,197,94,0.25); }
.button.secondary { background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.4); }
.button.danger { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); }

/* Botões de destaque (CTA) para Curso e Jogos */
.button.cta {
  font-weight: 800;
  letter-spacing: 0.3px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 0;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.button.cta:hover { transform: translateY(-1px); filter: brightness(1.06); }
.button.cta:active { transform: translateY(0); filter: brightness(0.98); }
.button.cta:focus-visible { outline: 3px solid rgba(96,165,250,0.45); outline-offset: 2px; }

/* Variante primária: Jogos (verde) */
.button.cta.primary {
  background: linear-gradient(135deg, #16a34a, #22c55e 50%, #10b981);
  box-shadow: 0 8px 24px rgba(34,197,94,0.35), inset 0 0 0 1px rgba(255,255,255,0.12);
}
.button.cta.primary:hover { box-shadow: 0 10px 30px rgba(34,197,94,0.45), inset 0 0 0 1px rgba(255,255,255,0.16); }

/* Variante secundária: Curso (azul/roxo) */
.button.cta.secondary {
  background: linear-gradient(135deg, #2563eb, #60a5fa 50%, #7c3aed);
  box-shadow: 0 8px 24px rgba(96,165,250,0.35), inset 0 0 0 1px rgba(255,255,255,0.12);
}
.button.cta.secondary:hover { box-shadow: 0 10px 30px rgba(96,165,250,0.45), inset 0 0 0 1px rgba(255,255,255,0.16); }

/* Variante terciária: Rubricas (âmbar/laranja) */
.button.cta.tertiary {
  background: linear-gradient(135deg, #b45309, #f59e0b 50%, #fbbf24);
  box-shadow: 0 8px 24px rgba(245,158,11,0.35), inset 0 0 0 1px rgba(255,255,255,0.12);
}
.button.cta.tertiary:hover { box-shadow: 0 10px 30px rgba(245,158,11,0.45), inset 0 0 0 1px rgba(255,255,255,0.16); }

/* Variante roxa: Baixar Artefatos (roxo) */
.button.cta.purple {
  background: linear-gradient(135deg, #6d28d9, #7c3aed 50%, #a78bfa);
  box-shadow: 0 8px 24px rgba(167,139,250,0.35), inset 0 0 0 1px rgba(255,255,255,0.12);
}
.button.cta.purple:hover { box-shadow: 0 10px 30px rgba(167,139,250,0.45), inset 0 0 0 1px rgba(255,255,255,0.16); }

.input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid rgba(148,163,184,0.25);
  border-radius: 10px;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 6px 0; }

.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; background: #0a1220; padding: 2px 6px; border-radius: 6px; border: 1px solid rgba(148,163,184,0.25); }

.tip {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: rgba(96,165,250,0.08);
  border: 1px dashed rgba(96,165,250,0.5);
  border-radius: 10px;
}
.tip .badge { font-size: 11px; color: var(--accent); }
.tip .mentor { font-weight: 700; color: var(--accent); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 12px; border-bottom: 1px dashed rgba(148,163,184,0.15); }

.app-footer { position: fixed; bottom: 0; left: 0; right: 0; padding: 10px 16px; background: linear-gradient(180deg, rgba(17,24,39,0.0), rgba(17,24,39,0.8)); border-top: 1px solid rgba(148,163,184,0.15); text-align: center; color: var(--muted); }

/* Rodapé padrão para todas as páginas */
.footer {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 24px 12px;
}
