/* ============================================================
   EM QUESTÕES — Design System Estratégia Militar
   Dourado #FFB001 · Preto quente #1A1611 · Inter + Playfair
   ============================================================ */

:root {
  --brand: #FFB001;
  --brand-light: #FFD24D;
  --brand-dark: #B37700;
  --grad: linear-gradient(165deg, #B37700 0%, #FFB001 50%, #FFD24D 100%);

  --red: #E63946;
  --green: #2A9D8F;

  /* tema escuro (padrão) */
  --bg: #1A1611;
  --bg-2: #241F18;
  --bg-3: #2E2820;
  --border: #3A332A;
  --text: rgba(255, 255, 255, 0.88);
  --text-2: rgba(255, 255, 255, 0.62);
  --muted: #8A8580;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #FAF7F0;
  --bg-2: #FFFFFF;
  --bg-3: #F3EEE2;
  --border: #EDE6D4;
  --text: #2A2419;
  --text-2: #5C5546;
  --muted: #8A8580;
  --shadow: 0 6px 24px rgba(120, 100, 60, 0.12);
}

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

html {
  scroll-behavior: smooth;
  /* iOS Safari infla fontes por conta própria e estoura a largura da página */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* nada pode alargar a página além da tela (corta qualquer elemento rebelde
   e mantém a bottomnav/cards ancorados na largura REAL do aparelho) */
html, body { max-width: 100%; overflow-x: clip; }
@supports not (overflow: clip) { html, body { overflow-x: hidden; } }
.card, .patente-card, .acao-card, .plano-card { min-width: 0; max-width: 100%; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;  /* fallback navegadores antigos */
  min-height: 100dvh;
}

/* vinheta dourada de quartel ao fundo (sutil) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(58% 38% at 50% -4%, rgba(255, 176, 1, 0.085), transparent 62%),
    radial-gradient(46% 32% at 88% 104%, rgba(255, 176, 1, 0.05), transparent 60%);
}
[data-theme="light"] body::before { opacity: 0.55; }
#app, .bottomnav, #overlay { position: relative; z-index: 1; }
/* instalado como app (tela cheia), o conteúdo avança sob o notch/relógio:
   compensa as áreas seguras do aparelho no topo e nas laterais */
#app {
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.bottomnav { position: fixed; }
/* o overlay precisa empilhar ACIMA da bottomnav (z 50), senão o modal
   (z 100, mas preso DENTRO do contexto do overlay) fica embaixo da barra
   e o botão do rodapé do modal some atrás dela */
#overlay { z-index: 90; }

h1, h2, h3, .serif { font-family: "Playfair Display", Georgia, serif; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ---------- layout geral ---------- */

#app { display: flex; min-height: 100vh; min-height: 100dvh; }

.sidebar {
  display: none;
  flex-direction: column;
  width: 240px;
  min-height: 100vh;
  min-height: 100dvh;
  position: sticky; top: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  gap: 4px;
}

.sidebar .brand-row { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.sidebar .brand-row img { width: 42px; height: 42px; }
.sidebar .brand-row .b-name { font-weight: 800; font-size: 15px; letter-spacing: 0.2px; }
.sidebar .brand-row .b-sub { font-size: 11px; color: var(--muted); }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; font-size: 14px;
  transition: background 0.15s, color 0.15s;
  width: 100%; text-align: left;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: rgba(255, 176, 1, 0.12); color: var(--brand); }

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  /* respiro inferior folgado: nada pode sumir atrás da bottomnav fixa */
  padding: 18px 16px calc(124px + env(safe-area-inset-bottom));
}

/* header mobile */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 14px;
}
.topbar .brand-row { display: flex; align-items: center; gap: 10px; }
.topbar img { width: 38px; height: 38px; }
.topbar .b-name { font-weight: 800; font-size: 14px; }
.topbar .b-sub { font-size: 10.5px; color: var(--muted); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text-2);
}
.icon-btn svg { width: 18px; height: 18px; }

