/* Componentes reutilizáveis: cabeçalho, cartões, pílulas, campos, botões, ajuda "?", gráficos, anúncios. */

/* ---------- Cabeçalho e rodapé ---------- */
.topo { position: sticky; top: 0; z-index: 50; background: rgba(244, 245, 247, 0.88); backdrop-filter: blur(12px); border-bottom: 1px solid var(--linha); }
.topo .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.marca-icone { width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--azul-vivo), var(--ciano)); display: grid; place-items: center; color: #fff; box-shadow: 0 4px 10px rgba(18, 164, 255, 0.35); }
.menu { display: none; gap: 4px; }
.menu a { padding: 8px 14px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.menu a:hover, .menu a[aria-current='page'] { background: #fff; color: var(--ink); box-shadow: var(--sombra); }
.menu-botao { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--linha); background: #fff; cursor: pointer; }
.menu-aberto .menu { display: flex; flex-direction: column; position: absolute; top: 60px; left: 12px; right: 12px; background: #fff; padding: 10px; border-radius: var(--raio-m); box-shadow: var(--sombra-forte); }
@media (min-width: 860px) {
  .menu { display: flex; }
  .menu-botao { display: none; }
}

.rodape { background: #fff; border-top: 1px solid var(--linha); padding-block: 40px 28px; margin-top: 24px; font-size: 0.92rem; color: var(--muted); }
.rodape-grade { display: grid; gap: 28px; }
@media (min-width: 560px) {
  .rodape-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rodape-marca { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .rodape-grade { grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr)); }
  .rodape-marca { grid-column: auto; }
}
.rodape-marca p { margin-top: 12px; max-width: 26rem; }
.rodape h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink); margin-bottom: 10px; }
.rodape ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.rodape a { color: var(--muted); }
.rodape a:hover { color: var(--azul); }
.rodape-afiliados { margin: 24px 0 0; font-size: 0.85rem; }
.rodape-afiliados a { text-decoration: underline; }
.rodape-fim { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--linha); font-size: 0.85rem; }

