/* Carbon-style overrides for legacy ecidadeonline pages
   Used by certidao*.php and other forms inside iframe CentroPref */

body {
    background: #f4f4f4 !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    color: #161616;
}

body > br { display: none; }

body > center {
    max-width: 720px;
    margin: 32px auto !important;
    padding: 32px 28px;
    background: #fff;
    border: 1px solid #e0e0e0;
    text-align: left !important;
    display: block;
}

body > center > br { display: none; }

/* Padroniza qualquer <font> no card (padrao certidaoimovel: 15px bold preto) */
body > center font {
    font-size: 15px !important;
    font-weight: normal !important;
    color: #000 !important;
    font-family: inherit !important;
    line-height: 1.5;
}

body > center font b,
body > center font strong {
    font-weight: normal !important;
    color: inherit !important;
}

/* Form table */
form table.texto,
form table[class="texto"] {
    width: 100% !important;
}

form table.texto td {
    padding: 8px 4px !important;
    vertical-align: middle;
    font-family: inherit;
    font-size: 14px;
    color: #393939;
    height: auto !important;
}

/* Normaliza colunas: rotulo 40% | input 60% */
form table.texto > tbody > tr > td:first-child,
form table.texto > tr > td:first-child { width: 40% !important; }
form table.texto > tbody > tr > td:nth-child(2),
form table.texto > tr > td:nth-child(2) { width: 60% !important; }

/* Linha de cabecalho com colspan ocupa toda a largura */
form table.texto td[colspan] { width: auto !important; }

/* Inputs — tamanho padronizado */
form input[type="text"],
form input[type="password"],
form input.digitacgccpf,
form #verificador {
    padding: 9px 12px;
    border: 1px solid #c6c6c6;
    font-family: inherit;
    font-size: 14px;
    background: #f4f4f4;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
    width: 100%;
    max-width: 360px;
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form input.digitacgccpf:focus,
form #verificador:focus {
    border-color: #198038;
    background: #fff;
}

/* Submit button */
form input.botao,
form input[type="submit"] {
    padding: 8px 24px;
    background: #198038;
    color: #fff;
    border: 1px solid #198038;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32px;
    cursor: pointer;
    transition: background 0.15s ease;
}

form input.botao:hover,
form input[type="submit"]:hover {
    background: #24a148;
    border-color: #24a148;
}

/* === Pagina de resultado (cai3_certidao.php) === */
body.cert-result {
    background: #f4f4f4 !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    color: #161616;
}

body.cert-result > br { display: none; }

body.cert-result .bold2 {
    max-width: 720px;
    margin: 32px auto 0 auto !important;
    padding: 32px 28px 16px 28px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    text-align: left !important;
    display: block;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: normal !important;
    color: #161616 !important;
}

body.cert-result > table {
    max-width: 720px !important;
    /* 27/08/2026: era width:auto, e o bloco do conteudo ficava mais estreito que
       a faixa do titulo - os dois se sobrepunham na tela de emissao. */
    width: 100% !important;
    margin: 0 auto 32px auto !important;
    padding: 16px 28px 32px 28px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-collapse: separate;
    box-sizing: border-box;
}

body.cert-result a[href*="js_certidao"] {
    display: inline-block;
    padding: 12px 28px;
    background: #198038;
    color: #fff !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32px;
    text-decoration: none !important;
    transition: background 0.15s ease;
    border: 1px solid #198038;
    margin: 8px 0;
}

body.cert-result a[href*="js_certidao"]:hover {
    background: #24a148;
    border-color: #24a148;
}

/* === Tela de opcoes de certidao (opcoescertidao.php) - 27/08/2026 ===
   Era a unica tela do fluxo fora deste padrao: o cidadao saia de telas com card
   branco e botao verde e caia numa tabela cinza com link sublinhado de 28px.
   As regras abaixo reaproveitam o markup legado - nenhuma logica foi alterada. */

body.cert-opcoes {
    background: #f4f4f4 !important;
    font-family: 'Segoe UI', Arial, sans-serif !important;
    color: #161616;
    margin: 0;
}