/* bottom nav mobile */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; /* acompanha o nº de itens do NAV */
  background: var(--bg-2); /* fallback p/ navegadores sem color-mix */
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 1px; color: var(--muted); font-size: 9.5px; font-weight: 600;
  border-radius: 10px; min-width: 0;
}
.bottomnav button svg { width: 21px; height: 21px; }
.bottomnav button.active { color: var(--brand); }

/* modo auth: esconde navegação enquanto deslogado */
body.auth-mode .bottomnav, body.auth-mode .sidebar { display: none !important; }

@media (min-width: 900px) {
  .sidebar { display: flex; }
  .bottomnav, .topbar { display: none; }
  main { padding: 28px 32px 60px; }
  body.auth-mode .topbar { display: flex; }
}

/* ---------- componentes ---------- */

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.card + .card, .stack > * + * { margin-top: 12px; }

.h-page { font-size: 26px; font-weight: 800; margin-bottom: 2px; }
.h-page::after {
  content: ""; display: block; width: 46px; height: 4px;
  border-radius: 99px; background: var(--grad); margin-top: 7px;
}
.h-page[style*="text-align:center"]::after, .h-page[style*="text-align: center"]::after { margin-left: auto; margin-right: auto; }
.sub { color: var(--text-2); font-size: 13.5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; font-weight: 700; font-size: 15px;
  padding: 13px 20px; transition: transform 0.08s, filter 0.15s;
  width: 100%; text-decoration: none;
}
a.btn { color: var(--text); }
a.btn svg { width: 15px; height: 15px; }
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--grad); color: #241A05; box-shadow: 0 4px 16px rgba(255, 176, 1, 0.25); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); background: var(--bg-2); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { color: var(--text-2); font-weight: 600; }
.btn-sm { padding: 9px 14px; font-size: 13.5px; width: auto; border-radius: 10px; }
.btn-danger { background: rgba(230, 57, 70, 0.12); color: var(--red); border: 1px solid rgba(230, 57, 70, 0.3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.assuntos-scroll { max-height: 210px; overflow-y: auto; padding-right: 4px; }
.assuntos-scroll .chip { font-size: 12px; padding: 7px 12px; }
.chip {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border); color: var(--text-2); background: var(--bg-2);
  transition: all 0.15s;
}
.chip.on { border-color: var(--brand); color: var(--brand); background: rgba(255, 176, 1, 0.1); }

/* pills de metadados */
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase;
  padding: 4px 9px; border-radius: 6px;
  background: var(--bg-3); color: var(--text-2); border: 1px solid var(--border);
}
.pill.gold { background: rgba(255, 176, 1, 0.12); color: var(--brand); border-color: rgba(255, 176, 1, 0.3); }
.pill.red { background: rgba(230, 57, 70, 0.1); color: var(--red); border-color: rgba(230, 57, 70, 0.25); }
.pill.green { background: rgba(42, 157, 143, 0.12); color: var(--green); border-color: rgba(42, 157, 143, 0.3); }

/* ---------- dashboard ---------- */

.saudacao { margin: 6px 0 16px; }
.saudacao h1 { font-size: 24px; line-height: 1.25; }
.saudacao .nome { color: var(--brand); }

