/* =========================================================================
   UX / CONVERSÃO — componentes compartilhados do site público
   ========================================================================= */

/* ---------- Alerta contextual (1 linha) ---------- */
.alerta-inline {
    border-radius: 14px; padding: 20px 22px; margin: 24px 0;
    display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px;
    background: #f0f6ff; border: 1px solid #c9dcf7;
}
.alerta-inline.destaque { background: linear-gradient(135deg, #003366, #1f4e79); border: 0; color: #fff; }
.alerta-inline .ai-texto { display: flex; flex-direction: column; gap: 4px; }
.alerta-inline .ai-texto strong { font-size: 1.1rem; line-height: 1.3; }
.alerta-inline .ai-texto span { font-size: .92rem; opacity: .85; }
.alerta-inline .ai-prova { font-weight: 700; opacity: 1 !important; }
.alerta-inline .ai-campos { display: grid; grid-template-columns: 1.2fr .6fr 1.4fr auto; gap: 8px; }
.alerta-inline input, .alerta-inline select {
    min-height: 48px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 10px;
    font: inherit; font-size: 1rem; background: #fff; color: #111827; width: 100%; box-sizing: border-box;
}
.alerta-inline input:focus, .alerta-inline select:focus { outline: 3px solid rgba(245, 158, 11, .45); border-color: #f59e0b; }
.alerta-inline button {
    min-height: 48px; padding: 0 22px; border: 0; border-radius: 10px; cursor: pointer;
    background: #f59e0b; color: #1f2937; font-weight: 800; font-size: 1rem; white-space: nowrap;
}
.alerta-inline button:hover { background: #fbbf24; }
.alerta-inline .ai-lgpd { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; font-size: .78rem; opacity: .85; cursor: pointer; }
.alerta-inline .ai-lgpd input { margin: 2px 0 0; flex: none; width: 15px !important; height: 15px; min-height: 0; padding: 0; }
.alerta-inline .ai-lgpd a { color: inherit; text-decoration: underline; }
.alerta-inline .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 760px) {
    .alerta-inline { padding: 16px; }
    .alerta-inline .ai-campos { grid-template-columns: 1fr 96px; }
    .alerta-inline .ai-campos input[name=contato], .alerta-inline .ai-campos button { grid-column: 1 / -1; }
}

/* ---------- Produto em contexto ---------- */
.produto-bloco {
    margin-top: 22px; border: 2px solid #f59e0b; background: linear-gradient(135deg, #fff7e6 0%, #fff 60%);
    border-radius: 16px; padding: 18px 20px; box-shadow: 0 10px 28px rgba(180, 83, 9, .12); position: relative;
}
.produto-bloco .pb-chamada { display: inline-block; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: #b45309; padding: 4px 10px; border-radius: 99px; margin-bottom: 12px; }
.produto-bloco .pb-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.produto-bloco .pb-topo:empty { display: none; }
.produto-bloco .pb-publicidade { margin: 0 0 12px auto; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #6b7280; border: 1px solid #d1d5db; padding: 3px 8px; border-radius: 99px; }
.produto-bloco .pb-corpo { display: flex; gap: 18px; align-items: flex-start; }
.produto-bloco .pb-capa { flex-shrink: 0; width: 190px; position: relative; display: block; }
.produto-bloco .pb-capa img { width: 100%; height: auto; max-height: 200px; object-fit: cover; border-radius: 10px; box-shadow: 0 10px 22px rgba(0,0,0,.18); display: block; background: #f3f4f6; }
.produto-bloco .pb-capa-vazia {
    width: 190px; height: 150px; border-radius: 10px; display: grid; place-items: center; font-size: 3rem;
    background: linear-gradient(135deg, #003366, #2e5902); box-shadow: 0 10px 22px rgba(0,0,0,.18);
}
.produto-bloco .pb-capa:not(.sem-img) .pb-capa-vazia { display: none; }
.produto-bloco .pb-selo { position: absolute; left: 8px; top: 8px; background: rgba(0,51,102,.92); color: #fff; font-size: .66rem; font-weight: 800; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.produto-bloco .pb-info { flex: 1; min-width: 0; }
.produto-bloco .pb-titulo { display: block; font-weight: 900; color: #111827; text-decoration: none; font-size: 1.12rem; line-height: 1.3; margin: 0 0 4px; }
.produto-bloco .pb-titulo:hover { color: #003366; }
.produto-bloco .pb-nota { display: inline-block; color: #d97706; font-weight: 800; font-size: .92rem; margin-bottom: 4px; }
.produto-bloco .pb-nota small { color: #6b7280; font-weight: 600; }
.produto-bloco .pb-desc { margin: 0 0 6px; color: #4b5563; font-size: .92rem; line-height: 1.45; }
.produto-bloco .pb-beneficios { margin: 6px 0 8px; padding: 0; list-style: none; font-size: .88rem; color: #374151; }
.produto-bloco .pb-beneficios li { padding-left: 20px; position: relative; margin: 3px 0; }
.produto-bloco .pb-beneficios li::before { content: "✓"; position: absolute; left: 0; color: #16a34a; font-weight: 800; }
.produto-bloco .pb-acao { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 10px; padding-top: 12px; border-top: 1px dashed #fcd9a0; }
.produto-bloco .pb-preco { line-height: 1.1; }
.produto-bloco .pb-preco small { display: block; font-size: .72rem; color: #6b7280; font-weight: 700; text-transform: uppercase; }
.produto-bloco .pb-preco strong { font-size: 1.6rem; font-weight: 900; color: #15803d; }
.produto-bloco .pb-preco strong.pb-preco-site { font-size: 1rem; color: #1f2937; }
.produto-bloco .pb-botao {
    display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 24px; border-radius: 12px;
    background: #f59e0b; color: #1f2937; font-weight: 900; text-decoration: none; font-size: 1rem;
    box-shadow: 0 6px 16px rgba(245, 158, 11, .35); transition: transform .15s, background .15s;
}
.produto-bloco .pb-botao:hover { background: #fbbf24; color: #111827; transform: translateY(-1px); }
.produto-bloco .pb-botao.pb-off { background: #e5e7eb; color: #6b7280; box-shadow: none; }
.produto-bloco .pb-rodape { margin-top: 8px; font-size: .74rem; color: #9ca3af; }
.produto-bloco .pb-rodape a { color: #003366; font-weight: 700; }
.produto-bloco.compacto { border-width: 1px; box-shadow: none; padding: 14px 16px; }
.produto-bloco.compacto .pb-capa { width: 96px; }
.produto-bloco.compacto .pb-capa-vazia { width: 96px; height: 96px; font-size: 2rem; }
.produto-bloco.compacto .pb-preco strong { font-size: 1.25rem; }
.produto-bloco.compacto .pb-botao { min-height: 44px; font-size: .92rem; }

/* ---------- Selos de prazo ---------- */
.prazo-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 800; }
.prazo-chip.aberto { background: #dcfce7; color: #166534; }
.prazo-chip.urgente { background: #fee2e2; color: #b91c1c; }
.prazo-chip.em-breve { background: #ffedd5; color: #9a3412; }
.prazo-chip.encerrado { background: #f3f4f6; color: #6b7280; }

/* ---------- Barra fixa no celular ---------- */
.barra-fixa { display: none; }
@media (max-width: 760px) {
    .barra-fixa {
        display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1500;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97);
        box-shadow: 0 -6px 20px rgba(0,0,0,.12); backdrop-filter: blur(6px);
    }
    .barra-fixa a {
        flex: 1; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px;
        border-radius: 10px; font-weight: 800; text-decoration: none; font-size: .95rem;
    }
    .barra-fixa .bf-principal { background: #f59e0b; color: #1f2937; }
    .barra-fixa .bf-secundario { background: #003366; color: #fff; }
    body { padding-bottom: 76px; }
}

/* ---------- Menu e alvos de toque (celular) ---------- */
@media (max-width: 768px) {
    .navbar { padding: 8px 0 !important; }
    .nav-content { flex-direction: row !important; justify-content: space-between; gap: 8px !important; }
    .brand img { height: 38px !important; }
    .nav-toggle { display: inline-flex !important; }
    .nav-menu {
        display: none !important; position: absolute; top: 100%; left: 0; right: 0; background: #fff;
        flex-direction: column; align-items: stretch !important; gap: 0 !important; padding: 8px 16px 14px;
        box-shadow: 0 12px 24px rgba(0,0,0,.12); border-top: 1px solid #e5e7eb;
    }
    .nav-menu.aberto { display: flex !important; }
    .nav-menu li a { display: flex; align-items: center; min-height: 48px; padding: 0 6px; border-bottom: 1px solid #f1f5f9; }
    .nav-menu li a.btn-nav-highlight { justify-content: center; margin-top: 10px; border-bottom: 0; }
    .nav-link::after { display: none; }

    .footer-links a, .site-footer a { display: inline-block; min-height: 44px; line-height: 44px; }
    .footer-links li { margin-bottom: 0 !important; }

    /* Busca do topo legível no celular */
    .search-box input, .search-box select { flex: none !important; width: 100% !important; min-height: 50px; box-sizing: border-box; }
    .search-box button { min-height: 50px; }
}
.nav-toggle {
    display: none; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 10px;
    border: 1px solid #e5e7eb; background: #fff; font-size: 1.3rem; cursor: pointer; color: #111827;
}

/* ---------- Leitura ---------- */
/* Textos longos (parágrafos e itens de lista do conteúdo) justificados, com hifenização;
   a última linha e os textos de uma linha só continuam alinhados à esquerda. */
.article-body p, .article-body li, .rich-text p, .rich-text li, .faq-lista p, .legal p, .legal li,
.prod-completa p, .prod-desc, .resumo-venda, .nota-escopo, .produto-bloco .pb-desc, .alerta-inline .ai-texto span {
    text-align: justify; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto;
}
.article-body td, .article-body th, .bx-origem, .bx-req, .sel-sub, .ti-event { text-align: left; hyphens: manual; }

/* ---------- Home: números e explicação ---------- */
.numeros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.numero { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px; text-align: center; }
.numero strong { display: block; font-size: 1.8rem; font-weight: 900; color: #003366; line-height: 1.1; }
.numero span { font-size: .85rem; color: #6b7280; }
@media (max-width: 760px) { .numeros { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 480px) {
    .produto-bloco { padding: 14px; }
    .produto-bloco:not(.compacto) .pb-corpo { flex-direction: column; }
    .produto-bloco:not(.compacto) .pb-capa { width: 100%; }
    .produto-bloco:not(.compacto) .pb-capa img { max-height: 220px; }
    .produto-bloco:not(.compacto) .pb-capa-vazia { width: 100%; height: 120px; }
    .produto-bloco.compacto .pb-capa { width: 72px; }
    .produto-bloco.compacto .pb-capa-vazia { width: 72px; height: 72px; }
    .produto-bloco .pb-acao { flex-direction: column; align-items: stretch; }
}

/* ---------- Aviso de prazo piscando ---------- */
.aviso-prazo {
    display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px;
    font-weight: 900; font-size: 1.05rem; line-height: 1.2; letter-spacing: .01em;
    background: #fef3c7; color: #78350f; border: 2px solid #f59e0b;
    animation: aviso-piscar 1.6s ease-in-out infinite;
}
.aviso-prazo .ap-ponto {
    width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex-shrink: 0;
    animation: aviso-ponto 1.6s ease-in-out infinite;
}
.aviso-prazo.urgente { background: #fee2e2; color: #991b1b; border-color: #ef4444; animation-duration: 1s; }
.aviso-prazo.urgente .ap-ponto { animation-duration: 1s; }
.aviso-prazo.em-breve { background: #ffedd5; color: #9a3412; border-color: #fb923c; }
.aviso-prazo.encerrado, .aviso-prazo.previsto { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; animation: none; }
.aviso-prazo.encerrado .ap-ponto, .aviso-prazo.previsto .ap-ponto { animation: none; opacity: .5; }
.aviso-prazo.bloco { display: flex; justify-content: center; width: 100%; box-sizing: border-box; margin: 0 0 15px; }
.aviso-prazo.mini { padding: 4px 10px; gap: 6px; font-size: .8rem; border-radius: 99px; border-width: 1px; }
.aviso-prazo.mini .ap-ponto { width: 7px; height: 7px; }
@keyframes aviso-piscar {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); filter: brightness(1.06); }
}
@keyframes aviso-ponto { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) {
    .aviso-prazo, .aviso-prazo .ap-ponto { animation: none !important; }
}

/* ---------- Página do edital: resumo rápido ---------- */
.resumo-rapido { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 30px; }
.rr-item { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; min-width: 0; }
.rr-item .rr-rotulo { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; margin-bottom: 4px; }
.rr-item .rr-valor { display: block; font-size: 1.05rem; font-weight: 800; color: #111827; overflow-wrap: anywhere; }
.rr-item .rr-extra { display: block; font-size: .82rem; color: #6b7280; margin-top: 3px; }
.rr-item.destaque { border-color: #f59e0b; background: #fffbeb; }
@media (max-width: 760px) { .resumo-rapido { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.cidades-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.cidades-chips span { background: #f3f4f6; border-radius: 99px; padding: 5px 12px; font-size: .85rem; font-weight: 600; color: #374151; }
.cidades-chips strong { color: #111827; }
.nota-escopo { font-size: .85rem; color: #6b7280; margin: -8px 0 16px; }

/* ---------- Destaque dos cards pela fase do processo ---------- */
.fase-aberto {
    position: relative;
    box-shadow: 0 0 0 2px #22c55e, 0 14px 28px -14px rgba(22, 163, 74, .55) !important;
}
.fase-encerrado { opacity: .85; }
.fase-avancado { opacity: .68; filter: saturate(.55); }
.fase-finalizado { opacity: .55; filter: grayscale(.85); }
.fase-encerrado, .fase-avancado, .fase-finalizado { transition: opacity .2s, filter .2s; }
.fase-encerrado:hover, .fase-avancado:hover, .fase-finalizado:hover,
.fase-encerrado:focus-within, .fase-avancado:focus-within, .fase-finalizado:focus-within { opacity: 1; filter: none; }

/* ---------- Tabelas no texto das notícias ---------- */
.article-body table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .95rem; display: block; overflow-x: auto; }
.article-body th { background: #003366; color: #fff; text-align: left; padding: 10px 12px; white-space: nowrap; }
.article-body td { padding: 9px 12px; border-bottom: 1px solid #e5e7eb; }
.article-body tbody tr:nth-child(even) { background: #f8fafc; }
@media (max-width: 600px) {
    .article-body table { display: table; table-layout: fixed; font-size: .8rem; }
    .article-body th, .article-body td { padding: 7px 5px; white-space: normal; overflow-wrap: anywhere; }
}
.article-body li, .article-body p { overflow-wrap: anywhere; }

/* ---------- Home: seleções com inscrição aberta ---------- */
.grid-selecoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.selecao { background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 18px 20px; box-shadow: 0 10px 28px -18px rgba(0,0,0,.35); border-top: 4px solid #003366; }
.selecao.Exército { border-top-color: #386641; } .selecao.Aeronáutica { border-top-color: #005b96; }
.sel-cab { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 14px; align-items: center; text-decoration: none; color: inherit; }
.sel-logo { width: 48px; height: 48px; object-fit: contain; }
.sel-forca { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #64748b; }
.sel-tit h3 { margin: 2px 0; font-size: 1.12rem; line-height: 1.3; color: #111827; text-align: left; }
.sel-sub { margin: 0; font-size: .86rem; color: #4b5563; text-align: left; }
.sel-num { text-align: right; }
.sel-num strong { display: block; font-size: 2rem; line-height: 1; color: #003366; font-weight: 900; }
.sel-num span { font-size: .72rem; font-weight: 800; text-transform: uppercase; color: #64748b; }
.sel-prazo { margin: 12px 0 0; }
.sel-ufs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e5e7eb; }
.sel-ufs-rot { font-size: .8rem; font-weight: 700; color: #374151; margin-right: 2px; }
.sel-ufs a, .mh-chips a { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 10px; border-radius: 99px; background: #f0f6ff; border: 1px solid #c9dcf7; color: #0b3b6e; font-weight: 800; font-size: .85rem; text-decoration: none; }
.sel-ufs a small, .mh-chips a small { font-weight: 700; color: #4b6b93; }
.sel-ufs a:hover, .mh-chips a:hover { background: #003366; color: #fff; border-color: #003366; }
.sel-ufs a:hover small, .mh-chips a:hover small { color: #cbd5e1; }

/* ---------- Mapas: fundo com a imagem das forças, desfocada ---------- */
.mapa-fundo, .mapa-home .mh-grid { position: relative; isolation: isolate; overflow: hidden; }
.mapa-fundo::before, .mapa-home .mh-grid::before {
    content: ''; position: absolute; inset: -30px; z-index: -2;
    background: url('../img/hero-militar-bg.webp') center 30% / cover no-repeat; filter: blur(14px) saturate(.8);
}
.mapa-fundo::after, .mapa-home .mh-grid::after { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(255,255,255,.80); }

/* ---------- Home: mapa compacto ---------- */
.mh-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; border-radius: 18px; padding: 24px; border: 1px solid #e5e7eb; }
.mh-mapa { min-height: 360px; display: grid; place-items: center; }
.mh-mapa svg { width: 100%; height: auto; max-height: 470px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.12)); }
.mh-total { display: block; margin-bottom: 10px; color: #111827; }
.mh-ranking ol { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.mh-ranking li a { display: grid; grid-template-columns: 34px minmax(0, 1fr) 42px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; text-decoration: none; color: #111827; }
.mh-ranking li a:hover { background: rgba(0, 51, 102, .08); }
.mh-uf { font-weight: 900; color: #003366; }
.mh-barra { height: 12px; border-radius: 99px; background: rgba(0, 51, 102, .1); overflow: hidden; }
.mh-barra i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2a64a8, #0b3b6e); min-width: 6px; }
.mh-n { text-align: right; font-weight: 800; }
.mh-chips { display: none; }
@media (max-width: 760px) {
    .mh-grid { grid-template-columns: minmax(0, 1fr); padding: 16px; }
    .mh-mapa, .mh-ranking { display: none; }
    .mh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
    .sel-cab { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
    .sel-logo { width: 40px; height: 40px; }
    .sel-num strong { font-size: 1.6rem; }
    .selecao { padding: 16px; }
}

/* Listas dentro de textos ricos (edital, vaga, notícias) com marcador */
.rich-text ul { list-style: disc; padding-left: 22px; margin: 8px 0; }
.rich-text ol { list-style: decimal; padding-left: 22px; margin: 8px 0; }
.rich-text li { margin: 5px 0; }