/* Tabela externa vira o card de 720px, igual ao das outras telas */
body.cert-opcoes > table {
    max-width: 720px;
    width: 100% !important;
    margin: 32px auto !important;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-collapse: separate;
    box-sizing: border-box;
}

/* Titulo da tela */
body.cert-opcoes > table > tbody > tr.bold3 > td {
    height: auto !important;
    padding: 32px 28px 4px 28px;
    text-align: left !important;
}

body.cert-opcoes > table > tbody > tr.bold3 font {
    font-family: inherit !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #161616 !important;
    line-height: 1.3;
}

/* Area de conteudo */
body.cert-opcoes > table > tbody > tr > td[height="200"] {
    height: auto !important;
    padding: 12px 28px 32px 28px;
    text-align: left !important;
    vertical-align: top !important;
}

body.cert-opcoes > table > tbody > tr > td[height="60"] { display: none; }

body.cert-opcoes td[height="200"] > table { width: 100% !important; }

/* Bloco de identificacao do imovel/contribuinte */
body.cert-opcoes td[bgcolor] {
    background: #f4f4f4 !important;
    border: 1px solid #e0e0e0;
    padding: 16px 20px !important;
    height: auto !important;
}

body.cert-opcoes td[bgcolor] table { width: 100% !important; }

body.cert-opcoes td[bgcolor] td {
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 0.32px;
    color: #6f6f6f;
    line-height: 1.9;
    vertical-align: top;
}

body.cert-opcoes td[bgcolor] .bold3 {
    display: inline-block;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0;
    color: #161616;
    margin-bottom: 6px;
}

/* O icone GIF do bloco nao carrega significado - fora */
body.cert-opcoes td[bgcolor] img { display: none; }

/* Cada opcao vira uma acao de 56px, com alvo de toque de verdade */
body.cert-opcoes a.links,
body.cert-opcoes a[class="links"] {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    margin-top: 12px;
    padding: 14px 20px;
    background: #fff;
    border: 1px solid #c6c6c6;
    color: #161616 !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease;
}