.patente-card {
  background: linear-gradient(120deg, #B37700 0%, #FFB001 38%, #FFD24D 52%, #FFB001 66%, #B37700 100%);
  background-size: 220% 220%;
  animation: pat-shimmer 7s ease-in-out infinite alternate;
  color: #241A05;
  border-radius: 16px; padding: 18px;
  box-shadow: 0 8px 28px rgba(255, 176, 1, 0.28);
}
@keyframes pat-shimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.patente-card .pat-nome { font-family: "Playfair Display", serif; font-size: 22px; font-weight: 800; }
.patente-card .xp-bar { height: 8px; background: rgba(36, 26, 5, 0.22); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.patente-card .xp-fill { height: 100%; background: #241A05; border-radius: 99px; transition: width 0.6s ease; }
.patente-card .xp-info { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-top: 6px; opacity: 0.85; }

/* frase motivacional do dia (QG) */
.frase-dia {
  position: relative;
  border: 1px solid rgba(255, 176, 1, 0.35);
  background: linear-gradient(150deg, rgba(255, 176, 1, 0.10), transparent 58%), var(--bg-2);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 12px;
}
.frase-dia .fd-rotulo {
  font-size: 10.5px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--brand); margin-bottom: 6px;
}
/* mesma tipografia do enunciado das questões — leitura melhor */
.frase-dia .fd-texto {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18.5px; line-height: 1.72; font-weight: 500;
  letter-spacing: 0.004em; color: var(--text);
}
.frase-dia .fd-acoes { margin-top: 11px; }

.acoes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.acao-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s, transform 0.08s;
}
.acao-card:hover { border-color: var(--brand); }
.acao-card:active { transform: scale(0.98); }
.acao-card .ico {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 176, 1, 0.12); color: var(--brand);
}
.acao-card .ico svg { width: 20px; height: 20px; }
.acao-card .t { font-weight: 700; font-size: 14.5px; }
.acao-card .d { font-size: 12px; color: var(--text-2); }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 14px; }
.kpi .v { font-size: 26px; font-weight: 800; font-family: "Playfair Display", serif; color: var(--brand); }
.kpi .l { font-size: 11.5px; color: var(--text-2); font-weight: 600; margin-top: 2px; }

.semana { display: flex; align-items: flex-end; gap: 8px; height: 90px; padding-top: 8px; }
.semana .dia { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.semana .barra { width: 100%; max-width: 34px; background: var(--bg-3); border-radius: 6px 6px 3px 3px; min-height: 4px; position: relative; overflow: hidden; }
.semana .barra .fill { position: absolute; bottom: 0; left: 0; right: 0; background: var(--grad); border-radius: 6px 6px 3px 3px; }
.semana .lbl { font-size: 10px; color: var(--muted); font-weight: 700; }

/* ---------- questão ---------- */

.q-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.q-prog { font-size: 13px; font-weight: 700; color: var(--text-2); }
.q-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; color: var(--brand); background: rgba(255,176,1,0.1); padding: 4px 10px; border-radius: 8px; }

/* enunciado: fonte de LEITURA (Inter), não de título — Playfair é bonita em
   destaques curtos, mas cansa em bloco de texto. Corpo maior e mais respiro
   pra facilitar a leitura da questão. */
.enunciado {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18.5px; line-height: 1.72; font-weight: 500;
  letter-spacing: 0.004em; color: var(--text); margin: 14px 0 18px;
}
.suporte {
  background: var(--bg-3); border-left: 3px solid var(--brand);
  padding: 14px 16px; border-radius: 0 10px 10px 0;
  font-size: 15.5px; line-height: 1.7; color: var(--text); margin: 12px 0; white-space: pre-wrap;
}

.alts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.alt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  border: 1.5px solid var(--border); background: var(--bg-2);
  border-radius: 12px; padding: 14px 15px; font-size: 16px; line-height: 1.58;
  transition: all 0.15s; width: 100%;
}
.alt .letra {
  font-family: "Playfair Display", serif; font-weight: 800; font-size: 16px;
  color: var(--brand); min-width: 22px;
}
.alt:hover { border-color: rgba(255, 176, 1, 0.5); }
.alt.sel { border-color: var(--brand); background: rgba(255, 176, 1, 0.08); }
.alt.certa { border-color: var(--green); background: rgba(42, 157, 143, 0.15); }
.alt.errada { border-color: var(--red); background: rgba(230, 57, 70, 0.08); }
.alt:disabled { cursor: default; }
.alt:disabled:hover { border-color: var(--border); }
.alt.certa:disabled:hover { border-color: var(--green); }
.alt.errada:disabled:hover { border-color: var(--red); }

