/* Páginas de pedido de certidão (certidao.php, assets/js/certidao.js): topo com título, descrição e imagem;
   cartão do pedido com título › pergunta › botões de resposta; conteúdo em perguntas que abrem. */
/* Topo: título, descrição curta e imagem */
.tool { background: var(--cream); padding-bottom: 56px; }
.tool-top { background: radial-gradient(110% 140% at 20% 0%, var(--navy-800) 0%, var(--navy-900) 50%, var(--navy-950) 100%); padding: 32px 16px 104px; }
.tool-top-in { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 24px 56px; align-items: center; }
.tool-top h1 { color: #fff; font-size: clamp(1.65rem, 3.4vw, 2.55rem); line-height: 1.12; margin: 0; text-wrap: balance; }
.tool-desc { color: rgba(255, 255, 255, .78); font-size: 1.04rem; line-height: 1.55; margin: 14px 0 0; max-width: 42ch; text-wrap: pretty; }
.tool-fig { margin: 0; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 9; max-width: 100%; background: #f3ecdd; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .65); }
.tool-fig img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tool-fig--m { display: none; }

/* Chat: título › pergunta › respostas */
.tool-wrap { max-width: 792px; margin: -76px auto 0; padding: 0 16px; position: relative; }
.ct { background: #fff; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 34px 70px -30px rgba(8, 20, 40, .55), 0 2px 8px rgba(8, 20, 40, .08); }
.ct::before { content: ""; height: 5px; flex: none; background: linear-gradient(90deg, var(--gold-600), var(--gold) 40%, #e6cb85); }
.ct-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 18px 18px 28px; border-bottom: 1px solid var(--line-soft); }
.ct-title { flex: 1; min-width: 0; }
.ct-title h2 { font-family: var(--serif); font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.2; color: var(--navy-900); margin: 0; text-wrap: balance; }
.ct-status { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; font-size: .84rem; font-weight: 600; color: var(--gold-600); }
.ct-status[hidden] { display: none; }
.ct-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ct-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.ct-icon:hover { background: var(--cream); color: var(--navy-900); }
.ct-icon[hidden] { display: none; }
.ct-icon svg { width: 18px; height: 18px; }

/* Respostas já dadas e conversa com o suporte */
.ct-log { background: #faf8f4; border-bottom: 1px solid var(--line-soft); padding: 12px 28px; max-height: 156px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scroll-behavior: smooth; }
.ct-log[hidden] { display: none; }
.ct.is-chat .ct-log { max-height: min(400px, 52vh); padding-block: 18px; border-bottom: 0; }
.ct.is-chat.is-ask .ct-log { max-height: 250px; border-bottom: 1px solid var(--line-soft); }
.ct-h { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.ct-h-q { flex: 1; min-width: 0; margin: 0; font-size: .82rem; color: var(--muted); }
.ct-h-a { flex: none; margin: 0; max-width: 62%; background: var(--navy-900); color: #fff; font-size: .86rem; font-weight: 500; padding: 6px 12px; border-radius: 12px 12px 4px 12px; overflow-wrap: anywhere; }
.ct-log .sc-msg { max-width: 86%; font-size: .92rem; }
.ct-log .sc-msg.is-support { border-color: #ece7dc; }
.ct-log .sc-msg time { display: none; }

/* Pergunta da vez */
.ct-now { padding: 24px 28px 26px; }
.ct-now[hidden] { display: none; }
.ct-now.is-in { animation: ctIn .22s ease-out; }
@keyframes ctIn { from { opacity: .3; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .ct-now.is-in { animation: none; } .ct-log { scroll-behavior: auto; } }
.ct-q { margin: 0; font: 700 1.3rem/1.3 var(--sans); color: var(--navy-900); text-wrap: balance; }
.ct-hint { margin: 4px 0 18px; font-size: .86rem; color: var(--muted); }
/* "Verificando o valor…": do envio até alguém do suporte responder */
.ct-wait { display: flex; align-items: center; gap: 18px; }
.ct-wait .ct-hint { margin-bottom: 0; }
.ct-spin { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--gold-100); border-top-color: var(--gold); animation: ctSpin .9s linear infinite; }
@keyframes ctSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ct-spin { animation-duration: 2.4s; } }

/* Botões de resposta */
.ct-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.ct-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 15px 14px 15px 18px; cursor: pointer; font: inherit; color: var(--navy-900); box-shadow: 0 1px 2px rgba(8, 20, 40, .06); transition: border-color .12s, background .12s, transform .12s, box-shadow .12s; }
.ct-opt strong { display: block; font-size: 1rem; font-weight: 700; }
.ct-opt small { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.ct-opt svg { flex: none; width: 18px; height: 18px; color: var(--gold-600); }
.ct-opt:hover, .ct-opt:focus-visible { border-color: var(--gold); background: var(--gold-100); transform: translateY(-1px); box-shadow: 0 10px 20px -14px rgba(176, 138, 53, .9); outline: none; }
.ct-opt.is-main { background: var(--gold); border-color: var(--gold); }
.ct-opt.is-main small, .ct-opt.is-main svg { color: var(--navy-900); }
.ct-opt.is-main:hover { background: #d6b25f; }
.ct-opts.is-uf { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 7px; }
.ct-opts.is-uf .ct-opt { justify-content: center; padding: 11px 0; border-radius: 10px; font-size: .9rem; }
.ct-opts.is-sug { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 12px; }
.ct-opts.is-sug .ct-opt { padding: 11px 12px 11px 14px; }
.ct-opts.is-sug .ct-opt strong { font-size: .94rem; }

/* Resposta digitada */
.ct-field { display: flex; gap: 8px; }
.ct .ct-field input, .ct .ct-grid input, .ct .ct-compose input { flex: 1; min-width: 0; width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: .8em 1em; font: 500 1rem var(--sans); background: #fff; }
.ct .ct-field input:focus, .ct .ct-grid input:focus, .ct .ct-compose input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-100); }
.ct-go { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--gold); color: var(--navy-950); font: 700 .98rem var(--sans); cursor: pointer; }
.ct-go:hover { background: #d6b25f; color: var(--navy-950); }
.ct-go:disabled { opacity: .65; cursor: wait; }
a.ct-go { text-decoration: none; }
.ct-go svg { width: 18px; height: 18px; }
.ct-go.is-big { width: 100%; min-height: 54px; font-size: 1.02rem; }
.ct-link { background: none; border: 0; padding: 4px 0; color: var(--muted); font: 500 .86rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ct-link:hover { color: var(--navy-900); }
.ct-alt { margin-top: 10px; }
.ct-back { display: inline-flex; align-items: center; gap: 4px; margin-top: 16px; text-decoration: none; }
.ct-back svg { width: 16px; height: 16px; }
.ct-ferr { color: var(--danger); font-size: .82rem; margin: 8px 0 0; }
.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.ct-grid label { display: block; font: 600 .8rem var(--sans); color: var(--muted); }
.ct-grid label.is-wide { grid-column: 1 / -1; }
.ct-grid input { margin-top: 5px; }
.ct-form .ct-ferr { margin: -6px 0 12px; }

/* Resumo, orçamento e boleto */
.ct-sum { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 18px; margin: 0 0 18px; font-size: .92rem; }
.ct-sum dt { color: var(--muted); }
.ct-sum dd { margin: 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.ct-terms { font-size: .78rem; color: var(--muted); text-align: center; margin: 10px 0 0; }
.ct-card { background: #fff; border: 1px solid #ece7dc; border-radius: 14px; padding: 14px 16px; align-self: flex-start; width: min(100%, 440px); font-size: .9rem; }
.ct-card h4 { margin: 0 0 10px; font: 700 .94rem var(--sans); color: var(--navy-900); }
.ct-card .ct-sum { font-size: .84rem; gap: 4px 14px; margin: 0; }
.ct-lines { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.ct-lines td { padding: 5px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.ct-lines td:first-child { color: var(--muted); padding-right: 10px; }
.ct-lines td:last-child { text-align: right; }
.ct-lines tr.is-total td { border-bottom: 0; font-weight: 700; font-size: 1rem; color: var(--navy-900); padding-top: 8px; }
.ct-card .ct-note { font-size: .78rem; color: var(--muted); margin: 0 0 10px; }
.ct-card .ct-note:last-child { margin-bottom: 0; }
.ct-card-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.ct-card-btns .ct-go { min-height: 42px; padding: 0 16px; font-size: .9rem; }
.ct-card-btns .ct-go.is-ghost { background: #fff; border: 1.5px solid var(--line); color: var(--navy-900); }
.ct-code { display: block; font: 600 .78rem ui-monospace, Consolas, monospace; background: var(--cream); border-radius: 8px; padding: 8px; margin: 0 0 10px; overflow-wrap: anywhere; }

/* Campo de mensagem: só depois que o pedido vai para o suporte */
.ct-compose { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line-soft); background: #fff; }
.ct-compose[hidden] { display: none; }
/* Orçamento ainda sem resposta, enquanto a pessoa tira uma dúvida: volta para "Quer seguir?" */
.ct-decide { display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-top: 1px solid var(--line-soft); background: var(--gold-100); color: var(--navy-900); font: 700 .9rem var(--sans); padding: 11px 16px; cursor: pointer; }
.ct-decide[hidden] { display: none; }
.ct-decide .icon { width: 16px; height: 16px; }
.ct-log .sc-att-file { margin-bottom: 6px; }
.ct .ct-compose input { border-radius: 999px; padding: .7em 1.1em; }
.ct-send { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--gold); color: var(--navy-950); display: grid; place-items: center; cursor: pointer; }
.ct-send:hover { background: #d6b25f; }
.ct-send svg, .ct-send .icon { width: 20px; height: 20px; }
.ct-attach { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.ct-attach svg, .ct-attach .icon { width: 20px; height: 20px; }

.tool-note { text-align: center; font-size: .78rem; color: var(--muted); margin: 12px 0 0; }

/* Conteúdo do assunto: compacto, em perguntas que abrem */
.tool-info { max-width: 760px; margin: 44px auto 0; padding: 0 16px; }
.tool-info-title { font: 700 1.25rem var(--serif); color: var(--navy-900); text-align: center; margin: 0 0 12px; }
/* Sumário (atalhos para as seções no Google), em linha */
.tool-info .toc { margin: 0 0 16px; padding: 0; background: none; border: 0; text-align: center; }
.tool-info .toc strong { display: none; }
.tool-info .toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.tool-info .toc li { margin: 0; }
.tool-info .toc a { display: inline-block; font-size: .8rem; padding: 5px 11px; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--navy-900); text-decoration: none; }
.tool-info .toc a:hover { border-color: var(--gold); background: var(--gold-100); }
.tool-info details { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; }
.tool-info summary { list-style: none; cursor: pointer; padding: 14px 44px 14px 16px; position: relative; }
.tool-info summary::-webkit-details-marker { display: none; }
.tool-info summary h2 { font: 600 .98rem var(--sans); color: var(--navy-900); margin: 0; scroll-margin-top: 16px; }
.tool-info summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--gold-600); }
.tool-info details[open] summary::after { content: "–"; }
.tool-info .ti-body { padding: 0 16px 14px; font-size: .92rem; color: var(--ink); }
.tool-info .ti-body > :first-child { margin-top: 0; }
.tool-info .ti-body > :last-child { margin-bottom: 0; }
.tool-links { text-align: center; font-size: .84rem; color: var(--muted); margin: 18px 0 0; }

@media (max-width: 900px) {
  .tool-top { padding: 28px 16px 96px; text-align: center; }
  .tool-top-in { grid-template-columns: minmax(0, 1fr); }
  .tool-desc { margin-inline: auto; }
  .tool-top .tool-fig { display: none; }
  .tool-fig--m { display: block; margin: 0 0 22px; box-shadow: 0 16px 36px -24px rgba(8, 20, 40, .5); }
  .tool-wrap { margin-top: -70px; }
}
@media (max-width: 640px) {
  .tool-top { padding: 22px 16px 88px; }
  .tool-top h1 { font-size: 1.55rem; }
  .tool-desc { font-size: .93rem; margin-top: 8px; }
  .tool-wrap { margin-top: -64px; }
  .ct { border-radius: 18px; }
  .ct-head { padding: 16px 10px 14px 18px; }
  .ct-title h2 { font-size: 1.2rem; }
  .ct-log { padding: 12px 18px; }
  .ct-now { padding: 18px 18px 20px; }
  .ct-q { font-size: 1.12rem; }
  .ct-hint { margin-bottom: 14px; }
  .ct-opts { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .ct-opt { padding: 12px 12px 12px 16px; }
  .ct-opts.is-uf { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
  .ct-opts.is-sug { grid-template-columns: minmax(0, 1fr); }
  .ct-go { padding: 0 14px; }
  .ct-grid { grid-template-columns: minmax(0, 1fr); }
  .ct-compose { padding: 10px 12px; }
  .tool-info { margin-top: 32px; }
}
