/* Passas! — tema baseado no mockup (creme, verde-escuro, lima). Todas as cores em tokens. */
:root {
  --bg: #f7f4f1;
  --surface: #fbf9f7;
  --surface-2: #f1eeea;
  --surface-3: #ebe7e2;
  --border: #e7e2dc;
  --ink: #0d1614;
  --text: #1b2421;
  --muted: #5f6864;
  --primary: #17302e;
  --primary-2: #24443f;
  --on-primary: #ffffff;
  --lime: #cfe75e;
  --lime-soft: #e9f0ce;
  --lime-badge: #e3eeb2;
  --on-lime: #17302e;
  --olive: #6a7a46;
  --deep: #1d3419;
  --dark-card: #1c2926;
  --on-dark: #f3f5f2;
  --ok: #3f7a2e;
  --ok-bg: #e8f1d9;
  --bad: #b93a2f;
  --bad-bg: #f8e3df;
  --warn: #8a6410;
  --warn-bg: #f6e8c4;
  --amber: #e6b93d;
  --ring: #3e5139;
  --ring-track: #e7e3e0;
  --ev-theory: #73933d;
  --ev-tp: #5ba5de;
  --ev-practical: #eeb33b;
  --ev-exam: #d0544a;
  --ev-other: #9aa3a0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(23, 48, 46, .04), 0 6px 24px rgba(23, 48, 46, .05);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --hero-img-opacity: 1;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1514; --surface: #151d1b; --surface-2: #1b2522; --surface-3: #22302c; --border: #26322f;
    --ink: #f1f4f0; --text: #e4e9e5; --muted: #9ba8a2; --primary: #cfe75e; --primary-2: #dbef80; --on-primary: #12201c;
    --lime: #cfe75e; --lime-soft: #26341d; --lime-badge: #2c3b1f; --on-lime: #12201c; --olive: #a9bd73; --deep: #d6eb7a;
    --dark-card: #1a2a26; --ok: #8fcf6a; --ok-bg: #1e3018; --bad: #ff8a7d; --bad-bg: #3a1c18; --warn: #f0c35a; --warn-bg: #3a2e10;
    --ring: #cfe75e; --ring-track: #26322f; --shadow: 0 1px 2px rgba(0,0,0,.3); --hero-img-opacity: .35; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1514; --surface: #151d1b; --surface-2: #1b2522; --surface-3: #22302c; --border: #26322f;
  --ink: #f1f4f0; --text: #e4e9e5; --muted: #9ba8a2; --primary: #cfe75e; --primary-2: #dbef80; --on-primary: #12201c;
  --lime: #cfe75e; --lime-soft: #26341d; --lime-badge: #2c3b1f; --on-lime: #12201c; --olive: #a9bd73; --deep: #d6eb7a;
  --dark-card: #1a2a26; --ok: #8fcf6a; --ok-bg: #1e3018; --bad: #ff8a7d; --bad-bg: #3a1c18; --warn: #f0c35a; --warn-bg: #3a2e10;
  --ring: #cfe75e; --ring-track: #26322f; --shadow: 0 1px 2px rgba(0,0,0,.3); --hero-img-opacity: .35; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75em; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--surface); padding: 8px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; border-radius: 6px; }
.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }

/* ---------- topo ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1640px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 0 clamp(16px, 3.5vw, 56px); min-height: 78px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; flex: none; }
.brand-plane { width: 64px; height: 42px; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text em { font-size: .82rem; font-weight: 500; }
.nav { display: flex; align-items: stretch; gap: 6px; margin: 0 auto; align-self: stretch; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 0 14px; color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.nav a .ico { width: 22px; height: 22px; }
.nav a:hover { color: var(--ink); }
.nav a.on { font-weight: 700; color: var(--ink); border-bottom-color: var(--lime); }
.theme-toggle { position: relative; display: flex; align-items: center; justify-content: space-between; width: 64px; height: 34px; padding: 0 4px; border-radius: 999px; border: 1.5px solid var(--ink); background: var(--surface); cursor: pointer; flex: none; color: var(--ink); }
.theme-toggle span { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.theme-toggle .ico { width: 16px; height: 16px; }
.theme-toggle[data-mode="light"] .tt-moon, .theme-toggle[data-mode="dark"] .tt-moon { background: var(--ink); color: var(--bg); }
.theme-toggle[data-mode="dark"] .tt-sun { color: var(--muted); }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 10px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .9rem; flex: none; max-width: 190px; position: relative; }
.acct-btn:hover { border-color: var(--ink); }
.acct-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-dot { position: absolute; top: 3px; left: 25px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); display: none; }
.acct-btn[data-state="ok"] .acct-dot { display: block; background: var(--ok); }
.acct-btn[data-state="syncing"] .acct-dot { display: block; background: var(--amber); }
.acct-btn[data-state="error"] .acct-dot { display: block; background: var(--bad); }
body[data-route="conta"] .acct-btn { border-color: var(--ink); }
.menu-btn { display: none; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 8px; }
.menu-btn .ico { width: 26px; height: 26px; }
@media (max-width: 1440px) { .nav a { padding: 0 9px; gap: 8px; } }
@media (max-width: 1320px) { .nav a .ico { display: none; } .nav { gap: 2px; } }
@media (max-width: 1080px) {
  .menu-btn { display: block; }
  .topbar-inner { justify-content: space-between; gap: 12px; }
  .acct-btn { margin-left: auto; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--bg); padding: 8px 16px 16px; border-bottom: 1px solid var(--border); margin: 0; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 8px; border-bottom: 0; border-left: 3px solid transparent; }
  .nav a .ico { display: inline; }
  .nav a.on { border-left-color: var(--lime); background: var(--surface-2); border-radius: 8px; }
  .brand-plane { width: 50px; height: 32px; }
  .brand-text strong { font-size: 1.1rem; }
}

/* ---------- layout ---------- */
main { min-height: 70vh; }
.page { max-width: 1640px; margin: 0 auto; padding: 28px clamp(16px, 3.5vw, 42px) 56px; }
.page-head { margin-bottom: 22px; }
.eyebrow { display: inline-block; background: var(--lime-badge); color: var(--ink); font-size: .8rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; margin-bottom: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.link { display: block; text-decoration: none; color: inherit; transition: transform .12s, border-color .12s; }
.card.link:hover { transform: translateY(-2px); border-color: var(--olive); }
.cards-3, .cards-2, .exam-summary, .deck-grid { display: grid; gap: 18px; margin-bottom: 18px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards-2, .exam-summary { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.deck-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.deck img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.site-foot { border-top: 1px solid var(--border); }
.foot-inner { max-width: 1640px; margin: 0 auto; padding: 18px clamp(16px, 3.5vw, 42px); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: .9rem; }
.foot-inner p { margin: 0; display: flex; align-items: center; gap: 10px; }
.foot-info { color: var(--ink); display: inline-flex; }
.foot-info .ico { width: 22px; height: 22px; }
.foot-brand { font-weight: 800; font-style: italic; color: var(--ink); }
.foot-plane svg { width: 40px; height: 24px; color: var(--ink); }
.empty { text-align: center; padding: 48px 16px; }
.locked, .dim { opacity: .55; }
.lock { font-size: .85rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.warn { background: var(--warn-bg); color: var(--warn); padding: 10px 14px; border-radius: 12px; }

/* ---------- botões, tags, formulários ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 22px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 46px; transition: background .12s, transform .12s; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.primary .ico-play { color: var(--lime); }
:root[data-theme="dark"] .btn.primary .ico-play { color: var(--on-primary); }
.btn.lime { background: var(--lime); color: var(--on-lime); border-color: var(--lime); }
.btn.ghost { border-color: var(--border); background: var(--surface); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.small { padding: 7px 14px; min-height: 36px; font-size: .88rem; }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 600; border: 0; font-family: inherit; }
.tag.lvl { background: var(--lime-badge); color: var(--ink); }
.count { font-size: .74rem; color: var(--muted); background: var(--surface-2); padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.form label { display: block; margin: 12px 0; font-weight: 600; color: var(--ink); }
.form input[type=text], .form input[type=number], .form input[type=search], .form select, .bank-filters select, .bank-filters input[type=search], .cal-toolbar select, .topics input[type=search] {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; min-height: 46px; }
.form input:focus, .form select:focus, .bank-filters input:focus { border-color: var(--olive); outline: none; }
.form .check, label.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; margin: 7px 0; color: var(--text); }
.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 18px; }
.form.inline { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
.form.inline label { flex: 1; min-width: 220px; margin: 0; }
fieldset { border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin: 14px 0; background: var(--bg); }
legend { font-weight: 700; padding: 0 6px; color: var(--ink); }
.quick-select { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tree-ch { margin-bottom: 8px; }
.tree-units { padding-left: 28px; }
.topic-list { max-height: 300px; overflow: auto; margin-top: 8px; }
.topic-actions { display: flex; gap: 8px; margin-top: 8px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--text); padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; min-height: 38px; border-radius: 999px; }
.seg button.on { background: var(--primary); color: var(--on-primary); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 12px 16px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; margin-bottom: -1px; }
.tabs a.on { color: var(--ink); border-color: var(--lime); }

/* ---------- tabelas ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; font-size: .92rem; margin-bottom: 18px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table th { background: var(--surface-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.table .num { text-align: right; white-space: nowrap; }
.chapter-row td { background: var(--surface-2); }
@media (max-width: 700px) { .syllabus th:nth-child(4), .syllabus td:nth-child(4), .syllabus th:nth-child(8), .syllabus td:nth-child(8) { display: none; } .table { display: block; overflow-x: auto; } }

/* ---------- início (hero + grelha) ---------- */
.home { padding-top: 0; }
.hero { position: relative; width: 100vw; margin-left: calc(50% - 50vw); padding: 34px max(clamp(16px, 3.5vw, 42px), calc(50vw - 820px + 42px)) 64px; min-height: 360px; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0 0 0 auto; width: min(62%, 1000px); background: url("../img/hero-wing.jpg") right top / cover no-repeat; opacity: var(--hero-img-opacity); -webkit-mask-image: linear-gradient(to right, transparent 0, #000 35%); mask-image: linear-gradient(to right, transparent 0, #000 35%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; max-width: 640px; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.6rem); line-height: .98; letter-spacing: -0.04em; margin: 6px 0 22px; }
.hero h1 em { display: block; font-style: italic; background: linear-gradient(90deg, var(--olive) 0%, var(--deep) 60%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 6px; }
.hero .lead { font-size: 1.12rem; color: var(--text); max-width: 34em; }
.hero .actions { margin-top: 24px; }
@media (max-width: 760px) { .hero { min-height: 0; padding-bottom: 40px; } .hero::after { width: 100%; opacity: calc(var(--hero-img-opacity) * .25); } }
.home-row { display: grid; gap: 22px; margin-top: 4px; margin-bottom: 22px; }
.home-row.r1 { grid-template-columns: minmax(300px, 1fr) minmax(0, 2.05fr); margin-top: -40px; position: relative; z-index: 2; }
.home-row.r2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) { .home-row.r1, .home-row.r2 { grid-template-columns: 1fr; } .home-row.r1 { margin-top: 0; } }
.home-row .card { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; display: flex; align-items: center; gap: 12px; }
.card-head .ico { width: 26px; height: 26px; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .92rem; text-decoration: none; color: var(--ink); }
.progress-card .pc-body { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--ring-track); }
.ring .val { stroke: var(--ring); stroke-linecap: round; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.1rem; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }
.pc-stats { list-style: none; margin: 0; padding: 0 0 0 26px; border-left: 1px solid var(--border); display: grid; gap: 14px; }
.pc-stats li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: center; }
.pc-stats .ico { width: 26px; height: 26px; }
.pc-stats strong { display: block; font-size: 1.1rem; color: var(--ink); }
.pc-stats small { color: var(--muted); font-size: .85rem; }
.ic-ok { color: var(--ev-theory); } .ic-gold { color: var(--amber); } .ic-ink { color: var(--ink); }
@media (max-width: 480px) { .progress-card .pc-body { grid-template-columns: 1fr; justify-items: center; } .pc-stats { border-left: 0; padding: 0; } }
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 800px) { .qa-grid { grid-template-columns: 1fr; gap: 10px; } .qa { grid-template-columns: auto 1fr auto; min-height: 0; padding: 14px 16px; gap: 2px 14px; } .qa .ico.big { grid-column: 1; grid-row: 1 / 3; margin: 0; width: 34px; height: 34px; align-self: center; } .qa strong { grid-column: 2; } .qa small { grid-column: 2; } .qa .ico.go { grid-column: 3; grid-row: 1 / 3; } }
.qa { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto auto; align-items: end; gap: 4px 12px; padding: 20px 22px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; color: inherit; transition: transform .12s, border-color .12s; min-height: 150px; }
.qa:hover { transform: translateY(-2px); border-color: var(--olive); }
.qa .ico.big { width: 42px; height: 42px; color: var(--ink); grid-column: 1 / -1; margin-bottom: 14px; align-self: start; }
.qa strong { font-size: 1.05rem; color: var(--ink); }
.qa small { color: var(--muted); grid-column: 1; }
.qa .ico.go { grid-column: 2; grid-row: 2 / 4; align-self: center; width: 22px; height: 22px; color: var(--ink); }
.lessons { list-style: none; margin: 0; padding: 0; }
.lessons li { display: grid; grid-template-columns: 16px 170px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); font-size: .95rem; }
.lessons .when { color: var(--text); font-weight: 500; }
.lessons .what { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .lessons li { grid-template-columns: 14px 1fr auto; } .lessons .what { grid-column: 2 / -1; white-space: normal; } }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--ev, var(--ev-other)); }
.pill-type { padding: 3px 12px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--lime-soft); color: var(--ink); }
.pill-type.ev-exam { background: var(--bad-bg); color: var(--bad); }
.pill-type.ev-practical { background: var(--warn-bg); color: var(--warn); }
.pill-type.ev-tp { background: color-mix(in srgb, var(--ev-tp) 18%, transparent); }
.module-hero { position: relative; overflow: hidden; background: var(--dark-card); color: var(--on-dark); border-radius: var(--radius); padding: 30px 34px; min-height: 175px; display: flex; flex-direction: column; justify-content: center; }
.module-hero::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 58%; background: url("../img/plane-wire.png") right center / cover no-repeat; -webkit-mask-image: linear-gradient(to right, transparent, #000 30%); mask-image: linear-gradient(to right, transparent, #000 30%); opacity: .95; }
.module-hero > * { position: relative; z-index: 1; max-width: 330px; }
.module-hero .bar { width: 44px; height: 4px; border-radius: 2px; background: var(--lime); margin-bottom: 14px; }
.module-hero h2 { color: #fff; font-size: 1.7rem; margin: 0 0 4px; }
.module-hero p { color: #d6dcd8; margin: 0 0 16px; }
.module-hero .btn { align-self: flex-start; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.stat-n { display: block; font-size: 1.7rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.stat-l { font-size: .82rem; color: var(--muted); }
.mini-events { list-style: none; padding: 0; margin: 0 0 12px; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--lime); border-radius: 14px; padding: 14px 18px; margin-bottom: 16px; }
.callout.exam { border-left-color: var(--ev-exam); }
.callout.small { font-size: .9rem; }

/* ---------- módulos ---------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.module-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: inherit; box-shadow: var(--shadow); min-height: 160px; transition: transform .12s, border-color .12s; }
a.module-card:hover { border-color: var(--olive); transform: translateY(-2px); }
a.module-card:first-of-type { }
.module-card .mnum { font-weight: 800; color: var(--ink); font-size: 1.5rem; letter-spacing: -0.02em; }
.module-card h2 { font-size: 1rem; margin: 0; }
.module-card .meta { font-size: .82rem; color: var(--muted); margin-top: auto; }
.bar { display: block; height: 6px; background: var(--ring-track); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ring); border-radius: 99px; }
.mod-chip { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--border); text-decoration: none; color: var(--text); margin: 0 6px 8px 0; font-weight: 600; background: var(--surface); }
.mod-chip.on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.mod-chip.locked { opacity: .5; }
.level-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.level { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.level strong { display: block; margin-top: 6px; color: var(--ink); }
.level p { font-size: .9rem; color: var(--muted); margin: 4px 0 0; }
.exam.card header { display: flex; justify-content: space-between; gap: 8px; }
.dist { list-style: none; padding: 0; columns: 2 280px; }
.dist li { display: grid; grid-template-columns: 74px 1fr 30px; gap: 6px; padding: 4px 0; break-inside: avoid; font-size: .9rem; }
.hist { padding-left: 18px; }
.outline { padding-left: 0; list-style: none; }
.outline li { padding: 3px 0; }
.outline-preview details { border-bottom: 1px solid var(--border); padding: 8px 0; }
details summary { cursor: pointer; font-weight: 600; }

/* ---------- sessão ---------- */
.quiz { max-width: 980px; }
.quiz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.quiz-head h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
.quiz-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.3rem; background: var(--dark-card); color: #fff; padding: 6px 16px; border-radius: 999px; }
.timer.low { background: var(--bad); }
.timer.muted { font-size: 1rem; font-weight: 700; background: var(--surface-2); color: var(--text); }
.progress-text { font-weight: 700; color: var(--muted); }
.progress { height: 8px; background: var(--ring-track); border-radius: 99px; overflow: hidden; margin: 10px 0 18px; }
.progress div { height: 100%; background: var(--lime); transition: width .2s; border-radius: 99px; }
.qcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(18px, 3vw, 30px); box-shadow: var(--shadow); }
.qcard-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag.flag { cursor: pointer; }
.tag.flag.on { background: var(--warn-bg); color: var(--warn); }
.qtext { font-size: clamp(1.1rem, 2.4vw, 1.3rem); font-weight: 700; margin-bottom: 18px; line-height: 1.4; }
.opts { display: grid; gap: 12px; }
.opt { display: flex; gap: 14px; align-items: center; text-align: left; width: 100%; padding: 14px 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text); font: inherit; cursor: pointer; min-height: 56px; transition: border-color .12s, background .12s; }
.opt:hover:not(:disabled) { border-color: var(--olive); }
.opt-letter { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); font-weight: 800; color: var(--ink); }
.opt.chosen { border-color: var(--primary); background: var(--lime-soft); }
.opt.chosen .opt-letter { background: var(--primary); color: var(--on-primary); }
.opt.correct { border-color: var(--ok); background: var(--ok-bg); }
.opt.correct .opt-letter { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .opt-letter { background: var(--bad); color: #fff; }
.opt:disabled { cursor: default; }
.fill-text { font-size: clamp(1.05rem, 2.3vw, 1.25rem); line-height: 2.5; color: var(--ink); }
.blank { display: inline-flex; flex-direction: column; vertical-align: middle; }
.blank-input { font: inherit; font-weight: 600; padding: 4px 10px; border: 0; border-bottom: 2.5px solid var(--olive); background: var(--lime-soft); color: var(--ink); border-radius: 8px 8px 0 0; max-width: 100%; }
.blank-input:focus { outline: none; border-color: var(--primary); }
.blank.ok .blank-input { border-color: var(--ok); background: var(--ok-bg); }
.blank.bad .blank-input { border-color: var(--bad); background: var(--bad-bg); text-decoration: line-through; }
.expected { font-size: .85rem; color: var(--ok); font-weight: 700; line-height: 1.2; }
.hint { font-size: .85rem; }
.feedback { margin-top: 18px; padding: 16px 18px; border-radius: 14px; border-left: 5px solid; }
.feedback.ok { background: var(--ok-bg); border-color: var(--ok); }
.feedback.bad { background: var(--bad-bg); border-color: var(--bad); }
.feedback .explain { margin-top: 8px; color: var(--text); }
.slide-link { display: inline-flex; align-items: center; gap: 6px; margin: 4px 8px 0 0; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--border); padding: 4px 12px; border-radius: 999px; text-decoration: none; font-size: .88rem; }
.slide-link:hover { border-color: var(--olive); }
.quiz-nav { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0; flex-wrap: wrap; }
.quiz-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin: 14px 0; }
.qgrid .cell { min-height: 42px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.qgrid .cell.answered { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.qgrid .cell.flagged { box-shadow: inset 0 -4px 0 var(--amber); }
.qgrid .cell.current { outline: 3px solid var(--lime); outline-offset: 1px; }
.modal { position: fixed; inset: 0; background: rgba(10, 20, 18, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal-box { background: var(--surface); border-radius: var(--radius); padding: 24px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- resultados / revisão / banco ---------- */
.score-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; margin-bottom: 8px; }
.score { flex: 1 1 240px; background: var(--dark-card); color: #fff; border-radius: var(--radius); padding: 22px 24px; }
.score.pass { background: var(--dark-card); box-shadow: inset 0 0 0 3px var(--lime); }
.score.fail { box-shadow: inset 0 0 0 3px var(--ev-exam); }
.score-pct { display: block; font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: var(--lime); }
.score.fail .score-pct { color: #ff9b90; }
.score-sub { color: #d6dcd8; }
.kv { flex: 1 1 280px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.kv div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.kv dt { font-size: .78rem; color: var(--muted); }
.kv dd { margin: 0; font-weight: 800; color: var(--ink); font-size: 1.1rem; }
.review-head { display: flex; justify-content: space-between; align-items: center; }
.review, .bank-list { padding: 0; list-style: none; }
.rv, .bank-item { background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; }
.rv.ok { border-left-color: var(--ok); }
.rv.bad { border-left-color: var(--bad); }
.rv-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.rv-n { font-weight: 800; margin-right: 4px; color: var(--ink); }
.rv-t { margin-left: auto; font-size: .8rem; color: var(--muted); }
.rv-q { font-weight: 700; color: var(--ink); }
.rv-a.ok { color: var(--ok); margin: 2px 0; font-weight: 600; }
.rv-a.bad { color: var(--bad); margin: 2px 0; font-weight: 600; }
.bank-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.bank-filters select, .bank-filters input[type=search] { width: auto; flex: 1 1 220px; margin: 0; }
.bank-opts li { padding: 3px 0; }
.bank-opts li.correct { color: var(--ok); font-weight: 700; }
.qstat { font-size: .78rem; color: var(--muted); }
.qstat.ok { color: var(--ok); } .qstat.bad { color: var(--bad); }
.qid { margin-left: auto; font-size: .7rem; color: var(--muted); }
.star { border: 0; background: none; font-size: 1.25rem; color: var(--surface-3); cursor: pointer; }
.star.on { color: var(--amber); }
.blank-show { background: var(--surface-2); color: transparent; border-radius: 6px; padding: 0 8px; cursor: pointer; border-bottom: 2px solid var(--olive); }
.blank-show.on { color: var(--ok); font-weight: 700; }
.weak { padding-left: 18px; }
.hbar { display: inline-block; width: 90px; height: 8px; background: var(--ring-track); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.hbar i { display: block; height: 100%; border-radius: 99px; }
.hbar.good i { background: var(--ev-theory); } .hbar.mid i { background: var(--amber); } .hbar.low i { background: var(--ev-exam); }

/* ---------- slides ---------- */
.slide-viewer { max-width: 1180px; }
.slide-head { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.slide-head h1 { font-size: 1.3rem; margin: 0; }
.slide-head .eyebrow { margin-bottom: 4px; }
.slide-fig { margin: 0; background: #000; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.slide-fig img { display: block; width: 100%; height: auto; }
.slide-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0 18px; }
.slide-nav input { width: 74px; padding: 9px; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; background: var(--surface); color: var(--text); text-align: center; }
.notes p { font-size: .96rem; }
.related li { margin-bottom: 6px; }

/* ---------- calendário ---------- */
.ev-theory { --ev: var(--ev-theory); } .ev-tp { --ev: var(--ev-tp); } .ev-practical { --ev: var(--ev-practical); } .ev-exam { --ev: var(--ev-exam); } .ev-other { --ev: var(--ev-other); }
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select { width: auto; margin: 0; }
.pill-toggle { display: inline-flex; gap: 8px; align-items: center; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--border); font-size: .86rem; font-weight: 600; cursor: pointer; }
.pill-toggle::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ev); }
.pill-toggle input { accent-color: var(--primary); }
.cal-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cal-nav h2 { margin: 0; min-width: 190px; text-align: center; }
.dow, .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.dow span { text-align: center; font-size: .76rem; color: var(--muted); font-weight: 700; padding-bottom: 4px; }
.day { min-height: 96px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); padding: 6px; text-align: left; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.day:hover { border-color: var(--olive); }
.day.pad { visibility: hidden; }
.day.today .dnum { background: var(--lime); color: var(--on-lime); border-radius: 8px; padding: 0 7px; }
.day.selected { outline: 2px solid var(--primary); outline-offset: -1px; }
.dnum { font-weight: 800; font-size: .88rem; align-self: flex-start; color: var(--ink); }
.chips { display: flex; flex-direction: column; gap: 2px; }
.chip { font-size: .68rem; padding: 2px 6px; border-radius: 6px; background: color-mix(in srgb, var(--ev) 18%, var(--surface)); color: var(--ink); border-left: 3px solid var(--ev); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.more { font-size: .68rem; color: var(--muted); }
.dots { display: none; gap: 3px; flex-wrap: wrap; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ev); }
@media (max-width: 700px) { .day { min-height: 54px; } .chips { display: none; } .dots { display: flex; } }
.day-panel { margin-top: 18px; }
.event { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--ev); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.event-time { display: flex; flex-direction: column; min-width: 56px; font-variant-numeric: tabular-nums; }
.event-time strong { color: var(--ink); }
.event-time span { color: var(--muted); font-size: .85rem; }
.event-body h3 { margin: 0 0 4px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.pill { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ev) 20%, var(--surface)); color: var(--ink); font-weight: 700; }
.event-loc { font-size: .88rem; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.event-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.list-day { margin-top: 20px; font-size: 1rem; color: var(--muted); }
.list-day::first-letter { text-transform: uppercase; }
.export-box { margin-top: 26px; }
.export-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.howto { margin-top: 14px; }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 140px); background: var(--dark-card); color: #fff; padding: 12px 20px; border-radius: 999px; transition: transform .25s; z-index: 60; max-width: calc(100% - 32px); font-weight: 600; }
#toast.show { transform: translate(-50%, 0); }
.noscript { text-align: center; padding: 20px; }

@media print { .topbar, .site-foot, .quiz-foot, .quiz-nav { display: none; } }

.tabs a { display: inline-flex; align-items: center; gap: 8px; }
.tabs a .ico { width: 18px; height: 18px; }

/* ---------- exame aprovado ---------- */
.celebrate { margin: 18px 0; padding: 20px 24px; border-radius: 20px; background: var(--lime); color: #17302e; }
.celebrate strong { display: block; font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; font-style: italic; letter-spacing: -0.02em; line-height: 1; }
.celebrate p { margin: 6px 0 0; font-weight: 600; }
.celebrate strong { padding-top: .75em; }
.celebrate-grade { font-size: 1.25em; font-weight: 800; }
.celebrate-word { position: relative; display: inline-block; }
.celebrate-hat { position: absolute; left: -.42em; top: -.86em; width: 2.1em; height: auto; transform: rotate(-14deg); filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); pointer-events: none; transform-origin: 30% 90%; animation: hat-drop .7s cubic-bezier(.3,1.6,.5,1) 1.15s both, hat-tip 2.6s ease-in-out 2.4s infinite; }
.celebrate-letters { display: inline-block; }
.celebrate .cl { display: inline-block; animation: cl-pop .5s cubic-bezier(.3,1.7,.5,1) calc(var(--i) * 55ms) both, cl-wave 2.6s ease-in-out calc(2.4s + var(--i) * 70ms) infinite; }
@keyframes cl-pop { from { opacity: 0; transform: translateY(.6em) scale(.3) rotate(-12deg); } to { opacity: 1; transform: none; } }
@keyframes cl-wave { 0%, 20%, 100% { transform: none; } 10% { transform: translateY(-.14em); } }
@keyframes hat-drop { from { opacity: 0; transform: translate(.4em, -1.6em) rotate(-70deg); } to { opacity: 1; transform: rotate(-14deg); } }
@keyframes hat-tip { 0%, 70%, 100% { transform: rotate(-14deg); } 80% { transform: translateY(-.28em) rotate(-24deg); } 90% { transform: translateY(-.05em) rotate(-10deg); } }
@media (prefers-reduced-motion: reduce) { .celebrate .cl, .celebrate-hat { animation-iteration-count: 1, 0; } }

/* ---------- conta ---------- */
.account .acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; max-width: 980px; }
.account .card { max-width: 980px; }
.acct-form .seg { margin-bottom: 6px; }
.form input[type=email], .form input[type=password] { display: block; width: 100%; font: inherit; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--bg); color: var(--text); margin-top: 6px; }
.form input[type=email]:focus, .form input[type=password]:focus { border-color: var(--olive); outline: none; }
.form-msg { min-height: 1.2em; color: var(--bad); font-weight: 600; margin: 4px 0 10px; }
.form-msg[data-ok] { color: var(--ok); }
.acct-why ul { padding-left: 1.2em; margin: 0 0 12px; }
.acct-why li { margin: 4px 0; }
.acct-why .note { background: var(--lime-soft); color: var(--on-lime); padding: 10px 14px; border-radius: 12px; }
.account h2 .ico { width: 24px; height: 24px; }
.sync-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.sync-line:has(#syncState[data-state="ok"]) .sync-dot { background: var(--ok); }
.sync-line:has(#syncState[data-state="syncing"]) .sync-dot { background: var(--amber); }
.sync-line:has(#syncState[data-state="error"]) .sync-dot { background: var(--bad); }
.small { font-size: .88rem; }
.account code { overflow-wrap: anywhere; }
@media (max-width: 560px) { .acct-label { display: none; } .acct-btn { padding: 0 9px; } .topbar-inner { gap: 8px; } .brand { gap: 8px; } .brand-plane { width: 42px; } }

/* aviso sobre as perguntas geradas por IA (só sem sessão iniciada) */
.ai-notice { display: flex; gap: 10px; align-items: flex-start; max-width: 980px; margin: 18px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: .92rem; line-height: 1.45; }
.ai-notice .ico { width: 20px; height: 20px; margin-top: 1px; color: var(--ink); }
.ai-notice a { font-weight: 600; overflow-wrap: anywhere; }
.hero .ai-notice { max-width: 560px; }

/* conta obrigatória: sem sessão, esconder a navegação (só fica a página de login) */
body.auth-locked .nav, body.auth-locked .menu-btn, body.auth-locked .acct-btn { display: none !important; }
body.auth-locked .theme-toggle { margin-left: auto; }