.gabarito-box {
  background: rgba(255, 176, 1, 0.1); border: 1px solid rgba(255, 176, 1, 0.35);
  border-radius: 12px; padding: 14px; margin-bottom: 12px;
}
.gabarito-box .g-t { font-family: "Playfair Display", serif; font-size: 19px; font-weight: 800; color: var(--brand); }
.resultado-flag { font-weight: 800; font-size: 14px; }
.resultado-flag.ok { color: var(--green); }
.resultado-flag.erro { color: var(--red); }

.comentario { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--bg-2); }
.comentario h4 { font-family: "Inter", sans-serif; font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--brand); margin: 14px 0 6px; }
.comentario h4:first-child { margin-top: 0; }
.comentario p, .comentario li { font-size: 15px; line-height: 1.65; color: var(--text); }
.comentario ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.coment-head {
  display: flex; gap: 11px; align-items: center;
  margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.coment-av {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad); display: grid; place-items: center;
  font-family: "Playfair Display", serif; font-weight: 800; font-size: 19px; color: #241A05;
  box-shadow: 0 3px 12px rgba(255, 176, 1, 0.3);
}
.coment-head b { font-size: 14.5px; }
.coment-head i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); }

.share-img { width: 100%; border-radius: 14px; border: 1px solid rgba(255, 176, 1, 0.35); display: block; }

.banner-sessao {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1.5px solid var(--brand) !important;
  background: linear-gradient(160deg, rgba(255, 176, 1, 0.12), transparent 60%), var(--bg-2);
  margin-bottom: 12px; cursor: pointer;
  animation: banner-pulse 2.4s ease-in-out infinite;
}
@keyframes banner-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 176, 1, 0); }
  50% { box-shadow: 0 0 22px rgba(255, 176, 1, 0.22); }
}

.ponto-crucial {
  background: rgba(255, 176, 1, 0.1); border: 1px solid rgba(255, 176, 1, 0.3);
  border-radius: 10px; padding: 13px; font-size: 15px; line-height: 1.6; margin-top: 6px;
}
.fonte-legal { font-size: 13.5px; color: var(--text-2); font-style: italic; margin-top: 6px; }

.pegadinha {
  background: rgba(230, 57, 70, 0.08); border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: 12px; padding: 14px 15px; font-size: 15px; line-height: 1.6; margin-top: 12px;
}
.pegadinha b { color: var(--red); }

.q-acoes { display: flex; gap: 10px; margin-top: 16px; }

/* ---------- forms ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text-2); }
.input, select.input {
  width: 100%; padding: 12px 14px; border-radius: 11px;
  border: 1.5px solid var(--border); background: var(--bg-2); color: var(--text);
  outline: none; transition: border-color 0.15s; font-size: 16px;
}
/* ⚠️ REGRA DE OURO iOS: campo de texto com fonte < 16px faz o Safari dar
   ZOOM na página ao focar — e a página fica "cortada" à direita depois.
   TODO campo de digitação tem que ter 16px no mínimo. */
input:not([type="range"]):not([type="checkbox"]), select, textarea { font-size: 16px; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 176, 1, 0.16); }
select.input { appearance: none; }

input[type="range"] { width: 100%; accent-color: var(--brand); }

.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.switch-row .sl { font-size: 14px; font-weight: 600; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 99px; background: var(--bg-3);
  border: 1px solid var(--border); transition: background 0.2s; cursor: pointer;
}
.switch .track::after {
  content: ""; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); top: 2px; left: 2px; transition: all 0.2s;
}
.switch input:checked + .track { background: rgba(255, 176, 1, 0.25); border-color: var(--brand); }
.switch input:checked + .track::after { background: var(--brand); left: 22px; }

/* ---------- editais ---------- */

.estados-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.estado-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 10px; text-align: center; transition: border-color 0.15s;
}
.estado-card:hover { border-color: var(--brand); }
.estado-card .uf { font-family: "Playfair Display", serif; font-size: 22px; font-weight: 800; color: var(--brand); }
.estado-card .nm { font-size: 11px; color: var(--text-2); font-weight: 600; margin-top: 2px; }
.estado-card .badge { margin-top: 7px; font-size: 9.5px; }