/* ---------- Pílula, cartão, botão ---------- */
.pilula {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 18px; border-radius: 999px;
  background: #fff; border: 1px solid var(--linha); box-shadow: var(--sombra);
  font-size: 0.88rem; font-weight: 500; color: var(--muted);
}
.pilula--laranja { background: #fff4e0; border-color: #ffe0ad; color: var(--laranja-texto); box-shadow: none; }
.pilula--azul { background: #e7f4ff; border-color: #bfe3ff; color: #0a508f; box-shadow: none; }
.pilula--verde { background: #e6f6ec; border-color: #bfe6cd; color: #0b6b3a; box-shadow: none; }

.cartao { background: var(--card); border-radius: var(--raio-g); box-shadow: var(--sombra); padding: 22px; border: 1px solid rgba(232, 235, 240, 0.7); }
@media (min-width: 720px) { .cartao { padding: 28px; } }
.cartao-titulo { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.cartao-titulo h3 { font-size: 1.05rem; }

.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px;
  border-radius: 999px; border: 0; background: var(--azul); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.botao:hover { background: #0859b3; color: #fff; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(10, 108, 217, 0.3); }
.botao--claro { background: #fff; color: var(--ink); border: 1px solid var(--linha); box-shadow: var(--sombra); }
.botao--claro:hover { background: #fff; color: var(--azul); box-shadow: var(--sombra-forte); }
.botao--whats { background: #0f7d41; }
.botao--whats:hover { background: #0b6636; }
.botao--pequeno { min-height: 40px; padding: 8px 16px; font-size: 0.92rem; }

/* ---------- Formulário ---------- */
.campo { display: grid; gap: 6px; }
.campo + .campo, .campo-grade + .campo, .campo + .campo-grade { margin-top: 16px; }
.campo-grade { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.campo-grade > .campo { margin-top: 0; }
.campo label, .campo .rotulo { font-size: 0.92rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.campo .opcional { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.entrada {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--linha);
  background: #fbfbfc; font-size: 1.05rem; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.entrada:hover { border-color: #cfd6df; }
.entrada:focus { outline: none; border-color: var(--azul-vivo); background: #fff; box-shadow: 0 0 0 4px rgba(18, 164, 255, 0.18); }
.entrada[aria-invalid='true'] { border-color: var(--vermelho); }
.entrada-moeda { position: relative; }
.entrada-moeda span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.entrada-moeda .entrada { padding-left: 46px; font-size: 1.25rem; font-weight: 600; }
.dica { font-size: 0.85rem; color: var(--muted); }
.erro { font-size: 0.85rem; color: var(--vermelho); font-weight: 500; }

.contador-campo { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 6px; align-items: center; }
.contador-campo button { min-height: 50px; padding: 0; border-radius: 14px; border: 1.5px solid var(--linha); background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
.contador-campo button:hover { border-color: var(--azul-vivo); color: var(--azul); }
.contador-campo .entrada { text-align: center; font-weight: 600; min-width: 0; padding-inline: 4px; -moz-appearance: textfield; appearance: textfield; }
.contador-campo .entrada::-webkit-inner-spin-button, .contador-campo .entrada::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.interruptor { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; border-radius: 16px; background: #fbfbfc; border: 1.5px solid var(--linha); cursor: pointer; }
.interruptor + .interruptor { margin-top: 10px; }
.interruptor:has(input:checked) { background: #eef8ff; border-color: #a9dcff; }
.interruptor input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruptor .trilho { flex: none; width: 46px; height: 28px; border-radius: 999px; background: #cdd3dc; position: relative; transition: background 0.2s; margin-top: 2px; }
.interruptor .trilho::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.interruptor input:checked + .trilho { background: var(--azul); }
.interruptor input:checked + .trilho::after { transform: translateX(18px); }
.interruptor input:focus-visible + .trilho { outline: 3px solid var(--azul-vivo); outline-offset: 2px; }
.interruptor strong { display: block; font-size: 0.95rem; }
.interruptor small { color: var(--muted); font-size: 0.83rem; }

details.avancado { margin-top: 16px; border-top: 1px dashed var(--linha); padding-top: 14px; }
details.avancado summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; color: var(--azul); list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px; }
details.avancado summary::-webkit-details-marker { display: none; }
details.avancado summary::before { content: '+'; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e7f4ff; font-weight: 700; }
details.avancado[open] summary::before { content: '−'; }
details.avancado .campo { margin-top: 14px; }

/* ---------- Ajuda "?" ---------- */
.ajuda { position: relative; display: inline-flex; vertical-align: middle; }
.ajuda-botao {
  width: 24px; height: 24px; border-radius: 50%; border: 0; background: #e7f4ff; color: #0a508f; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; display: inline-grid; place-items: center; padding: 0; line-height: 1;
}
.ajuda-botao::after { content: ''; position: absolute; inset: -11px; } /* área de toque ≥ 44px */
.ajuda-botao:hover, .ajuda-botao[aria-expanded='true'] { background: var(--azul); color: #fff; }
.ajuda-balao {
  position: absolute; z-index: 40; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); width: min(280px, 78vw);
  background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 14px; font-size: 0.86rem; font-weight: 400; line-height: 1.45;
  box-shadow: var(--sombra-forte); text-align: left; letter-spacing: 0; text-transform: none;
}
.ajuda-balao[hidden] { display: none; }
.ajuda-balao::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--ink); }
.ajuda-balao.desloca-esq { left: 0; transform: none; }
.ajuda-balao.desloca-esq::after { left: 14px; }
.ajuda-balao.desloca-dir { left: auto; right: 0; transform: none; }
.ajuda-balao.desloca-dir::after { left: auto; right: 14px; }

/* ---------- Etiquetas pequenas ---------- */
.etiquetas { display: flex; flex-wrap: wrap; gap: 6px; }
.etiqueta { font-size: 0.78rem; padding: 3px 10px; border-radius: 999px; background: #fff0d6; color: #7a3d00; }
.etiqueta--estadual { background: #fff6bf; color: #5c4700; }
.etiqueta--municipal { background: #f1e9ff; color: #3f2a78; }
.etiqueta--facultativo { background: #fff; color: #7a3d00; border: 1px dashed #e0a85a; }

/* ---------- Bloco destaque (degradê azul) ---------- */
.destaque {
  border-radius: var(--raio-g); padding: 14px; background: linear-gradient(180deg, #22b3ff 0%, #5fd0ff 55%, #b9ecff 100%);
  box-shadow: 0 20px 50px rgba(18, 164, 255, 0.25);
}
@media (min-width: 720px) { .destaque { padding: 22px; } }
.destaque-miolo { background: #fff; border-radius: 22px; padding: 22px; box-shadow: 0 10px 30px rgba(10, 80, 143, 0.12); }
@media (min-width: 720px) { .destaque-miolo { padding: 28px; } }

.numero-grande { font-size: clamp(2.4rem, 9vw, 3.6rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.rotulo-pequeno { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }

/* ---------- Contador (dias para as férias) ---------- */
.contagem { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #fff8e1, #ffefc2); border: 1px solid #ffe08a; border-radius: var(--raio-m); padding: 18px 20px; }
.contagem .numero-grande { color: var(--laranja-texto); font-size: clamp(2.6rem, 11vw, 3.8rem); }
.contagem p { font-weight: 600; line-height: 1.25; }
.contagem small { display: block; font-weight: 400; color: #6b4a00; }

/* ---------- Gráfico de anel ---------- */
.anel-bloco { display: grid; gap: 20px; align-items: center; justify-items: center; }
@media (min-width: 560px) { .anel-bloco { grid-template-columns: 220px 1fr; justify-items: stretch; } }
.anel { width: 200px; height: 200px; position: relative; margin-inline: auto; }
.anel svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anel circle { fill: none; stroke-width: 22; transition: stroke-dasharray 0.6s ease; }
.anel-centro { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.anel-centro strong { font-size: 1.5rem; letter-spacing: -0.03em; }
.anel-centro span { font-size: 0.78rem; color: var(--muted); }
.legenda { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; width: 100%; }
.legenda li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.95rem; }
.legenda .ponto { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-right: 8px; display: inline-block; }
.legenda .nome { display: inline-flex; align-items: center; }
.legenda b { font-variant-numeric: tabular-nums; }

/* ---------- Tabela de valores ---------- */
.linhas { list-style: none; margin: 0; padding: 0; }
.linhas li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha); font-size: 0.97rem; }
.linhas li:last-child { border-bottom: 0; }
.linhas .rotulo-linha { display: inline-flex; align-items: center; gap: 8px; }
.linhas .valor { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.linhas .negativo .valor { color: var(--vermelho); }
.linhas .total { font-size: 1.1rem; padding-top: 16px; }
.linhas .total .valor { color: var(--azul); font-size: 1.25rem; }
.linhas .secundario { color: var(--muted); font-size: 0.88rem; }

/* ---------- Barras comparativas ---------- */
.comparador { display: grid; gap: 16px; }
.barra-item { display: grid; gap: 6px; }
.barra-topo { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; font-weight: 500; }
.barra-topo b { font-variant-numeric: tabular-nums; }
.barra-trilho { height: 40px; background: #eef1f5; border-radius: 14px; overflow: hidden; }
.barra-preenche { height: 100%; width: var(--v, 0%); border-radius: 14px; background: linear-gradient(90deg, var(--ciano), var(--azul-vivo)); transition: width 0.6s ease; min-width: 6px; }
.barra-item.vencedor .barra-preenche { background: linear-gradient(90deg, var(--amarelo), var(--laranja)); }
.veredito { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #f4f8fc; font-size: 0.92rem; color: #1d3b57; }

/* ---------- Prazos ---------- */
.prazos { display: grid; gap: 12px; }
@media (min-width: 560px) { .prazos { grid-template-columns: repeat(3, 1fr); } .prazos--duas { grid-template-columns: repeat(2, 1fr); } }
.prazo { background: #f7f9fc; border-radius: var(--raio-m); padding: 16px; }
.prazo .data { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.prazo small { color: var(--muted); display: block; }

/* ---------- Avisos ---------- */
.aviso { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; font-size: 0.92rem; align-items: flex-start; }
.aviso--info { background: #eaf6ff; color: #0a3d6b; border: 1px solid #bfe3ff; }
.aviso--alerta { background: #fff4e0; color: #7a3d00; border: 1px solid #ffe0ad; }
.aviso--erro { background: #fdecec; color: #7a1c1c; border: 1px solid #f6c5c5; }
.aviso svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.avisos-pilha { display: grid; gap: 10px; }
.avisos-pilha:empty { display: none; }

/* ---------- Escala art. 130 ---------- */
.escala { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .escala { grid-template-columns: repeat(5, 1fr); } }
.escala div { background: #f7f9fc; border-radius: 14px; padding: 12px 8px; text-align: center; font-size: 0.8rem; color: var(--muted); border: 2px solid transparent; }
.escala b { display: block; font-size: 1.25rem; color: var(--ink); letter-spacing: -0.02em; }
.escala .atual { background: #fff4e0; border-color: var(--laranja); }
.escala .atual b { color: var(--laranja-texto); }

/* ---------- Anúncios (AdSense) ---------- */
.anuncio { margin-block: 28px; min-height: 280px; display: grid; place-items: center; text-align: center; border: 1.5px dashed #cfd6df; border-radius: var(--raio-m); color: #626b79; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(255, 255, 255, 0.5); }
@media (min-width: 720px) { .anuncio { min-height: 120px; } }

/* ---------- Acordeão FAQ ---------- */
.faq details { background: #fff; border-radius: var(--raio-m); padding: 4px 20px; box-shadow: var(--sombra); }
.faq details + details { margin-top: 10px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 16px 0; min-height: 48px; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.4rem; color: var(--azul); }
.faq details[open] summary::after { content: '−'; }
.faq details p { padding-bottom: 16px; color: var(--muted); }

/* ---------- Cartões de guias (início, planejador, índice e "Leia também") ---------- */
.cartoes-guias { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cartoes-guias > li { margin: 0; }
.cartao-guia {
  display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 20px; border-radius: var(--raio-m);
  background: #fff; border: 1px solid var(--linha); box-shadow: var(--sombra); text-decoration: none; color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cartao-guia:hover { transform: translateY(-2px); box-shadow: var(--sombra-forte); color: var(--ink); }
.cartao-guia strong { font-size: 1.08rem; letter-spacing: -0.01em; line-height: 1.25; }
.cartao-guia span { color: var(--muted); font-size: 0.93rem; line-height: 1.5; }
.cartao-guia em { margin-top: auto; padding-top: 6px; font-style: normal; font-weight: 600; font-size: 0.9rem; color: var(--azul); }
.guias-bloco h2 { margin-top: 14px; }

/* ---------- Foto do destino (Wikimedia Commons; js/ui/fotos.js) ---------- */
.foto { position: relative; margin: -18px -18px 4px; aspect-ratio: 330 / 190; overflow: hidden; display: grid; place-items: center; border-radius: calc(var(--raio-m) - 1px) calc(var(--raio-m) - 1px) 0 0; color: rgba(255, 255, 255, 0.85); background: linear-gradient(135deg, hsl(var(--h) 52% 40%), hsl(calc(var(--h) + 40) 58% 28%)); }
.foto svg { width: 44px; height: 44px; }
.foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto--ok svg { display: none; }
.foto-credito { position: absolute; right: 0; bottom: 0; max-width: 100%; padding: 0 8px; border-top-left-radius: 10px; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 0.72rem; line-height: 24px; }
.foto-credito a { color: #fff; text-decoration: underline; display: inline-block; min-height: 24px; }

.nota-pequena { font-size: 0.8rem; color: var(--muted); }
.nota-pequena a { color: var(--muted); }
