/* Licita PME — estilos */
:root {
  --bg: #f4f6fb; --card: #ffffff; --text: #12204a; --text-2: #3f4a5e; --muted: #667085; --line: #e1e6f0; --line-2: #eef1f7;
  --primary: #1f5eff; --primary-600: #1747d1; --primary-soft: #e8efff; --primary-text: #ffffff;
  --ok: #12805c; --ok-soft: #e3f6ee; --warn: #a35400; --warn-soft: #fff1de; --bad: #c0262d; --bad-soft: #fde8e8;
  --shadow: 0 1px 2px rgba(18, 32, 74, .05), 0 4px 16px rgba(18, 32, 74, .06);
  --radius: 16px; --radius-sm: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f131b; --card: #171c26; --text: #e8ecf4; --text-2: #c3cad8; --muted: #98a1b3; --line: #2a3140; --line-2: #212735;
    --primary: #6d95ff; --primary-600: #8aabff; --primary-soft: #1d2842; --primary-text: #0f131b;
    --ok: #41c494; --ok-soft: #15322a; --warn: #f0a84c; --warn-soft: #3a2a15; --bad: #ff7a7f; --bad-soft: #3d1c1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--radius-sm); padding: 11px 18px; font-weight: 600; cursor: pointer; text-decoration: none; background: var(--primary); color: var(--primary-text); transition: background .15s, transform .05s; min-height: 44px; }
.btn:hover { background: var(--primary-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.sec { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn.sec:hover { background: var(--line-2); }
.btn.ghost { background: transparent; color: var(--primary); padding: 8px 10px; min-height: 0; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.perigo { background: var(--bad); color: #fff; }
.btn.bloco { width: 100%; }
.btn.peq { padding: 7px 12px; font-size: 14px; min-height: 36px; }
.link { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.campo { margin-bottom: 16px; }
.campo > label, .rotulo { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.campo .ajuda, .ajuda { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input:not([type]), select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm); padding: 11px 13px; min-height: 46px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.senha { position: relative; }
.senha input { padding-right: 52px; }
.senha .olho { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 44px; border: 0; background: none; cursor: pointer; border-radius: 8px; color: var(--muted); font-size: 18px; }
.senha .olho:hover { background: var(--line-2); }
.regras { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.regras li::before { content: "○ "; }
.regras li.ok { color: var(--ok); }
.regras li.ok::before { content: "✓ "; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.codigo { font-size: 28px; letter-spacing: 12px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.erro-form { background: var(--bad-soft); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14.5px; margin-bottom: 14px; }
.info-form { background: var(--primary-soft); color: var(--text-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }

/* ---------- telas de entrada (login/cadastro) ---------- */
.entrada { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.entrada-hero { background: linear-gradient(150deg, #2a66ff 0%, #1238b8 100%); color: #fff; padding: 48px clamp(24px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.entrada-hero .marca { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.entrada-hero .marca img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
.entrada-hero h1 { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -1px; max-width: 520px; }
.entrada-hero p { font-size: 18px; opacity: .9; max-width: 480px; margin: 0; }
.beneficios { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 480px; }
.beneficios li { display: flex; gap: 14px; align-items: flex-start; background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 14px 16px; }
.beneficios .ic { font-size: 24px; line-height: 1; }
.beneficios strong { display: block; }
.beneficios span { opacity: .85; font-size: 14.5px; }
.entrada-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.cartao-entrada { width: 100%; max-width: 420px; }
.cartao-entrada h2 { font-size: 26px; letter-spacing: -.5px; margin-bottom: 6px; }
.cartao-entrada .sub { color: var(--muted); margin: 0 0 24px; }
.cartao-entrada .rodape { text-align: center; color: var(--muted); margin-top: 22px; font-size: 15px; }
.marca-mobile { display: none; }
@media (max-width: 860px) {
  .entrada { grid-template-columns: 1fr; }
  .entrada-hero { display: none; }
  .marca-mobile { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; margin-bottom: 28px; }
  .marca-mobile img { width: 36px; height: 36px; border-radius: 9px; }
}

/* ---------- app (logado) ---------- */
.topo { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topo-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.topo .marca { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 19px; letter-spacing: -.4px; text-decoration: none; color: var(--text); }
.topo .marca img { width: 32px; height: 32px; border-radius: 8px; }
.pme { color: var(--primary); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 15px; display: flex; gap: 6px; align-items: center; position: relative; }
.nav a:hover { background: var(--line-2); color: var(--text); }
.nav a.ativo { background: var(--primary-soft); color: var(--primary); }
.nav .bolha { background: var(--bad); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; min-width: 18px; text-align: center; line-height: 18px; }
.usuario { margin-left: auto; position: relative; }
.avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--primary-soft); color: var(--primary); font-weight: 800; cursor: pointer; font-size: 16px; }
.menu { position: absolute; right: 0; top: 48px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 230px; padding: 8px; z-index: 30; }
.menu .quem { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .quem small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; }
.menu a, .menu button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 10px; border-radius: 9px; text-decoration: none; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; font-size: 15px; }
.menu a:hover, .menu button:hover { background: var(--line-2); }
main.app { max-width: 1120px; margin: 0 auto; padding: 24px 16px 100px; }
.navbaixo { display: none; }
@media (max-width: 760px) {
  .topo .nav { display: none; }
  .navbaixo { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
  .navbaixo a { text-decoration: none; color: var(--muted); font-size: 11.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px; }
  .navbaixo a .i { font-size: 20px; }
  .navbaixo a.ativo { color: var(--primary); }
}

.titulo-pag { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.titulo-pag h1 { font-size: 26px; letter-spacing: -.5px; }
.titulo-pag p { color: var(--muted); margin: 4px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2 { font-size: 18px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }
.grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.numero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: block; }
a.numero:hover { border-color: var(--primary); }
.numero .n { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.numero .l { color: var(--muted); font-size: 14px; }
.numero .ic { float: right; font-size: 22px; }
@media (max-width: 560px) {
  .grade { grid-template-columns: 1fr 1fr; gap: 10px; }
  .numero { padding: 12px 14px; }
  .numero .n { font-size: 24px; }
  .numero .ic { display: none; }
  .numero .l { font-size: 13px; line-height: 1.3; }
  .titulo-pag h1 { font-size: 22px; }
  .card { padding: 16px; }
}
.barra { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.barra > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.duas { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .duas { grid-template-columns: 1fr; } }

.boas-vindas { background: linear-gradient(135deg, var(--primary) 0%, #1238b8 100%); color: #fff; border: 0; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.boas-vindas h2 { font-size: 22px; }
.boas-vindas p { margin: 4px 0 0; opacity: .9; }
.boas-vindas .btn { background: #fff; color: #1238b8; }

/* ---------- edital ---------- */
.edital { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: start; }
.edital + .edital { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.combina { width: 72px; text-align: center; border-radius: 14px; padding: 8px 4px; font-weight: 800; }
.combina b { display: block; font-size: 22px; letter-spacing: -.5px; }
.combina small { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; line-height: 1.2; }
.alta { background: var(--ok-soft); color: var(--ok); } .media { background: var(--warn-soft); color: var(--warn); } .baixa { background: var(--line-2); color: var(--muted); }
.edital h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.edital h3 a { color: var(--text); text-decoration: none; }
.edital h3 a:hover { color: var(--primary); }
.meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px 14px; flex-wrap: wrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--line-2); color: var(--text-2); }
.tag.ok { background: var(--ok-soft); color: var(--ok); } .tag.warn { background: var(--warn-soft); color: var(--warn); } .tag.bad { background: var(--bad-soft); color: var(--bad); } .tag.pri { background: var(--primary-soft); color: var(--primary); }
.acoes-edital { display: flex; flex-direction: column; gap: 8px; min-width: 170px; }
@media (max-width: 680px) {
  .edital { grid-template-columns: auto 1fr; }
  .acoes-edital { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .acoes-edital .btn { flex: 1; }
}
.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filtros input[type=search] { flex: 1 1 240px; width: auto; }
.filtros select { width: auto; flex: 0 1 auto; }
.abas { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.abas button { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 7px 14px; font-weight: 600; cursor: pointer; font-size: 14.5px; }
.abas button.ativo { background: var(--text); color: var(--card); border-color: var(--text); }
.vazio { text-align: center; padding: 36px 16px; color: var(--muted); }
.vazio .ic { font-size: 44px; display: block; margin-bottom: 8px; }
.vazio h3 { color: var(--text); margin-bottom: 6px; font-size: 18px; }
.vazio p { max-width: 420px; margin: 0 auto 16px; }

/* detalhe do edital */
.etapas { display: flex; gap: 8px; flex-wrap: wrap; }
.etapas button { flex: 1 1 150px; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; font-weight: 600; font-size: 14.5px; }
.etapas button small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.etapas button.ativo { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.etapas button.descartar.ativo { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.ia-cta { text-align: center; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); }
.ia-cta .ic { font-size: 40px; }
.ia-cta h3 { margin: 8px 0 6px; font-size: 19px; }
.ia-cta p { color: var(--muted); max-width: 460px; margin: 0 auto 16px; }
.ia-cta .btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.secoes-ia { display: grid; gap: 12px; }
details.secao { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
details.secao > summary { cursor: pointer; padding: 14px 16px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
details.secao > summary::-webkit-details-marker { display: none; }
details.secao > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
details.secao[open] > summary::after { transform: rotate(180deg); }
details.secao > div { padding: 0 16px 16px; }
details.secao ul { margin: 0; padding-left: 20px; }
details.secao li { margin-bottom: 6px; }
.checklist { list-style: none; padding: 0 !important; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.checklist input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--ok); flex: none; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }
.veredito { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; margin-bottom: 12px; }
.veredito .ic { font-size: 30px; }
.veredito.ok { background: var(--ok-soft); } .veredito.warn { background: var(--warn-soft); } .veredito.bad { background: var(--bad-soft); }
.veredito strong { display: block; font-size: 17px; }
.prazo-linha { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.prazo-linha:last-child { border: 0; }
.dias { min-width: 74px; text-align: center; font-weight: 800; border-radius: 10px; padding: 6px 4px; font-size: 13.5px; }
.dias.bad { background: var(--bad-soft); color: var(--bad); } .dias.warn { background: var(--warn-soft); color: var(--warn); } .dias.ok { background: var(--ok-soft); color: var(--ok); } .dias.neutro { background: var(--line-2); color: var(--muted); }

/* chips (palavras-chave, estados) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; background: var(--card); min-height: 50px; cursor: text; }
.chips:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary); border-radius: 99px; padding: 5px 6px 5px 12px; font-weight: 600; font-size: 14px; }
.chip.neg { background: var(--bad-soft); color: var(--bad); }
.chip button { border: 0; background: rgba(0, 0, 0, .06); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; color: inherit; line-height: 1; }
.chips input { border: 0 !important; box-shadow: none !important; flex: 1 1 160px; min-height: 34px !important; padding: 4px 6px !important; background: transparent !important; width: auto !important; }
.sugestoes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sugestoes button { border: 1px dashed var(--line); background: none; border-radius: 99px; padding: 5px 11px; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.sugestoes button:hover { border-color: var(--primary); color: var(--primary); }
.ufs { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.ufs button { border: 1px solid var(--line); background: var(--card); border-radius: 10px; padding: 9px 0; font-weight: 700; cursor: pointer; font-size: 14px; }
.ufs button.ativo { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.opcoes button { border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px; cursor: pointer; text-align: left; font-weight: 700; }
.opcoes button small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.opcoes button.ativo { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.interruptor { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.interruptor:last-child { border: 0; }
.interruptor small { display: block; color: var(--muted); font-size: 13.5px; }
.interruptor input { appearance: none; width: 46px; height: 28px; min-height: 0; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; flex: none; padding: 0; border: 0; }
.interruptor input::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: left .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.interruptor input:checked { background: var(--ok); }
.interruptor input:checked::after { left: 21px; }

/* assistente de primeiros passos */
.assistente { max-width: 680px; margin: 0 auto; }
.passos { display: flex; gap: 6px; margin-bottom: 18px; }
.passos span { flex: 1; height: 6px; border-radius: 99px; background: var(--line); }
.passos span.feito { background: var(--primary); }
.assistente .rodape-passos { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* barra de ações fixa nos formulários */
.salvar-fixo { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 760px) { .salvar-fixo { bottom: 62px; } }

/* modal e avisos */
.fundo-modal { position: fixed; inset: 0; background: rgba(10, 16, 30, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--card); border-radius: 18px; padding: 24px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal h3 { font-size: 20px; margin-bottom: 8px; }
.modal p { color: var(--text-2); margin: 0 0 20px; }
.modal .btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.avisos { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 460px); }
@media (max-width: 760px) { .avisos { bottom: 80px; } }
.aviso { background: var(--text); color: var(--card); border-radius: 12px; padding: 12px 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); font-size: 15px; animation: sobe .2s ease-out; }
.aviso.erro { background: var(--bad); color: #fff; }
@keyframes sobe { from { opacity: 0; transform: translateY(8px); } }
.carregando { display: grid; place-items: center; min-height: 50vh; color: var(--muted); }
.girando { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: gira .7s linear infinite; vertical-align: -3px; }
@keyframes gira { to { transform: rotate(360deg); } }
.texto-longo { max-width: 760px; }
.texto-longo h2 { margin: 22px 0 8px; font-size: 18px; }
.texto-longo p, .texto-longo li { color: var(--text-2); }