.badge {
  display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 3px 8px; border-radius: 6px;
}
.badge.aberto { background: rgba(42, 157, 143, 0.15); color: var(--green); }
.badge.banca { background: rgba(255, 176, 1, 0.14); color: var(--brand); }
.badge.previsto { background: var(--bg-3); color: var(--text-2); }

.concurso-card { border-left: 3px solid var(--brand); }
.concurso-card .cc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.concurso-card h3 { font-size: 18px; }
.cc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 10px; }
.cc-info .ci { font-size: 13px; }
.cc-info .ci b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); font-weight: 700; }

.disc-check { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.disc-check:last-child { border-bottom: none; }
.disc-check input { accent-color: var(--brand); width: 17px; height: 17px; }
.disc-check.done span { color: var(--muted); text-decoration: line-through; }

/* ---------- estatísticas ---------- */

.bar-row { margin-bottom: 12px; }
.bar-row .br-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.bar-row .br-track { height: 9px; background: var(--bg-3); border-radius: 99px; overflow: hidden; }
.bar-row .br-fill { height: 100%; border-radius: 99px; background: var(--grad); transition: width 0.5s; }
.bar-row.fraco .br-fill { background: var(--red); }
.bar-row.forte .br-fill { background: var(--green); }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.tab {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  color: var(--text-2); white-space: nowrap; border: 1.5px solid var(--border); background: var(--bg-2);
}
.tab.on { background: var(--brand); color: #241A05; border-color: var(--brand); }

/* ---------- pomodoro ---------- */

.pomo-wrap { text-align: center; padding: 24px 0; }
.pomo-timer {
  font-family: "Playfair Display", serif; font-size: 54px; font-weight: 800;
  font-variant-numeric: tabular-nums; line-height: 1; color: var(--brand);
  position: relative; z-index: 1;
}
.pomo-fase { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-2); margin-bottom: 10px; }
.pomo-ring { width: 230px; height: 230px; margin: 0 auto 18px; position: relative; display: grid; place-items: center; border-radius: 50%; }
.pomo-ring svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.pomo-ring circle { fill: none; stroke-width: 9; }
.pomo-ring .ring-bg { stroke: var(--bg-3); }
.pomo-ring .ring-fg { stroke: url(#gradRing); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }

/* ---------- simulado resultado ---------- */

.nota-grande {
  text-align: center; padding: 24px 0 10px;
}
.nota-grande .n { font-family: "Playfair Display", serif; font-size: 64px; font-weight: 800; color: var(--brand); line-height: 1; }
.nota-grande .d { color: var(--text-2); font-size: 13px; margin-top: 6px; }

.rev-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.rev-item:last-child { border: none; }
.rev-item .ic { font-weight: 800; font-size: 15px; min-width: 20px; }
.rev-item .ic.ok { color: var(--green); }
.rev-item .ic.erro { color: var(--red); }

/* ---------- planos (vitrine de venda) ---------- */
.plano-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .plano-grid { grid-template-columns: 1fr 1fr; } }
.plano-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px 16px 16px;
}
.plano-card.destaque { border: 1.5px solid var(--brand); box-shadow: 0 0 24px rgba(255, 176, 1, 0.12); }
.plano-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #15110C; font-size: 10px; font-weight: 800;
  letter-spacing: 0.5px; text-transform: uppercase; padding: 4px 12px;
  border-radius: 999px; white-space: nowrap;
}
.plano-nome { font-size: 13px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--text-2); }
.plano-preco { font-family: "Playfair Display", Georgia, serif; font-size: 28px; font-weight: 800; color: var(--brand); margin-top: 6px; line-height: 1; }
.plano-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.plano-desc { font-size: 12.5px; color: var(--text-2); margin: 10px 0 14px; line-height: 1.5; }

/* ---------- modal / toast / loading ---------- */

