/* ═══════════════════════════════════════════════════════════
   Portal da Jornada — NeuroAlquimIA
   Identidade: paleta da logo (preto · violeta · ouro) e
   Cormorant Garamond + Montserrat, a mesma da Área de Membros.
   Para trocar a marca, altere só os tokens abaixo.
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg: #0A090E;
  --bg2: #0E0C14;
  --surface: #161220;
  --surface2: #1E1830;
  --line: rgba(232, 163, 61, .18);
  --line-v: rgba(154, 133, 196, .20);
  --violet: #9A85C4;
  --violet-l: #BEABE0;
  --violet-d: #6E5A96;
  --gold: #E8A33D;
  --gold-l: #F4BE5C;
  --gold-hot: #FF9E2E;
  --ivory: #F3ECDD;
  --muted: #A99FB8;
  --muted-d: #736A82;
  --danger: #E5747A;
  --ok: #8FCFA8;

  --grad-gold: linear-gradient(135deg, var(--gold-hot), var(--gold-l));
  --grad-flame: linear-gradient(135deg, var(--violet-d) 0%, var(--violet) 45%, var(--gold) 100%);
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Montserrat', system-ui, -apple-system, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ivory); font: 400 15px/1.6 var(--font-body);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(154, 133, 196, .13), transparent 60%),
    radial-gradient(700px 420px at -10% 10%, rgba(232, 163, 61, .07), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: var(--font-head); font-weight: 500; line-height: 1.12; margin: 0; letter-spacing: .005em; text-wrap: balance; }
h1 { font-size: clamp(30px, 5vw, 44px); }
h2 { font-size: clamp(24px, 3.4vw, 32px); }
h3 { font-size: 22px; }
h1 em, h2 em, h3 em { color: var(--gold-l); font-style: italic; }
p { margin: 0; }
a { color: var(--gold-l); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-l); outline-offset: 2px; border-radius: 6px; }
.ico { flex: none; }
.num { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--violet-l); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Marca e cabeçalho ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { object-fit: contain; filter: drop-shadow(0 0 12px rgba(255, 158, 46, .35)); }
.brand b { display: block; font: 600 20px/1 var(--font-head); letter-spacing: .02em; }
.brand b em { color: var(--gold-l); font-style: normal; }
.brand span { display: block; font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.top { position: sticky; top: 0; z-index: 20; background: rgba(10, 9, 14, .86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; }
.hello { text-align: right; min-width: 0; }
.hello strong { display: block; font: 500 22px/1.1 var(--font-head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hello span { font-size: 12px; color: var(--muted); }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 0 20px; max-width: 1080px; margin: 0 auto; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 0; background: none; color: var(--muted); font-size: 13px; font-weight: 500;
  white-space: nowrap; cursor: pointer; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ivory); }
.tab.on { color: var(--gold-l); border-bottom-color: var(--gold); }

main { padding: 28px 0 40px; }
.page-head { margin-bottom: 22px; display: grid; gap: 6px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line-v); border-radius: var(--radius); padding: 22px; }
.card.gold { border-color: var(--line); background: linear-gradient(160deg, rgba(232, 163, 61, .09), transparent 55%), var(--surface); }
.card.flat { background: var(--bg2); }
.grid4 { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.grid3 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid2 { display: grid; gap: 14px; grid-template-columns: 1.4fr 1fr; }
.stat { display: grid; gap: 8px; align-content: start; }
.stat .k { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .v { font: 500 30px/1.05 var(--font-head); }
.stat .v.sm { font-size: 23px; }
.stat .s { font-size: 12px; color: var(--muted); }

.bar { height: 7px; border-radius: 99px; background: rgba(154, 133, 196, .16); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--grad-gold); transition: width .5s ease; }
.bar i.violet { background: linear-gradient(90deg, var(--violet-d), var(--violet-l)); }
.bar i.danger { background: var(--danger); }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 99px;
  border: 1px solid var(--line-v); color: var(--muted); white-space: nowrap; }
.pill.ok { color: var(--ok); border-color: rgba(143, 207, 168, .35); background: rgba(143, 207, 168, .08); }
.pill.warn { color: var(--gold-l); border-color: rgba(244, 190, 92, .45); background: rgba(232, 163, 61, .12); }
.pill.danger { color: var(--danger); border-color: rgba(229, 116, 122, .45); background: rgba(229, 116, 122, .1); }
.pill.violet { color: var(--violet-l); background: rgba(154, 133, 196, .12); }
.pill.gold { color: #1b1206; background: var(--grad-gold); border-color: transparent; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-v); background: var(--surface2); color: var(--ivory); font-size: 13.5px; font-weight: 600; text-decoration: none; transition: transform .12s, border-color .15s, background .15s; }
.btn:hover { border-color: var(--violet); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad-gold); color: #1b1206; border-color: transparent; box-shadow: 0 6px 22px rgba(255, 158, 46, .22); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.icon { padding: 0; width: 38px; min-height: 38px; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--gold-l); cursor: pointer; font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Formulários ---------- */
.field { display: grid; gap: 7px; }
.field > label, .qlabel { font-size: 14px; font-weight: 500; color: var(--ivory); }
.help { font-size: 12.5px; color: var(--muted); }
.input, textarea.input, select.input { width: 100%; background: var(--bg2); border: 1px solid var(--line-v); border-radius: var(--radius-sm); padding: 11px 13px; color: var(--ivory); min-height: 44px; }
textarea.input { resize: none; overflow: hidden; min-height: 92px; line-height: 1.55; }
.input::placeholder { color: var(--muted-d); }
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 163, 61, .14); }
.input[readonly], .input:disabled { opacity: .75; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { min-height: 40px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line-v); background: var(--bg2); cursor: pointer; font-size: 13.5px; font-weight: 500; }
.choice:hover:not([disabled]) { border-color: var(--violet); }
.choice.on { background: rgba(232, 163, 61, .16); border-color: var(--gold); color: var(--gold-l); }
.choice[disabled] { cursor: default; opacity: .8; }
.formgrid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.formgrid .full { grid-column: 1 / -1; }

