:root {
  --brand: #1e5b45;        /* verde-escuro (logo, títulos) */
  --brand-2: #2f7d5b;      /* verde principal (botões, links) */
  --brand-3: #5fa982;      /* verde médio */
  --mint: #e7f3ec;         /* verde bem claro (fundos) */
  --mint-2: #d3eadc;
  --accent: #7cc49b;       /* destaque suave */
  --ok: #2e8b57;
  --err: #c0504d;
  --bs-primary: #2f7d5b;
  --bs-primary-rgb: 47, 125, 91;
  --bs-success: #2e8b57;
  --bs-success-rgb: 46, 139, 87;
  --bs-link-color: #2f7d5b;
  --bs-link-color-rgb: 47, 125, 91;
  --bs-link-hover-color: #1e5b45;
  --bs-link-hover-color-rgb: 30, 91, 69;
  --bs-body-color: #22352c;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body { background: #f4f9f5; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
.btn-primary { --bs-btn-bg: var(--brand-2); --bs-btn-border-color: var(--brand-2); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand-2); --bs-btn-border-color: var(--brand-2); --bs-btn-hover-bg: var(--brand-2); --bs-btn-hover-border-color: var(--brand-2); }
.text-primary { color: var(--brand-2) !important; }
.app-nav { background: #ffffffe6; backdrop-filter: blur(6px); border-bottom: 1px solid var(--mint-2); }
.app-nav .nav-link { color: #3d5a4b; font-weight: 500; border-radius: .5rem; padding: .4rem .75rem !important; }
.app-nav .nav-link:hover { color: var(--brand); background: var(--mint); }
.app-nav .nav-link.active { color: var(--brand); background: var(--mint-2); }
.brand-logo { height: 38px; width: auto; }
.brand-name { font-weight: 800; color: var(--brand); letter-spacing: -.01em; line-height: 1; }
.brand-name span { color: var(--brand-3); }
.btn-success { --bs-btn-bg: var(--brand-2); --bs-btn-border-color: var(--brand-2); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn-mint { background: var(--mint); color: var(--brand); border: 1px solid var(--mint-2); font-weight: 600; }
.btn-mint:hover { background: var(--mint-2); color: var(--brand); }
.bg-success { background-color: var(--ok) !important; }
.text-success { color: var(--ok) !important; }
.form-control:focus, .form-select:focus { border-color: var(--brand-3); box-shadow: 0 0 0 .2rem rgba(95,169,130,.25); }
.form-check-input:checked { background-color: var(--brand-2); border-color: var(--brand-2); }
.card { border-color: #dcebe2; }
.card { border: 1px solid #dcebe2; border-radius: .9rem; }
.card-header:first-child { border-radius: .8rem .8rem 0 0; }

/* home */
.hero { background: radial-gradient(900px 380px at 85% -10%, #cfe9da 0%, transparent 60%), linear-gradient(160deg, #eef8f1 0%, #e1f1e7 100%); color: var(--bs-body-color); margin-top: -1.5rem; border-bottom: 1px solid var(--mint-2); }
.hero-lead { color: #4a6558; }
.hero-logo { max-width: 320px; width: 100%; height: auto; }
.stat-tile { background: #fff; border: 1px solid var(--mint-2); border-radius: 1rem; padding: 1rem .5rem; box-shadow: 0 .3rem .9rem rgba(30,91,69,.06); }
.stat-tile .n { font-size: 2rem; font-weight: 800; color: var(--brand-2); line-height: 1; }
.stat-tile div:last-child { color: #5b7467; font-size: .9rem; }
.feature { background: #fff; border: 1px solid #dcebe2; border-radius: .8rem; padding: 1.4rem; height: 100%; }
.feature i { font-size: 1.6rem; color: var(--brand-2); background: var(--mint); width: 3rem; height: 3rem; border-radius: .8rem; display: inline-grid; place-items: center; }
.feature h3 { font-size: 1.05rem; font-weight: 700; margin: .5rem 0 .3rem; }
.feature p { color: #5b6573; margin: 0; font-size: .92rem; }

.exam-card { transition: transform .12s, box-shadow .12s; }
.exam-card:hover { transform: translateY(-2px); box-shadow: 0 .5rem 1.2rem rgba(30,91,69,.1); }
.mode-box { border: 1px solid #dcebe2; border-radius: .8rem; padding: 1rem; background: #f8fcf9; }

/* questão */
.question-card .statement { font-size: 1.05rem; line-height: 1.65; white-space: normal; }
.passage { background: #fbfcf7; border: 1px solid #e3e9d4; border-radius: .6rem; padding: .6rem .9rem; }
.passage summary { cursor: pointer; font-weight: 600; color: #5b6b2e; }
.passage-body { margin-top: .6rem; line-height: 1.7; max-height: 420px; overflow: auto; font-size: .95rem; }
.q-images summary { cursor: pointer; }
.q-img { max-height: 620px; }
.alts { display: flex; flex-direction: column; gap: .55rem; }
.alt { display: flex; gap: .8rem; align-items: flex-start; padding: .75rem .9rem; border: 1.5px solid #d9e8df; border-radius: .7rem; background: #fff; cursor: pointer; transition: border-color .1s, background .1s; line-height: 1.5; }
.alt:hover { border-color: var(--brand-3); background: #fbfefc; }
.alt input { position: absolute; opacity: 0; pointer-events: none; }
.alt .letter { flex: 0 0 2rem; height: 2rem; border-radius: 50%; border: 1.5px solid #b5cfc0; display: grid; place-items: center; font-weight: 700; color: #3d5a4b; }
.alt .txt { padding-top: .2rem; }
.alt:has(input:checked) { border-color: var(--brand-2); background: var(--mint); }
.alt:has(input:checked) .letter { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.alts.answered .alt { cursor: default; }
.alt.correct { border-color: var(--ok); background: #e5f4ea; }
.alt.correct .letter { background: var(--ok); border-color: var(--ok); color: #fff; }
.alt.correct .bi { color: var(--ok); font-size: 1.2rem; }
.alt.wrong { border-color: var(--err); background: #fbeeed; }
.alt.wrong .letter { background: var(--err); border-color: var(--err); color: #fff; }
.alt.wrong .bi { color: var(--err); font-size: 1.2rem; }
.feedback { border-radius: .7rem; padding: 1rem 1.2rem; }
.feedback.ok { background: #e5f4ea; color: #1e5b45; border: 1px solid #b9dfc8; }
.feedback.err { background: #fbeeed; color: #8a3330; border: 1px solid #efc6c4; }
.explanation { background: #f3f9f5; border-radius: .6rem; padding: .9rem 1.1rem; line-height: 1.6; }

/* mapa de questões */
.qmap { display: flex; flex-wrap: wrap; gap: 4px; }
.qmap a { width: 30px; height: 30px; display: grid; place-items: center; font-size: .75rem; border-radius: 6px; background: #fff; border: 1px solid #d3e3d9; color: #3d5a4b; text-decoration: none; }
.qmap-sm a { width: 26px; height: 26px; font-size: .7rem; }
.qmap a.ok { background: #d1f0dc; border-color: #9ad5b0; color: #0f5132; }
.qmap a.err { background: #f8d7da; border-color: #eea6ad; color: #842029; }
.qmap a.warn { background: #fff3cd; border-color: #f5d77a; color: #664d03; }
.qmap a.null { background: #e9ecef; color: #6c757d; text-decoration: line-through; }
.qmap a.done { background: var(--mint-2); border-color: var(--brand-3); color: var(--brand); }
.qmap a.cur { outline: 2px solid var(--brand-2); outline-offset: 1px; font-weight: 700; }
.legend { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: .4rem; }
.legend.ok { background: #d1f0dc; } .legend.warn { background: #fff3cd; } .legend.err { background: #f8d7da; } .legend.null { background: #e9ecef; }

/* simulado */
.sim-bar { background: rgba(244,249,245,.96); backdrop-filter: blur(6px); padding: .6rem 0 .6rem; margin-bottom: 1rem; border-bottom: 1px solid #dcebe2; z-index: 10; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem; color: var(--brand); background: #fff; border: 1px solid #cfe3d7; border-radius: .5rem; padding: .1rem .6rem; }
.timer.low { color: var(--err); border-color: var(--err); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* resultado */
.score-ring { --p: 0; width: 170px; height: 170px; border-radius: 50%; margin: auto; display: grid; place-items: center;
  background: radial-gradient(closest-side, #fff 78%, transparent 79% 100%), conic-gradient(var(--brand-3) calc(var(--p) * 1%), #e3efe8 0); }
.review-item summary { list-style: none; cursor: pointer; }
.review-item summary::-webkit-details-marker { display: none; }
.rv-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700; background: #e9ecef; flex: 0 0 28px; }
.review-item.ok .rv-dot { background: var(--ok); color: #fff; }
.review-item.err .rv-dot { background: var(--err); color: #fff; }

.kpi { background: #fff; border: 1px solid #dcebe2; border-radius: .8rem; padding: 1rem; height: 100%; }
.kpi i { font-size: 1.3rem; }
.kpi .n { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.kpi .l { color: #6c757d; font-size: .8rem; }
.admin-q .statement { font-size: .9rem; }

/* explicação */
.explanation .exp-h { font-weight: 700; color: var(--brand); margin-top: .2rem; margin-bottom: .2rem; }
.explanation .exp-gap { height: .6rem; }
.explanation .exp-alt { display: flex; gap: .5rem; margin: .25rem 0; }
.explanation .exp-letter { flex: 0 0 1.5rem; height: 1.5rem; border-radius: 50%; background: #fdeeee; color: #842029; font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.explanation .exp-fundamento { background: #e7f3ec; border-left: 3px solid var(--brand-2); padding: .4rem .6rem; border-radius: .3rem; }
.explanation .exp-dica { background: #fbf7e6; border-left: 3px solid #d9c26a; padding: .4rem .6rem; border-radius: .3rem; }

footer.site-footer { background: #fff; border-top: 1px solid var(--mint-2); }
.footer-logo { height: 56px; opacity: .9; }

/* ---------- menu inferior (celular) ---------- */
:root { --bottom-nav-h: 64px; --nav-h: 62px; }
html, body { overflow-x: clip; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--mint-2); box-shadow: 0 -.3rem 1rem rgba(30,91,69,.06);
}
.bottom-nav a, .bottom-nav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: #6b8577; text-decoration: none; font-size: .7rem; font-weight: 500;
  background: none; border: 0; padding: 0; position: relative; -webkit-tap-highlight-color: transparent;
}
.bottom-nav i { font-size: 1.3rem; line-height: 1; }
.bottom-nav .active { color: var(--brand); font-weight: 700; }
.bottom-nav .active::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand-2);
}
.bottom-nav a:active, .bottom-nav button:active { background: var(--mint); }
.more-menu { height: auto !important; max-height: 70vh; border-radius: 1.1rem 1.1rem 0 0; padding-bottom: env(safe-area-inset-bottom); }
.more-menu .list-group-item { border: 0; padding: .8rem 1rem; font-weight: 500; border-radius: .6rem; }
.more-menu .list-group-item i { color: var(--brand-2); width: 1.6rem; display: inline-block; }

@media (max-width: 991.98px) {
  body.has-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .brand-logo { height: 32px; }
  .brand-name { font-size: 1.05rem; }
  .app-nav { padding-top: .45rem; padding-bottom: .45rem; }
}

/* ---------- ajustes para telas pequenas ---------- */
@media (max-width: 767.98px) {
  main { padding-top: 1rem !important; padding-bottom: 1rem !important; }
  .hero { margin-top: -1rem; }
  .hero h1 { font-size: 1.9rem; }
  .hero .lead { font-size: 1.02rem; }
  .stat-tile { padding: .7rem .25rem; }
  .stat-tile .n { font-size: 1.5rem; }
  .question-card .card-body { padding: 1rem !important; }
  .question-card .statement { font-size: 1rem; }
  .alt { padding: .65rem .7rem; gap: .6rem; }
  .alt .letter { flex-basis: 1.8rem; height: 1.8rem; font-size: .9rem; }
  /* mapa de questões vira uma faixa com rolagem horizontal */
  .qmap.qmap-scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scroll-snap-type: x proximity; }
  .qmap.qmap-scroll a { flex: 0 0 auto; scroll-snap-align: center; }
  .kpi .n { font-size: 1.3rem; }
  .score-ring { width: 140px; height: 140px; }
  h1.h3 { font-size: 1.4rem; }
  .table { font-size: .85rem; }
}

/* barra de ações da questão fixa embaixo no celular (modo foco) */
@media (max-width: 767.98px) {
  .answer-bar {
    position: sticky; bottom: 0; z-index: 5; background: rgba(255,255,255,.97); backdrop-filter: blur(6px);
    margin: 1rem -1rem -1rem !important; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--mint-2); border-radius: 0 0 .9rem .9rem; gap: .5rem;
  }
  .answer-bar .btn { padding-left: .8rem !important; padding-right: .8rem !important; }
  .answer-bar .btn-main { flex: 1; }
}

/* simulado: barra fica logo abaixo do menu superior */
.sim-bar { top: var(--nav-h); }
.min-w-0 { min-width: 0; }

/* passos "como funciona" (página inicial) */
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.flow-steps::before { /* linha que liga os passos */
  content: ""; position: absolute; top: 1.3rem; left: 12.5%; right: 12.5%; height: 2px;
  background: repeating-linear-gradient(90deg, var(--brand-3) 0 6px, transparent 6px 11px); opacity: .6;
}
.flow-steps li { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; position: relative; }
.flow-steps .step-icon {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 1.5px solid var(--mint-2); color: var(--brand-2); font-size: 1.1rem;
  box-shadow: 0 .2rem .6rem rgba(30,91,69,.08); position: relative; z-index: 1;
}
.flow-steps li:last-child .step-icon { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.flow-steps .step-label { font-size: .78rem; font-weight: 600; color: #4a6558; line-height: 1.2; }
@media (max-width: 767.98px) {
  .flow-steps .step-icon { width: 2.2rem; height: 2.2rem; font-size: .95rem; }
  .flow-steps::before { top: 1.1rem; }
  .flow-steps .step-label { font-size: .7rem; }
}

/* ---------- páginas institucionais ---------- */
.page-hero { background: linear-gradient(160deg, #eef8f1 0%, #e1f1e7 100%); border-bottom: 1px solid var(--mint-2); margin-top: -1.5rem; padding: 2rem 0; }
.page-hero h1 { color: var(--brand); }
.page-hero-icon { flex: 0 0 3.2rem; height: 3.2rem; border-radius: 1rem; background: #fff; border: 1px solid var(--mint-2); display: grid; place-items: center; font-size: 1.5rem; color: var(--brand-2); }
.prose { line-height: 1.75; color: #2a3f35; }
.prose h2 { font-size: 1.3rem; font-weight: 700; color: var(--brand); margin: 2rem 0 .75rem; scroll-margin-top: 80px; }
.prose h3 { font-size: 1.02rem; font-weight: 700; margin: 0 0 .25rem; color: var(--brand); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.prose .lead { font-size: 1.12rem; }
.legal { font-size: .97rem; }
.legal table { font-size: .9rem; }
.legal th { color: var(--brand); }
.toc { background: #fff; border: 1px solid var(--mint-2); border-radius: .8rem; padding: .75rem 1rem; font-size: .88rem; line-height: 2; }
.toc a { white-space: nowrap; }
.summary-box { background: var(--mint); border: 1px solid var(--mint-2); border-radius: .9rem; padding: 1rem 1.2rem; }
.cta-box { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; background: #fff; border: 1px solid var(--mint-2); border-radius: .9rem; padding: 1rem 1.2rem; }
.steps { display: flex; flex-direction: column; gap: .8rem; }
.step { display: flex; gap: 1rem; background: #fff; border: 1px solid #dcebe2; border-radius: .9rem; padding: 1rem 1.1rem; }
.step .n { flex: 0 0 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand-2); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step p { margin-bottom: .4rem; } .step p:last-child { margin-bottom: 0; }
.faq-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.faq .accordion-item { border-color: #dcebe2; }
.faq .accordion-item:first-of-type { border-top-left-radius: .8rem; border-top-right-radius: .8rem; }
.faq .accordion-item:last-of-type { border-bottom-left-radius: .8rem; border-bottom-right-radius: .8rem; }
.faq .accordion-button { font-weight: 600; color: var(--brand); }
.faq .accordion-button:not(.collapsed) { background: var(--mint); color: var(--brand); box-shadow: none; }
.faq .accordion-button:focus { box-shadow: 0 0 0 .2rem rgba(95,169,130,.25); }
.faq .accordion-body { line-height: 1.7; }
[id] { scroll-margin-top: 80px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.2rem; }
.footer-links a { color: #4a6558; text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; }
.more-sep { height: 1px; background: var(--mint-2); margin: .4rem .5rem; }
@media (max-width: 767.98px) { .page-hero { margin-top: -1rem; padding: 1.4rem 0; } .page-hero h1 { font-size: 1.5rem; } .step { padding: .85rem; gap: .75rem; } }

.footer-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; }
.footer-contact a { color: var(--brand); text-decoration: none; font-weight: 600; }
.footer-contact a:hover { text-decoration: underline; }
.footer-contact .wa i { color: #25a35a; }
