/* Qlareza · base e componentes compartilhados entre a vitrine e o sistema.
   Só usa tokens de tokens.css: nenhuma cor, fonte ou raio escrito à mão aqui. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
/* A página ocupa ao menos a tela toda: com pouco conteúdo, o rodapé fica no fim da tela;
   com muito, vem depois do conteúdo, sem cobrir nada. */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--weight-regular) var(--text-md)/var(--leading-body) var(--font);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  margin: 0;
  font-weight: var(--weight-heavy);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
h3 { font-size: var(--text-lg); line-height: 1.2; letter-spacing: -0.015em; margin-bottom: var(--space-2); }
p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Página ---------- */
.band { padding: clamp(20px, 3vw, 40px) var(--gutter); }
.wrap { max-width: var(--page); margin: 0 auto; }
/* Duas colunas: os quadros lado a lado começam e terminam na mesma linha. */
.grid2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: var(--space-4); align-items: stretch; }
.grid2 > * { min-width: 0; margin: 0; }
.row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.stack { display: grid; gap: var(--space-3); }
/* Corpo da tela: um só ritmo entre os blocos de todas as telas (quadros, filtros, listas, páginas). */
.page-body { display: grid; gap: var(--page-gap); }
/* Quem fica no corpo não traz margem própria: o espaço é só o do corpo. */
.view .page-body > * { margin-block: 0; }
/* As páginas ficam coladas à lista a que pertencem, no mesmo espaço de dentro de um bloco. */
.view .page-body > .pager { margin-top: calc(var(--space-3) - var(--page-gap)); }
@media (max-width: 820px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
footer {
  margin-top: auto;
  padding: var(--space-6) var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: var(--text-sm);
}

/* ---------- Rodapé com a marca-mãe ---------- */
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.made { font-size: var(--text-md); text-decoration: none; }
.made b { color: var(--text); font-weight: var(--weight-heavy); }
.made:hover b { text-decoration: underline var(--accent) 3px; text-underline-offset: 5px; }

/* ---------- Texto ---------- */
.mut { color: var(--muted); }
.small { font-size: var(--text-sm); }
.soft { color: var(--muted); }
.spaced { margin-top: var(--space-4); }
.section-gap { margin-top: var(--page-gap); }
.eyebrow { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); color: var(--accent-text); font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: .12em; text-transform: uppercase; }
.hl { display: block; color: var(--accent-text); }
.eyebrow::before { content: ""; width: 24px; border-top: 2px solid currentColor; }
/* Link de ação: tinta com sublinhado de marca-texto */
.go, .link {
  color: var(--text);
  font-weight: var(--weight-semibold);
  text-decoration: underline var(--accent) 3px;
  text-underline-offset: 5px;
}
.go:hover, .link:hover { text-decoration-color: var(--text); }

/* ---------- Marca ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--logo);
  font-size: var(--text-xl);
  font-weight: var(--weight-heavy);
  letter-spacing: var(--tracking-tight);
  text-decoration: none;
}
.logo-mark { width: 1.45em; height: 1.45em; flex: none; overflow: visible; }
.logo-ring { fill: none; stroke: var(--logo); stroke-width: 13; }
.logo-core { fill: var(--accent); }
.logo-lines { fill: var(--on-accent); }
.logo-tail { fill: var(--logo); }

/* ---------- Botões ---------- */
button, input, select { font: inherit; color: var(--text); }
button, a.btn, label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control);
  padding: 0 var(--space-4);
  border: var(--border) solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
button:hover, a.btn:hover, label.btn:hover { border-color: var(--text); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.pri, a.btn.pri { background: var(--text); border-color: var(--text); color: var(--bg); }
button.pri:hover, a.btn.pri:hover { background: var(--muted); border-color: var(--muted); }
/* Cresce com a letra (Perfil › Preferências): altura e respiro acompanham o --letra. */
.mini { min-height: calc(var(--control-sm) * var(--letra)); padding: 0 calc(var(--space-3) * var(--letra)); font-size: var(--text-xs); }
.link { min-height: 32px; padding: 0; border: 0; background: none; font-size: var(--text-sm); justify-self: start; }
:is(button, a, summary, input[type=checkbox], input[type=radio]):focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 2px;
}