body.cert-opcoes a.links:hover { background: #f4f4f4; border-color: #8d8d8d; }

body.cert-opcoes a.links img { display: none; }

/* Chevron a direita, desenhado em CSS */
body.cert-opcoes a.links::after {
    content: "";
    margin-left: auto;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #525252;
    border-bottom: 1.5px solid #525252;
    transform: rotate(-45deg);
    flex: none;
}

/* A primeira opcao da lista e a acao principal */
body.cert-opcoes td[height="200"] > table > tbody > tr:nth-of-type(2) a.links {
    background: #198038;
    border-color: #198038;
    color: #fff !important;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.32px;
}

body.cert-opcoes td[height="200"] > table > tbody > tr:nth-of-type(2) a.links:hover {
    background: #24a148;
    border-color: #24a148;
}

body.cert-opcoes td[height="200"] > table > tbody > tr:nth-of-type(2) a.links::after {
    border-right-color: #fff;
    border-bottom-color: #fff;
}

/* Voltar: acao secundaria, alinhada a esquerda como no restante do fluxo */
body.cert-opcoes input.botao,
body.cert-opcoes input[type="submit"] {
    margin-top: 24px;
    padding: 10px 20px;
    min-height: 44px;
    background: #fff;
    border: 1px solid #c6c6c6;
    color: #161616;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32px;
    cursor: pointer;
}

body.cert-opcoes input.botao:hover { background: #f4f4f4; border-color: #8d8d8d; }

body.cert-opcoes td[align="center"]:has(input.botao) { text-align: left !important; }

@media (max-width: 760px) {
    body.cert-opcoes > table { margin: 0 auto !important; border-left: none; border-right: none; }
    body.cert-opcoes > table > tbody > tr.bold3 > td { padding: 24px 16px 4px 16px; }
    body.cert-opcoes > table > tbody > tr > td[height="200"] { padding: 12px 16px 24px 16px; }
}

body.cert-opcoes p.cert-nota {
    margin: 20px 0 0 0;
    font-size: 13px;
    line-height: 1.5;
    color: #525252;
    text-align: left;
}

/* Alinha as acoes com o bloco de identificacao (o cellpadding=5 do markup
   legado deslocava as opcoes ~5px para dentro) */
body.cert-opcoes td[height="200"] > table > tbody > tr > td:not([bgcolor]) {
    padding: 0 !important;
}

body.cert-opcoes td[bgcolor] table td { padding: 0 !important; }

/* === Aviso de certidao indisponivel (cai3_certidao.php) - 27/08/2026 ===
   Substitui o alert() do navegador com tela vazia atras: o motivo e a saida
   passam a ficar na propria pagina. */

body.cert-result .cert-aviso {
    background: #fff8e6;
    border: 1px solid #f1c21b;
    padding: 20px 24px;
    margin: 0 0 8px 0;
    text-align: left;
}

body.cert-result .cert-aviso-topo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

body.cert-result .cert-aviso-topo svg { flex: none; }

body.cert-result .cert-aviso h2 {
    margin: 0;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    color: #161616;
}

body.cert-result .cert-aviso p {
    margin: 0 0 12px 0;
    font-size: 15px;
    line-height: 1.5;
    color: #161616;
    text-wrap: pretty;
}

body.cert-result .cert-aviso p.cert-aviso-saida { color: #525252; }

body.cert-result .cert-aviso-dados {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 16px 0 0 0;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #e8dcb0;
}

body.cert-result .cert-aviso-dados dt {
    font-size: 12px;
    letter-spacing: 0.32px;
    color: #6f6f6f;
}

body.cert-result .cert-aviso-dados dd {
    margin: 0;
    font-size: 15px;
    color: #161616;
}

body.cert-result .cert-aviso-acoes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

body.cert-result a.cert-acao-primaria {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 12px 24px;
    background: #198038;
    border: 1px solid #198038;
    color: #fff !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32px;
    text-decoration: none !important;
    transition: background 0.15s ease;
}

body.cert-result a.cert-acao-primaria:hover {
    background: #24a148;
    border-color: #24a148;
}

/* Nesta tela o Voltar e acao secundaria, nao o botao azul nativo */
body.cert-result input.botao,
body.cert-result input[type="submit"] {
    min-height: 44px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #c6c6c6;
    color: #161616;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.32px;
    cursor: pointer;
}

body.cert-result input.botao:hover { background: #f4f4f4; border-color: #8d8d8d; }

body.cert-result td[align="center"] { text-align: left !important; }

/* A faixa do titulo somava o padding a largura (sem box-sizing) e ficava 56px
   mais larga que o card do conteudo - o degrau que se via na tela de emissao. */
body.cert-result .bold2 { box-sizing: border-box; }
body.cert-result > table { box-sizing: border-box; }

/* O Voltar acompanha o alinhamento do card, em vez de flutuar no centro */
body.cert-result center { text-align: left; }

/* === Marca da Prefeitura no topo das telas de certidao - 27/08/2026 ===
   Fica acima do card, sobre o fundo cinza, na mesma largura dele. */

body.cert-opcoes .cert-marca,
body.cert-result .cert-marca,
body.cert-form .cert-marca {
    max-width: 720px;
    margin: 32px auto 16px auto;
    padding: 0;
    box-sizing: border-box;
    text-align: left;
}

body.cert-opcoes .cert-marca img,
body.cert-result .cert-marca img,
body.cert-form .cert-marca img {
    display: block;
    /* 52px: abaixo disso a palavra PREFEITURA, que e a menor da marca, some */
    height: 52px;
    width: auto;
}

/* O card ja nao precisa da margem de topo - a marca ocupa esse espaco */
body.cert-opcoes > table { margin-top: 0 !important; }
body.cert-form > center { margin-top: 0 !important; }
body.cert-result .bold2 { margin-top: 0 !important; }

@media (max-width: 760px) {
    body.cert-opcoes .cert-marca,
    body.cert-result .cert-marca,
    body.cert-form .cert-marca { margin: 24px 16px 12px 16px; }
    body.cert-opcoes .cert-marca img,
    body.cert-result .cert-marca img,
    body.cert-form .cert-marca img { height: 32px; }
}