.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(10, 8, 5, 0.7);
  backdrop-filter: blur(4px); display: grid; place-items: end center; padding: 0;
}
@media (min-width: 640px) { .modal-bg { place-items: center; padding: 20px; } }
.modal {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 20px 20px 0 0; width: 100%; max-width: 560px;
  padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
  max-height: 88vh; max-height: 88dvh; overflow-y: auto;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  animation: slideup 0.22s ease;
}
/* com modal aberto, o fundo não rouba o gesto de rolagem (mobile) */
body.modal-aberto { overflow: hidden; }
@media (min-width: 640px) { .modal { border-radius: 20px; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 20px; margin-bottom: 4px; }

.toast {
  position: fixed; bottom: calc(86px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--brand); color: var(--text);
  padding: 11px 18px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  z-index: 200; box-shadow: var(--shadow); max-width: 92vw; text-align: center;
  animation: slideup 0.2s ease;
}
@media (min-width: 900px) { .toast { bottom: 30px; } }

.spinner {
  width: 38px; height: 38px; border-radius: 50%; margin: 0 auto;
  border: 3.5px solid var(--bg-3); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-box { text-align: center; padding: 36px 16px; }
.loading-box .msg { margin-top: 14px; font-weight: 700; color: var(--text-2); font-size: 14px; }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .e-ico { font-size: 40px; margin-bottom: 10px; }
.empty .e-t { font-family: "Playfair Display", serif; font-size: 18px; color: var(--text-2); font-weight: 700; }

.aviso {
  font-size: 12.5px; color: var(--text-2); background: var(--bg-3);
  border-radius: 10px; padding: 10px 12px; line-height: 1.5;
}

.divider { height: 1px; background: var(--border); margin: 16px 0; }

.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 700; font-size: 13.5px; margin-bottom: 12px; cursor: pointer; white-space: nowrap; }
.back-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.back-link:hover { color: var(--brand); }

.footer-note { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 28px; line-height: 1.6; }

/* ---------- landing / auth ---------- */

.landing { text-align: center; padding: 34px 8px 20px; }
.landing-brasao { width: 110px; height: 110px; filter: drop-shadow(0 8px 28px rgba(255, 176, 1, 0.35)); animation: brasao-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
.landing-h1 { font-size: 32px; line-height: 1.2; margin-top: 18px; }
.landing-h1 span { color: var(--brand); }
.landing-foco { font-size: 13.5px; color: var(--text-2); margin-top: 10px; }
.landing-foco b { color: var(--brand); }
/* landing limpa, sem imagem de fundo (decisão de 11/06) */
.landing-stats { display: flex; justify-content: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.landing-stats .lst {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 18px; min-width: 104px;
}
.landing-stats .lst b { display: block; font-family: "Playfair Display", serif; font-size: 26px; color: var(--brand); }
.landing-stats .lst span { font-size: 11px; color: var(--text-2); font-weight: 600; }
@keyframes brasao-in { from { transform: scale(0.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

.erro-box { border: 1px solid rgba(230, 57, 70, 0.4); color: var(--red); margin-top: 12px; }

/* telas de autenticação */
.auth-wrap { max-width: 440px; margin: 0 auto; }
.auth-brasao {
  display: block; width: 76px; height: 76px; margin: 6px auto 12px;
  filter: drop-shadow(0 6px 20px rgba(255, 176, 1, 0.35));
  animation: brasao-in 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.auth-card {
  border-color: rgba(255, 176, 1, 0.3);
  box-shadow: 0 0 44px rgba(255, 176, 1, 0.07), var(--shadow);
}

/* mentoria — WhatsApp */
.card-mentoria {
  border: 1.5px solid rgba(255, 176, 1, 0.5);
  background:
    linear-gradient(160deg, rgba(255, 176, 1, 0.12), transparent 58%),
    var(--bg-2);
  box-shadow: 0 0 36px rgba(255, 176, 1, 0.08);
}
.btn-wa {
  background: #25D366; color: #06281A;
  box-shadow: 0 4px 18px rgba(37, 211, 102, 0.3);
}
.card-mentoria-mini { padding: 12px 14px; }
.input-sm { padding: 9px 12px; font-size: 16px; } /* nunca < 16px: zoom do iOS */
.btn-wa:hover { filter: brightness(1.06); }
.btn-wa svg { width: 19px; height: 19px; }
a.btn-wa { color: #06281A; }

/* ---------- sala de instrução (aulas) ---------- */

.tema-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1.5px solid var(--border); background: var(--bg-2);
  border-radius: 12px; padding: 13px 14px; font-size: 14.5px; font-weight: 600;
  transition: border-color 0.15s, transform 0.08s;
}
.tema-btn:hover { border-color: var(--brand); }
.tema-btn:active { transform: scale(0.985); }
.tema-btn .play-ico { color: var(--brand); display: grid; place-items: center; }
.tema-btn .play-ico svg { width: 22px; height: 22px; }
.tema-btn .ext-ico { color: var(--muted); }
.tema-btn .ext-ico svg { width: 15px; height: 15px; }

.link-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.link-row .btn { flex: 1; min-width: 120px; }

/* ---------- dinâmica / microinterações ---------- */

#view.anim-in > * { animation: fadeUp 0.34s ease both; }
#view.anim-in > *:nth-child(2) { animation-delay: 0.04s; }
#view.anim-in > *:nth-child(3) { animation-delay: 0.08s; }
#view.anim-in > *:nth-child(4) { animation-delay: 0.12s; }
#view.anim-in > *:nth-child(5) { animation-delay: 0.16s; }
#view.anim-in > *:nth-child(6) { animation-delay: 0.2s; }
#view.anim-in > *:nth-child(n+7) { animation-delay: 0.24s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.gabarito-box.fx-ok { animation: pop-ok 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
.gabarito-box.fx-erro { animation: shake 0.4s ease; }
@keyframes pop-ok { 0% { transform: scale(0.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}

.xp-float {
  position: fixed; left: 50%; bottom: 30%; transform: translateX(-50%);
  z-index: 300; pointer-events: none;
  font-family: "Playfair Display", serif; font-weight: 800; font-size: 30px;
  color: var(--brand); text-shadow: 0 2px 16px rgba(255, 176, 1, 0.5);
  animation: xp-rise 1.25s ease-out forwards;
}
@keyframes xp-rise {
  0% { opacity: 0; transform: translate(-50%, 16px) scale(0.8); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -64px) scale(1); }
}

.acao-card .ico, .kpi .v { transition: transform 0.15s ease; }
.acao-card:hover .ico { transform: scale(1.08) rotate(-3deg); }

/* ---------- simulado: distribuição por matéria ---------- */

.step-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: none; }
.step-row.zerada { opacity: 0.42; }
.step-nome { font-size: 13.5px; font-weight: 600; min-width: 0; }
.step-max { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.step-ctrl { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.step-btn {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1.5px solid var(--border); background: var(--bg-2); color: var(--text);
  font-weight: 800; font-size: 15px; display: grid; place-items: center;
  transition: border-color 0.15s, transform 0.08s;
}
.step-btn:hover { border-color: var(--brand); color: var(--brand); }
.step-btn:active { transform: scale(0.92); }
.step-val { min-width: 24px; text-align: center; font-weight: 800; font-size: 15px; color: var(--brand); font-variant-numeric: tabular-nums; }

/* ---------- ranking ---------- */

.rk-item { display: flex; align-items: center; gap: 11px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.rk-item:last-child { border-bottom: none; }
.rk-item.eu {
  background: rgba(255, 176, 1, 0.09); border: 1px solid rgba(255, 176, 1, 0.4);
  border-radius: 12px; margin: 4px -6px; padding: 10px 12px;
}
.rk-pos { font-family: "Playfair Display", serif; font-weight: 800; font-size: 15px; min-width: 34px; color: var(--text-2); }
.rk-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-3); display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: var(--brand);
}
.rk-item.eu .rk-av { background: var(--grad); color: #241A05; }
.rk-free { font-size: 10px; vertical-align: middle; padding: 1px 5px; margin-left: 4px; border-radius: 6px; background: rgba(255,255,255,0.08); border: 1px solid var(--border); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============ SIMULADOS OFICIAIS ============ */

.sim-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  cursor: pointer;
  border: 1.5px solid rgba(255, 176, 1, 0.45);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.sim-cta:hover { transform: translateY(-1px); border-color: var(--brand); }
.sim-cta .ico { font-size: 24px; }

.sim-nota { font-size: 13.5px; margin-top: 8px; color: var(--text-2); }

.sim-regras {
  margin: 0 0 14px 18px;
  padding: 0;
  font-size: 13.5px;
  color: var(--text-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cartao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  margin: 14px 0 16px;
  max-height: 280px;
  overflow: auto;
}
.cr-num {
  aspect-ratio: 1;
  min-height: 42px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
}
.cr-num.ok {
  border-color: var(--brand);
  background: rgba(255, 176, 1, 0.16);
  color: var(--brand);
}
.cr-num.atual { outline: 2px solid var(--brand); outline-offset: 1px; }
.cr-num.rev { position: relative; border-color: #6ea8ff; }
.cr-num.rev::after { content: "🔖"; position: absolute; top: -7px; right: -5px; font-size: 11px; line-height: 1; }

/* ---- brasão do órgão no simulado ---- */
.sim-brasao { height: auto; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(0,0,0,.35)); }

/* ---- papo de quartel (discussão por questão) ---- */
.disc-bloco { margin-top: 12px; }
.disc-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.disc-item:first-child { border-top: none; }
.disc-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.disc-form textarea { resize: vertical; min-height: 44px; font-size: 13.5px; }

/* ---- cartão-resposta seccionado por matéria ---- */
.cartao-corpo { max-height: 46vh; overflow: auto; margin: 12px 0 16px; }
.cartao-corpo .cartao-grid { max-height: none; overflow: visible; margin: 8px 0 14px; }
.cr-sec {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px;
  background: var(--bg-3); border: 1px solid var(--border); border-radius: 10px;
  text-align: left;
}
.cr-sec-nome { font-weight: 800; font-size: 13px; }
.cr-sec-faixa { font-size: 11.5px; color: var(--brand); font-weight: 700; white-space: nowrap; }

/* ---- pastas de concursos na vitrine de simulados ---- */
.pasta-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%; margin-bottom: 12px; cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.pasta-card:hover { transform: translateY(-1px); border-color: var(--brand); }
.pasta-card .pasta-ico { font-size: 36px; }
#sim-titulo .sim-brasao { vertical-align: middle; margin-right: 6px; }

/* ---- concurso atual + foto de perfil ---- */
.pasta-card.pasta-atual { border-color: var(--brand); }
.pasta-card.trancado { opacity: 0.72; }
.pasta-card.trancado img, .pasta-card.trancado .pasta-ico { filter: grayscale(0.7); }
.avatar-btn {
  position: relative; width: 56px; height: 56px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0; cursor: pointer; padding: 0;
  border: 2px solid var(--border);
}
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-cam {
  position: absolute; right: -2px; bottom: -2px;
  background: var(--bg-2); border-radius: 50%; font-size: 12px;
  width: 20px; height: 20px; display: grid; place-items: center;
  border: 1px solid var(--border);
}

/* ---- freemium: paywall e cards trancados ---- */
.paywall-banner {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-bottom: 12px; cursor: pointer;
  border: 1.5px solid var(--brand); background: rgba(255,176,1,0.07);
}
.acao-card.trancado { position: relative; opacity: 0.82; }
.acao-card.trancado .ico { filter: grayscale(0.6); }
.lock-badge {
  position: absolute; top: 8px; right: 10px; font-size: 14px;
  opacity: 0.9; z-index: 1;
}