/* ---------- Campos ---------- */
input, select {
  width: 100%;
  min-height: var(--control);
  padding: var(--space-2) var(--space-3);
  border: var(--border) solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: var(--text-md);
}
input::placeholder { color: var(--faint); }
/* Caixa de escolha: o mesmo campo, com a seta desenhada pelos tokens (não a do sistema operacional). */
select {
  appearance: none;
  padding-right: calc(var(--space-3) * 2 + 10px);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    right calc(var(--space-3) + 5px) center,
    right var(--space-3) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
select:hover { border-color: var(--text); background-color: var(--bg-2); }
select:disabled { opacity: .5; cursor: not-allowed; }
option { background: var(--card); color: var(--text); font-weight: var(--weight-regular); }
input:focus, select:focus { outline: 3px solid var(--text); outline-offset: 1px; border-color: var(--text); }
input[type=checkbox], input[type=radio] {
  width: 22px;
  height: 22px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: none;
  accent-color: var(--text);
}
label { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
/* Uma linha de ajuda dentro do rótulo, entre o nome do campo e o campo. */
.field-hint { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-regular); }

/* ---------- Dica «?»: um balão curto com o nome do termo e o que ele é ---------- */
.dica { position: relative; display: inline-flex; vertical-align: middle; }
.dica-btn { display: inline-grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--faint); cursor: help; }
.dica-btn .ico { width: 18px; height: 18px; }
.dica-btn:hover, .dica-btn:focus-visible { background: var(--bg-2); color: var(--text); }
.dica-text {
  position: absolute; top: calc(100% + var(--space-2)); left: calc(-1 * var(--space-2)); z-index: 20;
  display: none; gap: var(--space-1); width: max-content; max-width: min(300px, 75vw);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-md);
  background: var(--card); box-shadow: var(--shadow-float);
  color: var(--muted); font-size: var(--text-sm); font-weight: var(--weight-regular);
  letter-spacing: 0; line-height: var(--leading-body); text-align: left; text-transform: none; white-space: normal;
  pointer-events: none;
}
.dica-text b { color: var(--text); font-weight: var(--weight-bold); }
.dica:hover .dica-text, .dica:focus-within .dica-text { display: grid; }

/* ---------- Superfícies ---------- */
.pane { padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.tip { padding: var(--space-5); border-radius: var(--radius-lg); background: var(--bg-2); }
.tip ul { margin: var(--space-3) 0 0; padding-left: 18px; color: var(--muted); }
.tip li { margin: var(--space-1) 0; }
.empty {
  padding: var(--space-5);
  border: var(--border) dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--faint);
  text-align: center;
}

/* ---------- Chips e etiquetas ---------- */
.chip {
  min-height: 38px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.chip[aria-pressed=true] { background: var(--text); border-color: var(--text); color: var(--bg); }
.tag {
  display: inline-block;
  margin-right: var(--space-1);
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}
.tag.late { background: var(--alert); color: var(--bg); }
/* Marca-texto: amarelo por baixo, tinta por cima */
.mark { padding: 0 .18em; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- Filtros: o mesmo quadro do «Convidar», em todas as telas ---------- */
.filters { display: grid; gap: var(--space-3); padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); }
.filters-head { display: grid; gap: var(--space-1); }
.filters-head > * { margin: 0; }
.filters-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2); }
.filters :is(input, select, button) { width: auto; block-size: var(--control); }
.filters .filter-grow { flex: 1 1 240px; }
.filter-field { display: grid; gap: var(--space-1); color: var(--muted); font-size: var(--text-xs); font-weight: var(--weight-semibold); }

/* ---------- Botões de profissão (vitrine) ---------- */
.roles { display: flex; flex-wrap: wrap; gap: var(--space-2); }
@media (max-width: 480px) { .ex { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Aviso flutuante ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  max-width: calc(100% - 32px);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--text);
  color: var(--bg);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-float);
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
#toast.on { opacity: 1; }

/* ---------- Ciclo (vitrine e login) ---------- */
.loop { width: 100%; max-width: 480px; aspect-ratio: 1; font-family: var(--font); }
.loop-center { fill: var(--bg-2); stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 6 6; }
.loop-arrow { fill: none; stroke: var(--text); stroke-width: 3; }
.loop-head { fill: var(--text); }
.loop-node { fill: var(--card); stroke: var(--text); stroke-width: 3; }
.loop-node-focus { fill: var(--accent); stroke: var(--text); stroke-width: 3; }
.loop-title { fill: var(--text); font-size: 18px; font-weight: 800; text-anchor: middle; }
.loop-title-focus { fill: var(--on-accent); }
.loop-note { fill: var(--muted); font-size: var(--text-xs); font-weight: 500; text-anchor: middle; }
.loop-note-focus { fill: var(--on-accent); }
.loop-token { fill: var(--accent); stroke: var(--text); stroke-width: 3; }
.ico { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.exc .ico { color: var(--accent-text); }

/* Bolinha do usuário: a inicial na cor que a pessoa escolheu no perfil. */
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: #ffd400; color: #111; font-size: var(--text-sm); font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.avatar.big { width: 56px; height: 56px; font-size: 24px; }
.avatar.xl { width: 112px; height: 112px; font-size: 40px; }

/* Foto no lugar das iniciais, e o botão de enviar. */
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.photo-pick { position: relative; cursor: pointer; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Aviso de consentimento (site e plataforma) ---------- */
/* Uma faixa curta no pé da tela: uma frase, o link da política e «Somente essenciais» e «Aceitar todos» do mesmo tamanho. */
.consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-3) var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-top: var(--border) solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  box-shadow: var(--shadow-float);
}
.consent p { margin: 0; color: var(--muted); }
.consent a { color: var(--text); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
@media (max-width: 560px) { .consent-actions { width: 100%; } }
