/* QI Roxo — design system: base e componentes comuns. Depende de tokens.css.
   Convenções: classes em português, sem prefixo; modificadores com hífen (.btn-primario, .btn-grande).
   Cada tela tem o seu CSS; o que se repete em mais de uma tela mora aqui. */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--texto); font-family: var(--fonte);
  font-size: 15px; -webkit-font-smoothing: antialiased;
  overscroll-behavior: none; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
a { color: var(--roxo); text-decoration: none; }
a:hover { color: var(--roxo-texto); }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: transparent; padding: 0; touch-action: manipulation; }
button:disabled { cursor: default; }
img { display: block; max-width: 100%; }
svg { display: block; flex-shrink: 0; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 3px solid oklch(0.57 0.25 305 / .55); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 0; }
.so-leitor { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------------ animações */
@keyframes rise { 0% { transform: translateY(10px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes fadein { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes conf { 0% { transform: translate(0, 0) rotate(0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.5); opacity: 0; } }
@keyframes flick { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.14) rotate(4deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes toastin { 0% { transform: translate(-50%, 20px); opacity: 0; } 100% { transform: translate(-50%, 0); opacity: 1; } }
@keyframes slidein { 0% { transform: translateX(40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes sheetup { 0% { transform: translateY(60px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes floatxp { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-54px); opacity: 0; } }
@keyframes edfill { 0% { transform: scaleX(.05); } 100% { transform: scaleX(1); } }
@keyframes ringpulse { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes ringpulse2 { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
.entra { animation: rise var(--anim-entrada) both; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------------------------------ títulos de página */
.titulo-pagina { font: var(--t-h1); letter-spacing: -.03em; margin: 0 0 8px; }
.sub-pagina { font-size: 16px; color: var(--texto-2); }
.titulo-2 { font: var(--t-h2); letter-spacing: -.02em; }
.cabeca-pagina { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }

/* ------------------------------------------------------------------ botões */
.btn {
  --btn-py: 12px; --btn-px: 20px; --btn-fs: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  padding: var(--btn-py) var(--btn-px); border: 0; border-radius: var(--r-pilula);
  font-family: inherit; font-weight: 800; font-size: var(--btn-fs); cursor: pointer;   /* line-height normal, como nos botões do protótipo */
  transition: background var(--anim-rapida), color var(--anim-rapida), border-color var(--anim-rapida), transform .12s, box-shadow .12s;
}
.btn:disabled { cursor: default; }
.btn-grande { --btn-py: 14px; --btn-px: 22px; --btn-fs: 15.5px; }
.btn-enorme { --btn-py: 16px; --btn-px: 24px; --btn-fs: 16.5px; }
.btn-bloco { width: 100%; }
.btn-flex { flex: 1; }

.btn-primario { background: var(--roxo); color: #fff; box-shadow: 0 3px 0 var(--roxo-sombra-botao); }
.btn-primario:hover:not(:disabled) { background: var(--roxo-hover); color: #fff; transform: translateY(-1px); }
.btn-primario:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--roxo-sombra-botao); }
.btn-primario.btn-grande, .btn-primario.btn-enorme { box-shadow: var(--sombra-botao); }
.btn-primario.btn-grande:active:not(:disabled), .btn-primario.btn-enorme:active:not(:disabled) { transform: translateY(3px); box-shadow: var(--sombra-botao-ativo); }
.btn-primario:disabled, .btn-primario[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn-contorno { background: var(--papel); color: var(--texto-forte); border: 1.5px solid var(--borda-input); font-weight: 700; }
.btn-contorno:hover:not(:disabled) { border-color: var(--roxo); color: var(--roxo); }
.btn-roxo-contorno { background: var(--papel); color: var(--roxo); border: 1.5px solid var(--roxo); }
.btn-roxo-contorno:hover:not(:disabled) { background: var(--roxo); color: #fff; }
.btn-suave { background: var(--roxo-tinta); color: var(--roxo-texto); }
.btn-suave:hover:not(:disabled) { background: var(--roxo); color: #fff; }
.btn-branco { background: #fff; color: var(--roxo); box-shadow: 0 4px 0 var(--botao-branco-sombra); }
.btn-branco:hover:not(:disabled) { transform: translateY(-1px); }
.btn-branco:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--botao-branco-sombra); }
.btn-texto { background: transparent; color: var(--roxo); padding: 4px 0; }
.btn-texto:hover:not(:disabled) { color: var(--roxo-texto); }
.btn-perigo { background: oklch(0.55 0.21 18); color: #fff; }
.btn-perigo:disabled { opacity: .45; pointer-events: none; }
.btn-ok { background: oklch(0.95 0.06 158); color: var(--acerto-texto); }

.btn-icone { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--lilas-chip); color: var(--texto-medio); flex: none; }
.btn-icone:hover { background: var(--roxo-tinta-forte); }
.btn-icone-grande { width: 44px; height: 44px; }
.btn-fechar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--lilas-chip); color: inherit; flex: none; }
.btn-fechar:hover { background: var(--roxo-tinta-forte); }

/* ------------------------------------------------------------------ chips e abas */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: var(--r-pilula);
  border: 1.5px solid var(--borda-input); background: var(--papel); color: var(--texto-forte);
  font-weight: 700; font-size: 14.5px; cursor: pointer; transition: all var(--anim-rapida);
}
.chip[aria-pressed="true"], .chip.ativo { background: var(--roxo); border-color: var(--roxo); color: #fff; }
.chip-tinta {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px 7px 14px; border-radius: var(--r-pilula);
  background: var(--roxo-tinta); color: var(--roxo-texto); font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.chip-tinta:hover { background: var(--roxo-tinta-forte); }
.contador {
  box-sizing: content-box; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pilula);
  background: var(--roxo); color: #fff; font-size: 12px; font-weight: 800;
}
.selo { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--r-pilula); font-weight: 800; font-size: 12.5px; white-space: nowrap; }
.selo-roxo { background: var(--roxo-tinta); color: var(--roxo-texto); }
.selo-ouro { background: var(--ouro-fundo); color: oklch(0.4 0.1 75); }
.selo-ok { background: oklch(0.95 0.06 158); color: var(--acerto-texto); }
.selo-erro { background: var(--erro-fundo); color: var(--erro-texto); }

.abas { display: flex; padding: 4px; border-radius: var(--r-pilula); background: var(--papel); border: 1.5px solid var(--lilas-borda-cartao); width: max-content; max-width: 100%; overflow: auto; scrollbar-width: none; }
.aba {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: var(--r-pilula);
  font-weight: 800; font-size: 15px; white-space: nowrap; color: var(--texto-abas); transition: all var(--anim-rapida);
}
.aba[aria-selected="true"] { background: var(--roxo); color: #fff; box-shadow: 0 3px 0 var(--roxo-sombra-botao); }
.aba-sm { padding: 9px 16px; font-size: 14.5px; }
.aba-md { padding: 9px 18px; }

/* ------------------------------------------------------------------ campos */
.rotulo { display: block; font-weight: 800; font-size: 14.5px; margin-bottom: 8px; }
.input {
  width: 100%; padding: 13px 16px; border-radius: var(--r-campo); border: 1.5px solid var(--borda-input);
  background: var(--papel); font-size: 15.5px; color: inherit; outline: 0; font-family: inherit;
  transition: border-color var(--anim-rapida), box-shadow var(--anim-rapida);
}
.input:focus, .input:focus-within { border-color: var(--roxo); box-shadow: 0 0 0 4px var(--roxo-foco); }
.input::placeholder { color: var(--texto-mudo); opacity: .85; }
textarea.input { resize: none; line-height: 1.5; }
.input-grande { padding: 14px 16px; border-radius: var(--r-item); font-size: 16px; }
.campo-erro { padding: 10px 14px; border-radius: var(--r-campo); background: var(--erro-fundo); color: oklch(0.45 0.16 18); font-weight: 700; font-size: 14.5px; }
.campo-com-prefixo { display: flex; align-items: center; padding-left: 14px; border-radius: var(--r-campo); border: 1.5px solid var(--borda-input); background: var(--papel); }
.campo-com-prefixo:focus-within { border-color: var(--roxo); box-shadow: 0 0 0 4px var(--roxo-foco); }
.campo-com-prefixo > span { color: var(--texto-3); font-weight: 700; }
.campo-com-prefixo > input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 13px 14px 13px 4px; font-size: 15.5px; background: transparent; color: inherit; }

.caixa { box-sizing: content-box; flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid oklch(0.8 0.04 306); background: #fff; color: #fff; display: grid; place-items: center; transition: all .12s; }
.caixa.ligada { border-color: var(--roxo); background: var(--roxo); }
.radio { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid oklch(0.82 0.04 306); background: #fff; transition: all var(--anim-rapida); }
.radio.ligado { border: 6px solid var(--roxo); }
.interruptor { flex: none; position: relative; width: 50px; height: 30px; border-radius: 99px; background: oklch(0.88 0.02 300); transition: background .2s; padding: 0; }
.interruptor::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px oklch(0.2 0.05 300 / .3); transition: left .2s; }
.interruptor[aria-checked="true"] { background: var(--roxo); }
.interruptor[aria-checked="true"]::after { left: 23px; }

/* ------------------------------------------------------------------ cartões e barras */
.cartao { background: var(--papel); border: 1px solid var(--borda); border-radius: var(--r-painel); box-shadow: var(--sombra-painel); }
.cartao-fino { background: var(--papel); border: 1px solid var(--borda); border-radius: var(--r-card); box-shadow: var(--sombra-card-fina); }
.barra { height: 8px; border-radius: 99px; background: oklch(0.95 0.02 306); overflow: hidden; }
.barra > i { display: block; height: 100%; border-radius: 99px; background: var(--roxo); transition: width .6s; }
.anel { transform: rotate(-90deg); }
.anel circle { transition: stroke-dashoffset .8s cubic-bezier(.2, .8, .2, 1); }

/* ------------------------------------------------------------------ avatar */
.avatar {
  --matiz: 304; --tam: 40px;
  width: var(--tam); height: var(--tam); border-radius: 50%; display: grid; place-items: center; flex: none; overflow: hidden;
  font-weight: 800; font-size: calc(var(--tam) * .38); color: #fff; background: oklch(0.55 0.2 var(--matiz)); background-size: cover; background-position: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ------------------------------------------------------------------ sobreposições */
.sobreposicao { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sobreposicao-folha { align-items: flex-end; padding: 0; }
.fundo-escuro { position: absolute; inset: 0; background: oklch(0.2 0.1 301 / .5); backdrop-filter: blur(3px); animation: fadein .2s ease; }
.fundo-claro { position: absolute; inset: 0; background: oklch(0.2 0.1 301 / .3); animation: fadein .2s ease; }
.modal {
  position: relative; width: 580px; max-width: 100%; max-height: 100%; overflow: auto; background: #fff; border-radius: 32px;
  padding: 28px 30px 30px; animation: rise .3s ease; box-shadow: var(--sombra-modal);
}
.modal-estreito { width: 460px; max-width: calc(100% - 32px); border-radius: 28px; padding: 26px; overflow: visible; }
.modal-cab { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-icone { flex: none; width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; background: var(--roxo); color: #fff; box-shadow: var(--sombra-botao); }
.modal-icone-erro { background: var(--erro-fundo); color: var(--erro-texto); box-shadow: none; }
.modal-titulo { font-weight: 800; font-size: 24px; letter-spacing: -.02em; line-height: 1.1; }
.modal-sub { font-size: 14.5px; color: var(--texto-suave); margin-top: 4px; line-height: 1.4; }
.modal-rodape { display: flex; gap: 12px; margin-top: 18px; }
@media (max-width: 1023px) {
  .sobreposicao { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: 92%; border-radius: 28px 28px 0 0; padding: 22px 18px 26px; animation-name: sheetup; padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
  .modal-estreito { align-self: center; border-radius: 28px; max-width: calc(100% - 32px); padding: 26px; }
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: var(--r-pilula); background: var(--roxo-profundo); color: #fff; font-weight: 700; font-size: 14.5px;
  box-shadow: 0 20px 40px -12px oklch(0.2 0.1 300 / .6); max-width: 92%; animation: toastin .3s ease both;
}
.toast svg { flex: none; color: var(--ouro); }
@media (max-width: 1023px) { .toast { bottom: calc(104px + env(safe-area-inset-bottom)); } }

/* ------------------------------------------------------------------ esqueleto e estados */
.esqueleto { display: block; border-radius: 10px; background: var(--esqueleto); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.estado { padding: 48px 24px; border-radius: var(--r-painel); background: #fff; text-align: center; border: 1px dashed oklch(0.85 0.06 306); }
.estado-icone { width: 60px; height: 60px; border-radius: 50%; display: inline-grid; place-items: center; margin-bottom: 14px; background: var(--roxo-tinta); color: var(--roxo); }
.estado-titulo { font-family: var(--fonte-titulo); font-weight: 800; font-size: 22px; margin-bottom: 6px; }
.estado-texto { font-size: 15.5px; color: var(--texto-suave); margin-bottom: 18px; }
.estado-erro { border: 1px solid oklch(0.9 0.05 18); padding: 44px 24px; }
.estado-erro .estado-icone { background: var(--erro-fundo); color: var(--erro-texto); }
.estado-erro .estado-titulo { font-size: 21px; }

.aviso-offline {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px;
  background: var(--roxo-profundo); color: #fff; font-size: 14px; font-weight: 600; text-align: center;
}
.aviso-offline svg { color: var(--ouro); }

/* ------------------------------------------------------------------ utilidades */
.linha { display: flex; align-items: center; gap: 12px; }
.coluna { display: flex; flex-direction: column; }
.flex-1 { flex: 1; min-width: 0; }
.truncar { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rolagem-fina { scrollbar-width: thin; scrollbar-color: oklch(0.85 0.05 306) transparent; }
.sem-barra { scrollbar-width: none; }
.sem-barra::-webkit-scrollbar { display: none; }

/* ------------------------------------------------------------------ SeletorCargo (lib/SeletorCargo.js): cargos do edital lido; usado na Organização e na configuração inicial */
.cargos { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-cargo { position: relative; max-width: 100%; text-align: left; }

/* aviso "este edital parece ser do concurso X" (lib/AvisoConcurso.js): passo 3 da configuração inicial e modal "Enviar edital" */
.aviso-conc { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--lilas-cintia); border: 1.5px solid var(--lilas-borda-ia); }
.aviso-conc-cab { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 14.5px; line-height: 1.3; color: var(--roxo-texto); }
.aviso-conc-lista { display: flex; flex-direction: column; gap: 8px; }
.aviso-conc-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 1.5px solid var(--lilas-borda-cartao); }
.aviso-conc-corpo { min-width: 0; }
.aviso-conc-nome { font-weight: 800; font-size: 15px; line-height: 1.3; letter-spacing: -.01em; }
.aviso-conc-linha { margin-top: 2px; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--texto-suave); }
.aviso-conc-motivos { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--roxo-texto); }
.aviso-conc-sim { flex: none; --btn-py: 9px; --btn-px: 18px; --btn-fs: 14px; }
.aviso-conc-nao { align-self: flex-start; padding: 2px 4px; font-weight: 700; font-size: 13.5px; color: var(--texto-suave); text-decoration: underline; text-underline-offset: 3px; }
.aviso-conc-nao:hover { color: var(--roxo); }
.aviso-conc.ok { gap: 4px; background: var(--acerto-fundo); border-color: oklch(0.88 0.06 158); }
.aviso-conc.ok .aviso-conc-cab { color: var(--acerto-texto); }
.aviso-conc.ok .aviso-conc-linha { color: var(--acerto-texto); }
@media (max-width: 520px) { .aviso-conc-item { flex-wrap: wrap; } .aviso-conc-sim { width: 100%; } }
.chip-cargo::after { content: ''; position: absolute; inset: -5px 0; }   /* alvo de toque de 44 px */
.cargos-lista { display: flex; flex-direction: column; gap: 10px; }
.cargos-busca { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 46px; border-radius: 999px; background: var(--papel); border: 1.5px solid var(--borda-input); color: var(--texto-3); }
.cargos-busca:focus-within { border-color: var(--roxo); box-shadow: 0 0 0 4px var(--roxo-foco); }
.cargos-busca input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--texto); }
.cargos-opcoes { display: flex; flex-direction: column; gap: 4px; max-height: 232px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: oklch(0.85 0.05 306) transparent; }
.cargo-op { display: flex; align-items: center; gap: 10px; width: 100%; min-height: var(--alvo-toque); padding: 8px 14px; border-radius: 14px; border: 1.5px solid transparent; font-weight: 700; font-size: 14.5px; line-height: 1.35; color: var(--texto-forte); text-align: left; }
.cargo-op:hover { background: var(--roxo-tinta); }
.cargo-op.ligado { background: var(--roxo-tinta); border-color: var(--roxo); color: var(--roxo); }
.cargos-sem { font-size: 14px; color: var(--texto-suave); line-height: 1.5; }
