/* ==========================================================================
   SAAE Sorocaba — Atendimento Virtual
   CSS reconstruído a partir do style.css original do portal (GSAN):
   - Mesmos fundos, sprites, cores e medidas de referência (container 950px)
   - Limpeza: keyframes duplicados e !important redundantes removidos
   - Acréscimos: layout responsivo, foco visível e acessibilidade
   Imagens em ./imagens (cópias locais dos arquivos originais do portal)
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: url(imagens/body.gif) repeat-x 0 0;
  color: #2f2f2f;
  font: 12px/1.6em Verdana, Geneva, sans-serif;
}

a { cursor: pointer; outline: none; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid #008fd6; outline-offset: 2px;
}
li { list-style: none; }
img { border: none; }
fieldset { border: none; }

.oculto {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Estrutura ---------------------------------------------------- */
#container {
  background: url(imagens/content.png) repeat-y 0 0;
  background-size: 100% auto;
  margin: 35px auto 0;
  padding: 0 5px;
  width: 950px;
  max-width: 100%;
  display: flow-root;
}

#top {
  background: url(imagens/border-top.png) repeat-x 0 0;
  border-bottom: 1px dashed #dedede;
  min-height: 168px;
  display: flex;
  align-items: flex-start;
}
#top a { display: block; width: 100%; }
#top img { display: block; width: 100%; height: auto; margin-top: 18px; }

/* ---------- Conteúdo ----------------------------------------------------- */
#content { position: relative; margin-bottom: 20px; padding-bottom: 10px; }

#text-top {
  background: url(imagens/img-text-top.png) no-repeat 0 0;
  min-height: 64px;
  margin: 35px 40px;
  padding: 4px 0 0 128px;
  text-align: justify;
}

.boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 33px;
  padding: 0 33px;
  align-items: start;
}

.box {
  background-color: #f7fbfc;
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% auto;
  border-radius: 6px;
  padding: 268px 18px 18px 36px;
  min-height: 460px;
  /* Largura original dos cartões: evita que o fundo (424px) estique
     e o texto sobreponha a arte quando a tela é menor que 950px */
  width: 100%;
  max-width: 424px;
  justify-self: center;
}
#info-index    { background-image: url(imagens/link-info4.jpg); }
#servicos-index { background-image: url(imagens/link-servicos8.jpg); }