/* ---------- Jornada ---------- */
.stage { display: grid; gap: 12px; text-align: left; cursor: pointer; position: relative; overflow: hidden; width: 100%; color: inherit; }
.stage:hover:not(.locked) { border-color: var(--violet); }
.stage.current { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(232, 163, 61, .25), 0 14px 40px rgba(232, 163, 61, .08); }
.stage.locked { cursor: default; opacity: .55; }
.stage .n { font: 500 40px/1 var(--font-head); color: var(--violet-d); }
.stage.current .n { color: var(--gold-l); }
.stage.done .n { color: var(--violet-l); }
.stage h3 { font-size: 21px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

.doclist { display: grid; gap: 10px; }
.doc { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg2); border: 1px solid var(--line-v); border-radius: 14px; }
.doc .i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface2); color: var(--violet-l); flex: none; }
.doc.done .i { background: rgba(143, 207, 168, .14); color: var(--ok); }
.doc b { font-weight: 600; font-size: 14.5px; display: block; }

.md { display: grid; gap: 10px; color: #ddd4e6; }
.md h4 { font: 500 21px/1.2 var(--font-head); margin: 6px 0 0; color: var(--ivory); }
.md ul, .md ol { margin: 0; padding-left: 20px; display: grid; gap: 5px; }
.md strong { color: var(--gold-l); font-weight: 600; }

.block { display: grid; gap: 20px; }
.block > header { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line-v); }
.savebar { position: sticky; bottom: 0; z-index: 10; margin-top: 20px; background: rgba(14, 12, 20, .94); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Linha do tempo ---------- */
.timeline { display: grid; gap: 0; padding-left: 6px; }
.tl { display: grid; grid-template-columns: 18px 1fr; gap: 14px; padding-bottom: 22px; position: relative; }
.tl::before { content: ''; position: absolute; left: 8px; top: 16px; bottom: 0; width: 1px; background: var(--line-v); }
.tl:last-child::before { display: none; }
.tl .d { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--violet); background: var(--bg); margin-top: 3px; }
.tl.now .d { border-color: var(--gold); background: var(--gold); box-shadow: 0 0 0 5px rgba(232, 163, 61, .18); }

/* ---------- Aquecimento ---------- */
.msg { display: grid; gap: 10px; }
.msg.past { opacity: .45; }
.msg.today { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(232, 163, 61, .25); }
.msg pre { margin: 0; white-space: pre-wrap; font: inherit; color: #e6ddef; }

/* ---------- Diversos ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty .ico { color: var(--violet); }
.foot { border-top: 1px solid var(--line-v); padding: 22px 0 34px; color: var(--muted); font-size: 12.5px; text-align: center; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.center .card { max-width: 430px; width: 100%; display: grid; gap: 16px; text-align: center; justify-items: center; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-v); border-top-color: var(--gold); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.toast { background: var(--surface2); border: 1px solid var(--line-v); border-left: 3px solid var(--ok); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); animation: rise .25s ease; }
.toast.warn { border-left-color: var(--gold); }
.toast.err { border-left-color: var(--danger); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Painel da equipe ---------- */
.wide { max-width: 1500px; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 262px; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: start; }
.col { background: var(--bg2); border: 1px solid var(--line-v); border-radius: var(--radius); padding: 12px; display: grid; gap: 10px; min-height: 130px; align-content: start; }
.col > header { display: grid; gap: 4px; padding: 2px 4px 8px; border-bottom: 1px solid var(--line-v); }
.col > header b { font: 500 18px/1.15 var(--font-head); }
.kcard { background: var(--surface); border: 1px solid var(--line-v); border-radius: 14px; padding: 12px; display: grid; gap: 8px; cursor: pointer; text-align: left; color: inherit; width: 100%; }
.kcard:hover { border-color: var(--gold); }
.kcard b { font-size: 14px; font-weight: 600; }
.drawer-bg { position: fixed; inset: 0; background: rgba(5, 4, 8, .7); z-index: 50; display: flex; justify-content: flex-end; }
.drawer { width: min(620px, 100%); height: 100%; overflow-y: auto; background: var(--bg2); border-left: 1px solid var(--line); padding: 24px; display: grid; gap: 18px; align-content: start; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; word-break: break-all; color: var(--violet-l); }
details.card > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card[open] > summary { margin-bottom: 16px; }

@media (max-width: 860px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid2, .formgrid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .brand span { display: none; }
  .savebar .btn { flex: 1; }
}
@media (max-width: 460px) {
  .grid4 { grid-template-columns: 1fr; }
  .doc { flex-wrap: wrap; }
  .tab span { display: none; }
  .tab.on span { display: inline; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
