/* TPVLINE Portugal — identidade: branco, preto, vermelho do logótipo, Arial negrito */

:root {
  --preto: #000;
  --branco: #fff;
  --vermelho: #e40010;
  --cinza-texto: #4a4a4a;
  --cinza-linha: #d9d9d9;
  --cinza-fundo: #f4f4f4;
  --erro: #b3000c;
  --ok: #0a6b2d;
  --raio: 16px;
  --sombra: 0 8px 32px rgba(0, 0, 0, .18);
  --fonte: Arial, Helvetica, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--branco);
  color: var(--preto);
  font-family: var(--fonte);
  font-size: 1rem;
  line-height: 1.5;
}

img { max-width: 100%; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--vermelho); }

:focus-visible { outline: 3px solid var(--vermelho); outline-offset: 2px; }

.saltar {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--preto);
  color: var(--branco);
  font-weight: bold;
}
.saltar:focus { top: 16px; }

/* ---------- Botões ---------- */

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border: 2px solid var(--preto);
  border-radius: 999px;
  background: var(--preto);
  color: var(--branco);
  font: bold 1rem/1.2 var(--fonte);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.botao:hover { background: var(--vermelho); border-color: var(--vermelho); color: var(--branco); }
.botao:disabled { opacity: .6; cursor: progress; }
.botao-largo { width: 100%; }

.link-botao {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-botao:hover { color: var(--vermelho); }

/* ---------- Página inicial ---------- */

.inicio {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 32px;
  font-weight: bold;
  text-align: center;
}

.logo {
  display: block;
  width: 80%;
  max-width: 400px;
  height: auto;
  max-height: 20vh;
  margin: 40px auto 20px;
  object-fit: contain;
}

.slider {
  flex: 1 1 0;
  width: 100%;
  min-height: 240px;
  overflow: hidden;
}
.track {
  display: flex;
  width: max-content;
  height: 100%;
  cursor: grab;
  touch-action: pan-y;
  will-change: transform;
}
.track:active { cursor: grabbing; }
.track img {
  display: block;
  width: auto;
  max-width: none;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

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

.botao-cta { min-width: 220px; margin-top: 24px; font-size: 1.125rem; }

.contactos-rapidos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 32px;
  margin: 24px 16px 0;
  padding: 0;
  list-style: none;
}
.contactos-rapidos small { display: block; font-weight: normal; color: var(--cinza-texto); font-size: .8125rem; }

.aviso {
  max-width: 560px;
  margin: 24px 16px 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: normal;
}
.aviso-ok { background: #e7f5ec; color: var(--ok); }
.aviso-erro { background: #fdecee; color: var(--erro); }

/* ---------- Páginas legais ---------- */

.topo {
  display: flex;
  justify-content: center;
  padding: 24px 16px 8px;
}
.topo-logo img { display: block; width: 72px; height: 72px; }

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}
.legal h1 {
  margin: 16px 0 4px;
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  line-height: 1.2;
}
.legal .atualizado { margin: 0 0 32px; color: var(--cinza-texto); font-size: .875rem; }
.legal h2 {
  margin: 40px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--cinza-linha);
  font-size: 1.25rem;
  line-height: 1.3;
}
.legal h3 { margin: 24px 0 8px; font-size: 1.0625rem; }
.legal p, .legal li { max-width: 72ch; }
.legal ul, .legal ol { padding-left: 1.25rem; }
.legal li + li { margin-top: 6px; }
.legal address { font-style: normal; }

.indice {
  margin: 0 0 8px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--cinza-fundo);
}
.indice ol { margin: 0; }

.tabela-envolvente {
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--cinza-linha);
  border-radius: 12px;
}
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--cinza-linha); }
th { background: var(--cinza-fundo); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

.legal .botao { margin: 8px 0; }

/* ---------- Rodapé ---------- */

.rodape {
  border-top: 4px solid var(--vermelho);
  background: var(--preto);
  color: #e6e6e6;
  font-size: .875rem;
}
.rodape-grelha {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 16px 32px;
}
.rodape h2 {
  margin: 0 0 12px;
  color: var(--branco);
  font-size: .8125rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.rodape p { margin: 0; }
.rodape strong { color: var(--branco); }
.rodape a, .rodape .link-botao { color: var(--branco); }
.rodape a:hover, .rodape .link-botao:hover { color: #ff6b74; }
.rodape small { color: #bdbdbd; }
.lista-simples { margin: 0; padding: 0; list-style: none; }
.lista-simples li + li { margin-top: 8px; }
.livro-reclamacoes { display: inline-block; margin-bottom: 12px; }
.livro-reclamacoes img { display: block; width: 176px; height: auto; }
.rodape-ral { color: #cfcfcf; }
.rodape-base {
  max-width: 1200px;
  margin: 0 auto !important;
  padding: 16px;
  border-top: 1px solid #333;
  color: #bdbdbd;
}

/* ---------- Banner de cookies ---------- */

.tpvp-banner {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  border-top: 4px solid var(--vermelho);
  background: var(--branco);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .15);
}
.tpvp-banner[hidden] { display: none; }
.tpvp-banner-interior {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px;
}
.tpvp-texto { flex: 1 1 420px; margin: 0; font-size: .9375rem; }
.tpvp-acoes { display: flex; flex-wrap: wrap; gap: 12px; }
.tpvp-acoes .botao { flex: 1 1 0; white-space: nowrap; }

/* ---------- Botão WhatsApp ---------- */

.whatsapp-btn {
  position: fixed;
  /* Sobe acima do banner de cookies enquanto este estiver visível */
  bottom: calc(1.25rem + var(--tpvp-banner-altura, 0px));
  left: 1.25rem;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .22));
  transition: transform .2s ease, filter .2s ease;
  animation: whatsapp-entrada .4s cubic-bezier(.25, 1, .5, 1) both;
}
.whatsapp-btn:hover,
.whatsapp-btn:focus-visible {
  transform: scale(1.08);
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .3));
}
.whatsapp-btn-icone {
  display: block;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
}
.whatsapp-btn-etiqueta {
  display: inline-block;
  padding: .35rem .9rem;
  border-radius: 10px;
  background-color: #25d366;
  color: var(--branco);
  font: bold .9375rem/1.5 var(--fonte);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.whatsapp-btn:hover .whatsapp-btn-etiqueta,
.whatsapp-btn:focus-visible .whatsapp-btn-etiqueta {
  opacity: 1;
  transform: translateX(0);
}
@keyframes whatsapp-entrada {
  from { opacity: 0; transform: translateY(12px) scale(.9); }
  to { opacity: 1; transform: none; }
}

/* ---------- Modais (cookies e contacto) ---------- */

.modal {
  width: min(600px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: var(--raio);
  background: var(--branco);
  color: var(--preto);
  box-shadow: var(--sombra);
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(0, 0, 0, .6); }

.modal-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--cinza-linha);
}
.modal-topo h2 { margin: 0; font-size: 1.25rem; }
.modal-fechar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--preto);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}
.modal-fechar:hover { background: var(--cinza-fundo); }
.modal-corpo { padding: 16px 24px 24px; overflow-y: auto; }
.modal-corpo > p:first-child { margin-top: 0; }
.modal-acoes {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--cinza-linha);
}
.modal-acoes .botao { padding-left: 16px; padding-right: 16px; }
#tpvp-modal { width: min(680px, calc(100% - 32px)); }

