:root {
  --bg: #f7f4fa;
  --surface: #ffffff;
  --ink: #231b2e;
  --muted: #655c70;
  --line: #e7e0ee;
  --brand: #5b2a86;
  --brand-ink: #ffffff;
  --brand-soft: #efe5f8;
  --accent: #b8741a;
  --ok-bg: #e5f3ea; --ok-ink: #1e5b35;
  --warn-bg: #fdf1dc; --warn-ink: #7a4a07;
  --err-bg: #fbe7e5; --err-ink: #8a231b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(35,27,46,.06), 0 4px 16px rgba(91,42,134,.06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.7rem; line-height: 1.2; margin: .2em 0 .4em; }
h2 { font-size: 1.15rem; margin: 1.4em 0 .6em; }
.card h2:first-child { margin-top: 0; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 46em; }
.hint { font-size: .85rem; color: var(--muted); margin: .3em 0 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--accent); font-weight: 700; margin: 0; }

/* Barra de topo */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 12px; height: 58px; }
.brand { font-weight: 800; font-size: 1.2rem; color: var(--brand); text-decoration: none; letter-spacing: -.01em; }
.topsearch { flex: 1; display: flex; justify-content: flex-end; }
.topsearch input { width: 100%; max-width: 280px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); font: inherit; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { display: inline-flex; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; }
.usermenu-panel { position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; min-width: 210px; }
.usermenu-panel a, .usermenu-panel .linklike { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.usermenu-panel a:hover, .usermenu-panel .linklike:hover { background: var(--bg); }
.usermenu-name { margin: 4px 10px 6px; font-weight: 700; }
.mainnav { border-top: 1px solid var(--line); }
.mainnav-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mainnav-inner::-webkit-scrollbar { display: none; }
.mainnav a { white-space: nowrap; padding: 11px 10px; text-decoration: none; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 600; font-size: .95rem; }
.mainnav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.mainnav .nav-admin { margin-left: auto; color: var(--accent); }

.main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.footer { color: var(--muted); font-size: .85rem; padding: 20px 0 32px; text-align: center; }

/* Mensagens */
.notice { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; }
.notice-ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice-warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice-err { background: var(--err-bg); color: var(--err-ink); }

/* Cartões e formulários */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.soon { color: var(--muted); border-style: dashed; box-shadow: none; }
.soon p { margin: 0; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.grid2 .card { margin-bottom: 0; }
.grid2 + .card, .grid2 + section { margin-top: 16px; }
.form { display: flex; flex-direction: column; gap: 6px; }
.form label { font-weight: 600; font-size: .92rem; margin-top: 8px; }
.form input, .form select, .form textarea, .filters input, .filters select, .searchbig input {
  font: inherit; padding: 10px 12px; border: 1px solid #d4cadf; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.form input:disabled, .form input[readonly] { background: var(--bg); color: var(--muted); }
.form input:focus, .form select:focus, .form textarea:focus, .filters input:focus, .searchbig input:focus, .topsearch input:focus { outline: 3px solid var(--brand-soft); border-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; }
.form-grid label { display: block; margin-bottom: 4px; }
.form-grid .span2 { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; margin-top: 12px; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.check input { width: auto; }
.summary { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-size: .92rem; }
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.form > .btn { margin-top: 14px; }
.btn-secondary { background: var(--brand-soft); color: var(--brand); }
.btn-danger { background: var(--err-bg); color: var(--err-ink); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-decoration: underline; }

/* Entrada */
.auth { max-width: 440px; margin: 4vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; box-shadow: var(--shadow); }
.auth .lead { font-size: 1rem; }
.auth-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 18px; align-items: center; }

/* O meu caminho */
.hero { margin-bottom: 18px; }
.stages { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.stages li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stages p { margin: 2px 0 0; color: var(--muted); }
.stage-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 800; }

/* Pesquisa */
.searchbig { display: flex; gap: 8px; margin-bottom: 16px; }
.results { list-style: none; padding: 0; margin: 0; }
.results li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
.results p { margin: 4px 0 0; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); vertical-align: middle; }
.tag-active { background: var(--ok-bg); color: var(--ok-ink); }
.tag-suspended { background: var(--warn-bg); color: var(--warn-ink); }
.tag-cancelled { background: var(--err-bg); color: var(--err-ink); }

/* Painel */
.crumbs { margin: 0; font-size: .9rem; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--muted); display: flex; flex-direction: column; }
.stat-n { font-size: 1.8rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; }
.tile span { color: var(--muted); font-size: .92rem; }
.tile:hover, .stat:hover { border-color: var(--brand); }
.filters { display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: 8px; margin-bottom: 10px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf7fd; }
.table tr:last-child td { border-bottom: 0; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* Conteúdos */
.prose { max-width: 46em; }
.prose h2 { font-size: 1.25rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.prose p, .prose li { line-height: 1.65; }
.prose blockquote { margin: 1em 0; padding: 12px 16px; background: var(--brand-soft); border-radius: 10px; }
.prose blockquote p { margin: .3em 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: .93rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: #faf7fd; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 1.6em 0; }
.prose img { max-width: 100%; border-radius: 10px; }
.prose code { background: var(--bg); padding: 1px 5px; border-radius: 5px; }
.video { position: relative; width: 100%; max-width: 46em; aspect-ratio: 16 / 9; margin: 1em 0; border-radius: 12px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article h1 { margin-bottom: .3em; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); margin: 0 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .88rem; }
.chip-on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.filters-tags { margin-top: 20px; }
.items { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.item a { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--ink); }
.item a:hover { border-color: var(--brand); }
.item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-body .tag { align-self: flex-start; margin-top: 4px; }
.item-date { flex: none; width: 52px; text-align: center; background: var(--brand-soft); color: var(--brand); border-radius: 10px; padding: 6px 0; font-size: .78rem; text-transform: uppercase; line-height: 1.2; }
.item-date b { display: block; font-size: 1.3rem; }
.ev-presencial { background: #fde4e1; color: #a1261b; }
.ev-formacao { background: #e1ecfb; color: #1d4f91; }
.ev-online { background: var(--brand-soft); color: var(--brand); }
.ev-apresentacao { background: #e2f3e8; color: #1e6b3a; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 4px 0 8px; }
.lg { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); }
.lg::before { content: ""; width: 12px; height: 12px; border-radius: 4px; }
.lg-presencial::before { background: #e8786d; }
.lg-formacao::before { background: #6b9be0; }
.lg-online::before { background: #9c6bc9; }
.lg-apresentacao::before { background: #6cc28c; }
.item-icon { flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; background: var(--bg); border-radius: 10px; }
.item-locked a { background: #fbfafc; }
.item-locked strong { color: var(--muted); }
.locked { border-style: dashed; }
.locked-title { font-weight: 700; margin: 0 0 4px; }

.actions-top { margin: 0 0 18px; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .78rem; line-height: 20px; text-align: center; }
.inline-form { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.inline-form input { flex: 1; min-width: 200px; width: auto; }
.tag-act-create { background: var(--ok-bg); color: var(--ok-ink); }
.tag-act-review_duplicate, .tag-act-invalid { background: var(--warn-bg); color: var(--warn-ink); }
.tag-act-unchanged { background: var(--bg); color: var(--muted); }
textarea { font: inherit; }

/* O meu caminho */
.nextstep { display: flex; flex-direction: column; gap: 4px; background: var(--brand); color: var(--brand-ink); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; margin-bottom: 18px; box-shadow: var(--shadow); }
.nextstep .eyebrow { color: #e9d9f7; }
.nextstep strong { font-size: 1.15rem; }
.nextstep .muted { color: #efe5f8; }
.nextstep .tag { align-self: flex-start; background: #fff; }
.activation .act-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.activation strong { display: block; font-size: 1.2rem; }
.days { color: var(--muted); font-size: .92rem; }
.bar { height: 12px; background: var(--brand-soft); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #8a4fc0); border-radius: 999px; }
.focus { margin: 4px 0 0; font-size: .93rem; }
.stages-list { display: grid; gap: 12px; margin-bottom: 18px; }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stage h2 { margin: 0 0 8px; font-size: 1.05rem; display: flex; gap: 8px; align-items: baseline; }
.stage-locked { background: #fbfafc; }
.stage-locked h2 { color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.steps li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.st-icon { width: 22px; text-align: center; font-weight: 700; color: var(--muted); }
.st-done .st-icon { color: var(--ok-ink); }
.st-done a, .st-done span:not(.st-icon) { color: var(--muted); }
.st-wait .st-icon { color: var(--warn-ink); }
.st-open a { font-weight: 700; }
.st-locked, .st-locked a { color: var(--muted); }
.st-form { margin-left: auto; display: inline-flex; gap: 6px; }
.btn-small { padding: 6px 12px; font-size: .88rem; }
.step-action { margin-top: 18px; }
.step-todo { background: #e9f6ee; border: 2px solid #7cc79a; }
.step-cta-text { margin: 0 0 10px; font-weight: 600; color: #1e5b35; }
.btn-done { background: #23874a; color: #fff; font-size: 1.05rem; padding: 13px 22px; }
.btn-outline { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.back { margin-top: 24px; }
.back-top { margin: 0 0 10px; display: flex; gap: 12px; align-items: center; }
.counter { font-size: 1.1rem; margin: 0; }
.counter b { font-size: 1.8rem; }
.team-card .team-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.team-head .muted { display: block; }
.waiting { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.waiting span { flex: 1; min-width: 180px; }
.answers h2 { margin-top: 0; }
.tag-prov { background: var(--warn-bg); color: var(--warn-ink); }
.tag-new { background: var(--accent); color: #fff; text-decoration: none; }
.team-card a.tag { text-decoration: none; }
.path-intro { margin-top: 24px; }

/* "i" de informação */
.info { display: inline; font-size: 1rem; font-weight: 400; text-transform: none; letter-spacing: 0; }
.info summary { display: inline-flex; list-style: none; cursor: pointer; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--brand); color: var(--brand); font: 700 .78rem/1 Georgia, serif; font-style: italic;
  align-items: center; justify-content: center; vertical-align: middle; }
.info summary::-webkit-details-marker { display: none; }
.info[open] summary { background: var(--brand); color: var(--brand-ink); }
.info-pop { display: block; margin: 8px 0 4px; padding: 10px 12px; background: var(--brand-soft); color: var(--ink);
  border-radius: 10px; font-size: .9rem; line-height: 1.45; max-width: 36em; text-align: left; }
th .info-pop { font-size: .85rem; white-space: normal; }

@media (max-width: 720px) {
  h1 { font-size: 1.45rem; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input[type=search] { grid-column: 1 / -1; }
  .topsearch input { max-width: none; }
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  .table th:nth-child(3), .table td:nth-child(3), .table th:nth-child(6), .table td:nth-child(6) { display: none; }
}

/* Guião de quem acompanha, caixa dentro do texto e avisos da equipa */
.guide { border-left: 4px solid var(--accent); }
.member-view summary { cursor: pointer; font-weight: 700; }
.inline-check { display: inline; margin: 0; }
.check-box { display: inline-block; font: inherit; font-weight: 700; color: var(--brand); background: var(--brand-soft);
  border: 2px solid var(--brand); border-radius: 8px; padding: 4px 10px; margin: 4px 0; cursor: pointer; }
span.check-box { cursor: default; }
.check-box.checked { background: #e6f4ea; border-color: #2e7d32; color: #1b5e20; }
.notice-alert { background: var(--brand-soft); border-left: 4px solid var(--brand); }
.badge { display: inline-block; min-width: 1.3em; padding: 0 .4em; border-radius: 999px; background: #c62828; color: #fff;
  font-size: .75rem; font-weight: 700; line-height: 1.4; text-align: center; }
.slides-btn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0 16px; }
.slides-btn button[disabled] { opacity: .5; cursor: not-allowed; }

/* Ativação: os 10 dias */
.days-title { font-size: 1rem; margin: 1.2em 0 .4em; }
.days-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35em; }
.days-list li { display: flex; flex-wrap: wrap; gap: .3em .7em; align-items: baseline; padding: .45em .7em; border-radius: 10px; background: var(--brand-soft); }
.days-list li.day-locked { opacity: .65; }
.days-list li.day-today { outline: 2px solid var(--brand); }
.focus-split { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6em; }
.focus-split div { background: var(--brand-soft); border-radius: 10px; padding: .7em; text-align: center; }
.focus-split b { display: block; font-size: 1.4rem; color: var(--brand); }
.focus-split span { font-size: .85rem; color: var(--muted); }
.day-nav { display: flex; justify-content: space-between; gap: .5em; margin-top: 1.2em; }
.days-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(2.6em, 1fr)); gap: .35em; }
.days-grid li { text-align: center; border-radius: 8px; background: var(--brand-soft); }
.days-grid li a, .days-grid li span { display: block; padding: .45em 0; text-decoration: none; }
.days-grid li.day-locked { opacity: .55; }
.days-grid li.day-today { outline: 2px solid var(--brand); font-weight: 700; }

/* O teu plano · 180 dias */
.plan180 h2 { font-size: 1.1rem; margin-top: 0; }
.plan-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4em; }
.plan-strip li { display: flex; flex-direction: column; gap: .15em; padding: .6em; border-radius: 10px; background: var(--brand-soft); min-width: 0; }
.plan-strip li.plan-here { outline: 2px solid var(--brand); background: #fff; }
.plan-icon { font-size: 1.3rem; }
.plan-more summary { cursor: pointer; margin-top: .6em; color: var(--brand); font-weight: 600; }
.plan-detail { padding-left: 1.2em; display: grid; gap: .6em; }
.plan-detail li { display: grid; gap: .1em; }
.plan-detail li.plan-here strong { color: var(--brand); }
@media (max-width: 720px) {
  .plan-strip { grid-template-columns: 1fr; }
  .plan-strip li { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: .2em .6em; }
}