.text-box {
  color: #2f2f2f;
  display: block;
  text-align: justify;
  max-width: 330px;
  margin-bottom: 14px;
}
.box-link .text-box:hover { color: #008fd6; }

/* ---------- Formulários --------------------------------------------------- */
.titulo1 {
  font-size: 17px; font-weight: bold; color: #008fd6;
  padding: 6px 0 12px;
}
.instrucao { width: 330px; max-width: 100%; margin-bottom: 10px; }

.campo-linha {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; margin-top: 6px;
}
.campo-label {
  font: 12px/1.6em Verdana, Geneva, sans-serif;
  font-weight: bold; color: #737373; text-transform: uppercase;
}
.campo-input {
  width: 110px; padding: 8px 12px; border-radius: 6px;
  font: 700 12px/1.6em Verdana, Geneva, sans-serif; font-size: 14px;
  color: #008fd6;
  background: linear-gradient(to bottom, #ffffff, #f8fcff);
  border: 1px solid #b6d7f1;
  box-shadow: 0 0 6px rgba(0, 136, 255, 0.2);
  outline: none;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.campo-input:focus { border-color: #008fd6; box-shadow: 0 0 8px rgba(0, 143, 214, .45); }
.campo-input.invalido { border-color: #c0392b; box-shadow: 0 0 8px rgba(192, 57, 43, .35); }
input[type="text"] { text-transform: uppercase; }
input::placeholder { color: #777; text-transform: none; font-weight: normal; }

.campo-botao {
  background: linear-gradient(to bottom, #4caf50 0%, #2d682f 100%);
  border: 1px solid #1e5d21; border-radius: 6px;
  color: #fff; font: bold 14px Arial, sans-serif;
  padding: 7px 16px; cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.6), 0 2px 4px rgba(0,0,0,.3);
  text-shadow: 0 -1px 1px rgba(0,0,0,.5);
  transition: background 0.2s ease, transform 0.1s ease;
}
.campo-botao:hover { background: linear-gradient(to bottom, #57bd5b 0%, #357a38 100%); }
.campo-botao:active { transform: translateY(1px); }

.retorno { min-height: 1.6em; margin-top: 8px; font-weight: bold; max-width: 350px; }
.retorno.erro { color: #c0392b; }
.retorno.ok   { color: #2d682f; }
.campo-botao:disabled { opacity: .6; cursor: wait; transform: none; }

/* Resultado da consulta à API */
.resultado {
  margin-top: 10px; max-width: 356px;
  background: rgba(255,255,255,.75);
  border: 1px solid #b6d7f1; border-radius: 8px;
  padding: 12px 14px;
}
.resultado-total { font-weight: bold; color: #005f9e; margin-bottom: 8px; }
.faturas-lista li {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px dashed #cfdff0;
}
.faturas-lista li:first-child { border-top: none; }
.fatura-info { flex: 1; min-width: 130px; }
.fatura-comp { font-weight: bold; color: #2f2f2f; }
.fatura-valor { color: #005f9e; font-weight: bold; }
.etiqueta-atual {
  background: #008fd6; color: #fff; font-size: 9px; font-weight: bold;
  border-radius: 8px; padding: 2px 7px; text-transform: uppercase; letter-spacing: .4px;
}
.botao-pdf {
  background: linear-gradient(to bottom, #4caf50 0%, #2d682f 100%);
  border: 1px solid #1e5d21; border-radius: 6px; color: #fff !important;
  font: bold 11px Arial, sans-serif; padding: 6px 10px; white-space: nowrap;
  box-shadow: inset 0 1px 2px rgba(255,255,255,.6), 0 2px 4px rgba(0,0,0,.25);
  text-shadow: 0 -1px 1px rgba(0,0,0,.5);
}
.botao-pdf:hover { background: linear-gradient(to bottom, #57bd5b 0%, #357a38 100%); }

/* ---------- Rodapé ---------------------------------------------------------- */
#footer {
  background: url(imagens/footer.png) repeat-x 0 0;
  background-size: auto 100%;
  border-top: 1px solid #003d98;
  min-height: 200px; margin-top: 50px;
  padding: 20px 26px;
  display: flow-root;
}
#footer h4 {
  background: url(imagens/canais-atendimento.png) no-repeat 0 0;
  float: left; height: 58px; width: 159px;
  margin: 85px 15px 0 0; text-indent: -9000px; overflow: hidden;
}
#footer ul { float: right; margin-top: 29px; }
#footer ul li { float: left; margin-right: 45px; }
#footer ul li:last-child { margin-right: 0; }
#footer ul li a {
  background: url(imagens/links-canais-atendimento.png) no-repeat;
  float: left; height: 115px; width: 120px;
  text-indent: -9000px; overflow: hidden; border-radius: 8px;
}
#footer ul li#link-1 a { background-position: 0 0; }
#footer ul li#link-2 a { background-position: -157px 0; }
#footer ul li#link-3 a { background-position: -313px 0; }
#footer ul li#link-1 a:hover { background-position: 0 -120px; }
#footer ul li#link-2 a:hover { background-position: -157px -120px; }
#footer ul li#link-3 a:hover { background-position: -313px -120px; }
#footer address {
  color: #fff; float: right; clear: right;
  font-size: 11px; font-style: normal; text-align: right;
  margin: 30px 19px 0 0; width: 550px; max-width: 100%;
}

/* Aviso de múltiplas abas (overlay do original) */
#maisDeUmaAba {
  width: 100%; height: 100%; top: 0; left: 0; position: fixed;
  opacity: 0.95; background-color: #fff; z-index: 99; text-align: center;
}
#maisDeUmaAba[hidden] { display: none; }
#maisDeUmaAbaTexto { height: 10em; position: relative; top: 40%; }
#maisDeUmaAbaTexto p { font-size: 16px; font-weight: bold; color: #c0392b; }

/* ---------- Webchat ------------------------------------------------------------ */
.widget-container {
  bottom: 0; display: flex; flex-direction: column;
  margin: 0 20px 20px 0; position: fixed; right: 0; width: auto;
  z-index: 99999; align-items: flex-end; justify-content: flex-end;
}
.launcher {
  animation: slide-in 0.5s forwards;
  display: flex; align-items: center; justify-content: center;
  background-color: #fff; border: 0; border-radius: 50%;
  height: 60px; width: 60px; margin-top: 10px; padding: 0;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  position: relative;
}
.launcher:focus { outline: none; }
.launcher:focus-visible { outline: 2px solid #008fd6; outline-offset: 3px; }
.launcher img { width: 100%; max-height: 100%; object-fit: contain; border-radius: 45px; }
.chat-icone { font-size: 28px; }
.open-launcher { animation: rotation-rl 0.5s forwards; display: flex; }
.open-launcher__container { display: flex; align-items: center; justify-content: center; }

.launcher .tooltip-body {
  background-color: #fff; border-radius: 8px; color: #3f3f3f; font-weight: 400;
  position: absolute; right: 78px; bottom: 12px;
  box-shadow: 1px 0 13px 3px rgba(0,0,0,.15);
  min-width: 200px; font-size: 13px; padding: 9px 6px 10px; line-height: 1.4em;
  font-family: Verdana, Geneva, sans-serif;
  animation: slideUp 0.3s ease-in-out; transition: all 0.2s ease-in-out;
}
.launcher .tooltip-body:hover { background-color: #fafafa; transform: translateY(-2px); cursor: pointer; }
.tooltip-decoration {
  position: absolute; right: -3px; bottom: 12px; transform: rotate(45deg);
  background: #fff; height: 10px; width: 10px; transition: all 0.2s ease-in-out;
}
.launcher:hover .tooltip-body, .launcher.chat-aberto .tooltip-body { display: none; }

.chat-painel {
  width: 320px; max-width: calc(100vw - 40px); height: 420px; max-height: 60vh;
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 34px rgba(0,0,0,.28); display: flex; flex-direction: column;
  animation: slideUp 0.25s ease-in-out;
}
.chat-painel[hidden] { display: none; }
.chat-topo {
  background: #3850b7; color: #fff; font-weight: bold; font-size: 14px;
  padding: 14px 16px; display: flex; flex-direction: column;
}
.chat-topo span { font-weight: normal; font-size: 11px; opacity: .85; }
.chat-corpo { flex: 1; overflow-y: auto; padding: 14px; background: #f4f7fb; }
.chat-msg {
  background: #fff; border: 1px solid #dde7f2; border-radius: 10px;
  padding: 9px 12px; margin-bottom: 9px; max-width: 88%; font-size: 12px;
}
.chat-msg.usuario { background: #dceeff; margin-left: auto; }
.chat-entrada { display: flex; border-top: 1px solid #e2e2e2; }
.chat-entrada input { flex: 1; border: 0; padding: 12px; font-size: 13px; text-transform: none; }
.chat-entrada button {
  background: #3850b7; color: #fff; border: 0; padding: 0 16px;
  font-weight: bold; cursor: pointer;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #999; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

@keyframes slide-in { 0% { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp  { 0% { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rotation-rl { 0% { transform: rotate(90deg); } to { transform: rotate(0); } }

/* ---------- Responsivo (o original era fixo em 950px) ------------------------- */
@media screen and (max-width: 980px) {
  #container { margin-top: 0; }
  #top { min-height: 0; }
  .boxes { grid-template-columns: 1fr; gap: 24px; padding: 0 20px; }
  .box { min-height: 0; }
  #text-top { margin: 25px 20px; }
  #footer h4 { float: none; margin: 10px auto; }
  #footer ul { float: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 10px; }
  #footer ul li { float: none; margin-right: 0; }
  #footer address { float: none; text-align: center; margin: 20px auto 0; }
}
@media screen and (max-width: 800px) {
  .launcher { margin: 0; }
}
@media screen and (max-width: 520px) {
  #text-top { background-size: 80px auto; padding-left: 94px; }
  .box { padding-left: 16px; padding-right: 16px; }
  .campo-input { width: 150px; }
  .launcher .tooltip-body { display: none; }
}
.faturas-lista li .botao-pdf { margin-left: 6px; }