.tpvp-categorias { margin: 16px 0 0; padding: 0; list-style: none; }
.tpvp-categoria { padding: 14px 0; border-top: 1px solid var(--cinza-linha); }
.tpvp-categoria p { margin: 6px 0 0; font-size: .9375rem; color: var(--cinza-texto); }
.tpvp-categoria .tpvp-em-uso { font-size: .8125rem; }
.tpvp-categoria-topo { display: flex; align-items: center; gap: 12px; }
.tpvp-categoria-topo label { flex: 1; font-weight: bold; cursor: pointer; }
.tpvp-sempre { color: var(--cinza-texto); font-size: .8125rem; }

.interruptor {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  margin: 0;
  border-radius: 14px;
  background: #767676;
  cursor: pointer;
  transition: background-color .15s ease;
}
.interruptor::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--branco);
  transition: transform .15s ease;
}
.interruptor:checked { background: var(--preto); }
.interruptor:checked::after { transform: translateX(20px); }
.interruptor:disabled { cursor: not-allowed; opacity: .45; }

/* ---------- Formulário ---------- */

.formulario-intro { color: var(--cinza-texto); font-size: .9375rem; }
.campo { margin-bottom: 14px; }
.campo label { display: block; margin-bottom: 4px; font-weight: bold; font-size: .9375rem; }
.opcional { font-weight: normal; color: var(--cinza-texto); }
.campo input, .campo textarea {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #8a8a8a;
  border-radius: 8px;
  background: var(--branco);
  color: var(--preto);
  font: 1rem/1.4 var(--fonte);
}
.campo textarea { min-height: 120px; resize: vertical; }
.campo input:focus-visible, .campo textarea:focus-visible { outline: 2px solid var(--preto); outline-offset: 1px; border-color: var(--preto); }
.campo [aria-invalid="true"] { border-color: var(--erro); }
.campo-erro { margin: 4px 0 0; color: var(--erro); font-size: .875rem; }
.campo-erro:empty { display: none; }
.campo-duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.campo-check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 16px; font-size: .9375rem; }
.campo-check input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--preto); }
.formulario-estado { margin: 0 0 12px; color: var(--erro); font-size: .9375rem; }
.formulario-estado:empty { display: none; }
.formulario-legal { margin: 12px 0 0; color: var(--cinza-texto); font-size: .8125rem; text-align: center; }
.formulario-sucesso { text-align: center; }
.formulario-sucesso:focus { outline: none; }
.sucesso-titulo { margin: 8px 0; font-size: 1.25rem; font-weight: bold; }

/* ---------- Ecrãs pequenos ---------- */

@media (max-width: 600px) {
  /* Tabelas legais em formato de cartão */
  .tabela-envolvente table, .tabela-envolvente tbody, .tabela-envolvente tr, .tabela-envolvente td { display: block; }
  .tabela-envolvente thead { display: none; }
  .tabela-envolvente tr { padding: 12px 14px; border-bottom: 1px solid var(--cinza-linha); }
  .tabela-envolvente tr:last-child { border-bottom: 0; }
  .tabela-envolvente td { padding: 4px 0; border: 0; }
  .tabela-envolvente td::before { content: attr(data-label); display: block; font-weight: bold; font-size: .8125rem; color: var(--cinza-texto); }
  .tabela-envolvente td code { white-space: normal; }

  .campo-duplo { grid-template-columns: 1fr; }
  .tpvp-acoes { flex-direction: column; width: 100%; }
  .tpvp-acoes .botao { width: 100%; }
  .modal-topo, .modal-corpo, .modal-acoes { padding-left: 16px; padding-right: 16px; }
  .contactos-rapidos { flex-direction: column; }
}

@media (max-width: 768px) {
  .whatsapp-btn { bottom: calc(1rem + var(--tpvp-banner-altura, 0px)); left: 1rem; }
  /* Espaço para o botão não tapar o copyright no fim da página */
  .rodape-base { padding-bottom: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; }
  .whatsapp-btn { animation: none; }
}

@media print {
  .whatsapp-btn, .tpvp-banner { display: none !important; }
}
