/* Portal de associados APEE VN Anha. Tema escuro por omissão; claro por escolha; impressão em claro. */
@font-face { font-family: "Baloo 2"; src: url(fonts/baloo2-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Baloo 2"; src: url(fonts/baloo2-800.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(fonts/nunito-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(fonts/nunito-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* marca (iguais nos dois temas) */
  --marinho: #13336B;
  --marinho-fundo: #0E2752;
  --lapis: #F5C518;
  --verde: #6CB33F;
  --azul: #1F8FD6;
  --rosa: #E24A93;
  --ok: #2E9B4F;
  --nok: #C9302C;

  --titulo: "Baloo 2", "Trebuchet MS", sans-serif;
  --texto: "Nunito", "Segoe UI", system-ui, sans-serif;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;

  /* tema escuro (omissão) */
  --fundo: #000;
  --superficie: #0D1A33;
  --linha: #24375E;
  --tinta: #EEF2FA;
  --tinta-suave: #A3B0CA;
  --titulo-cor: #FFFFFF;
  --ligacao: #8FCBF3;
  --talao: var(--lapis);
  --talao-tinta: #1D2A44;
  --talao-picotado: #000;
  --chip: #0D1A33;
  --chip-ativo: var(--lapis);
  --chip-ativo-tinta: #1D2A44;
  color-scheme: dark;
}
:root[data-theme="claro"] {
  --fundo: #FFF;
  --superficie: #FFF;
  --linha: #D3DDEC;
  --tinta: #1D2A44;
  --tinta-suave: #56627C;
  --titulo-cor: var(--marinho);
  --ligacao: var(--marinho);
  --talao: #FDF1C4;
  --talao-tinta: #1D2A44;
  --talao-picotado: #D9AE16;
  --chip: #FFF;
  --chip-ativo: var(--marinho);
  --chip-ativo-tinta: #FFF;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: 1.0625rem;
  line-height: 1.55;
}
a { color: var(--ligacao); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--lapis); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.aviso-maquete {
  background: var(--lapis); color: #1D2A44; text-align: center;
  font-size: .875rem; line-height: 1.4; padding: .4rem var(--s4);
}

/* ---------- topo ---------- */
.topo { position: relative; border-bottom: 1px solid var(--linha); }
.topo::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(to right, var(--verde) 0 25%, var(--azul) 25% 50%, var(--lapis) 50% 75%, var(--rosa) 75% 100%);
}
.topo-dentro {
  max-width: 68rem; margin: 0 auto; padding: var(--s3) var(--s4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
}
.marca { display: flex; align-items: center; gap: var(--s3); min-width: 0; color: var(--titulo-cor); text-decoration: none; }
.marca img { width: 2.75rem; height: auto; flex: none; background: #FFF; border-radius: 10px; padding: 2px; }
.marca span { font-family: var(--titulo); font-weight: 700; font-size: 1.0625rem; line-height: 1.1; }
.marca small { display: block; font-family: var(--texto); font-weight: 400; font-size: .8125rem; color: var(--tinta-suave); }
.acoes-topo { display: flex; gap: var(--s2); flex: none; }
.botao-tema {
  font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer;
  background: none; color: var(--tinta); border: 1.5px solid var(--linha); border-radius: 999px;
  padding: .3rem .8rem;
}
.botao-tema:hover { border-color: var(--tinta-suave); }

main { max-width: 68rem; margin: 0 auto; padding: var(--s6) var(--s4) var(--s7); }

/* ---------- cartão de associado ---------- */
.zona-cartao { display: grid; gap: var(--s5); align-items: end; margin-bottom: var(--s7); }
@media (min-width: 52rem) { .zona-cartao { grid-template-columns: 26rem 1fr; gap: var(--s7); } }

.cartao {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: var(--s3);
  width: 100%; max-width: 26rem; aspect-ratio: 1.586;
  padding: var(--s4) var(--s4) var(--s4) var(--s5);
  background: var(--marinho); color: #FFF; border: 0; border-radius: 16px; text-align: left;
  font: inherit; cursor: zoom-in; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 24px 40px -24px rgba(31,143,214,.55);
}
.cartao::after {                 /* faixa amarela de lápis */
  content: ""; position: absolute; right: -3.25rem; top: 0; bottom: 0; width: 9rem;
  background: var(--lapis); transform: skewX(-12deg);
}
.cartao-texto { position: relative; z-index: 1; display: flex; flex-direction: column; min-width: 0; }
.cartao-assoc { font-size: .8125rem; line-height: 1.25; color: #CFD9EE; max-width: 12rem; }
.cartao-nome {
  margin-top: auto; font-family: var(--titulo); font-weight: 800;
  font-size: clamp(1.25rem, 5.4vw, 1.625rem); line-height: 1.05; overflow-wrap: anywhere;
}
.cartao-dados { margin-top: var(--s2); font-size: .875rem; line-height: 1.35; color: #DCE4F4; }
.cartao-dados b { color: #FFF; }
.cartao-qr {
  position: relative; z-index: 1; align-self: center;
  width: clamp(6.25rem, 27vw, 7.5rem); aspect-ratio: 1; padding: 6px;
  background: #FFF; border-radius: 10px;
}
.cartao-qr svg { display: block; width: 100%; height: 100%; }

.cartao-lado h1 {
  font-family: var(--titulo); font-weight: 800; color: var(--titulo-cor);
  font-size: clamp(1.875rem, 6vw, 2.75rem); line-height: 1.02; margin: 0 0 var(--s3);
}
.cartao-lado p { margin: 0 0 var(--s2); color: var(--tinta-suave); max-width: 34rem; }
.cartao-lado .dica { font-size: .9375rem; }

/* QR em ecrã inteiro, para o parceiro ler */
.qr-grande {
  position: fixed; inset: 0; z-index: 20; border: 0; padding: var(--s5); margin: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  background: #FFF; color: #1D2A44;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s4); text-align: center;
}
.qr-grande:not([open]) { display: none; }
.qr-grande .qr { width: min(78vw, 22rem); aspect-ratio: 1; }
.qr-grande .qr svg { width: 100%; height: 100%; }
.qr-grande .quem { font-family: var(--titulo); font-weight: 800; font-size: 1.5rem; line-height: 1.1; margin: 0; }
.qr-grande p { margin: 0; color: #56627C; }
.qr-grande button {
  font: inherit; font-weight: 700; cursor: pointer; margin-top: var(--s2);
  background: var(--marinho); color: #FFF; border: 0; border-radius: 10px; padding: .7rem 1.4rem;
}

/* ---------- parcerias ---------- */
.cabecalho-parcerias { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); margin-bottom: var(--s4); }
.cabecalho-parcerias h2 { font-family: var(--titulo); font-weight: 800; color: var(--titulo-cor); font-size: clamp(1.625rem, 4.5vw, 2.25rem); line-height: 1.05; margin: 0; }
.contagem { margin: 0; font-size: .9375rem; color: var(--tinta-suave); }

.filtros { display: grid; gap: var(--s3); margin-bottom: var(--s5); }
@media (min-width: 52rem) { .filtros { grid-template-columns: 22rem 1fr; align-items: center; } }
.procura input {
  width: 100%; font: inherit; color: var(--tinta);
  padding: .7rem 1rem .7rem 2.6rem; border: 1.5px solid var(--linha); border-radius: 12px;
  background: var(--superficie) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%238A97B2' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='m13 13 5 5'/%3E%3C/svg%3E") no-repeat .85rem center;
}
.procura input::placeholder { color: var(--tinta-suave); }
.procura input:focus { outline: none; border-color: var(--lapis); }
.categorias { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.categorias button {
  font: inherit; font-size: .9375rem; cursor: pointer;
  background: var(--chip); color: var(--tinta); border: 1.5px solid var(--linha); border-radius: 999px; padding: .3rem .85rem;
}
.categorias button[aria-pressed="true"] { background: var(--chip-ativo); border-color: var(--chip-ativo); color: var(--chip-ativo-tinta); font-weight: 700; }
.categorias .conta { opacity: .7; margin-left: .3rem; }

.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s5); }
@media (min-width: 60rem) { .lista { grid-template-columns: 1fr 1fr; } }

/* vale: corpo + talão destacável */
.vale {
  --talao-l: 11rem; --corte: 14px;
  display: grid; grid-template-columns: 1fr var(--talao-l);
  background: var(--superficie); border: 1px solid var(--linha); border-radius: 14px; overflow: hidden;
  -webkit-mask:
    radial-gradient(circle var(--corte) at calc(100% - var(--talao-l)) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--corte) at calc(100% - var(--talao-l)) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
          mask:
    radial-gradient(circle var(--corte) at calc(100% - var(--talao-l)) 0, transparent 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--corte) at calc(100% - var(--talao-l)) 100%, transparent 98%, #000) bottom / 100% 51% no-repeat;
}
.vale-corpo { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.vale-cabeca { display: flex; gap: var(--s3); align-items: center; }
.vale-logo {
  flex: none; width: 3.5rem; height: 3.5rem; border-radius: 12px; overflow: hidden;
  background: #FFF; display: grid; place-items: center;
  font-family: var(--titulo); font-weight: 800; font-size: 1.25rem; color: var(--marinho);
}
.vale-logo img { width: 100%; height: 100%; object-fit: contain; }
.vale h3 { font-family: var(--titulo); font-weight: 700; color: var(--titulo-cor); font-size: 1.3125rem; line-height: 1.12; margin: 0; }
.vale .onde { margin: 0; font-size: .9375rem; color: var(--tinta-suave); }
.vale .beneficio { margin: 0; }
.vale-acoes { margin-top: auto; padding-top: var(--s2); display: flex; flex-wrap: wrap; gap: var(--s2); }
.vale-acoes a, .vale-acoes button {
  font: inherit; font-size: .9375rem; font-weight: 700; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--tinta); background: none; border: 1.5px solid var(--linha); border-radius: 999px; padding: .3rem .85rem;
  overflow-wrap: anywhere;
}
.vale-acoes a:hover, .vale-acoes button:hover { border-color: var(--tinta-suave); }
.vale-acoes svg { width: 1rem; height: 1rem; flex: none; }
.vale-validade { margin: 0; font-size: .875rem; color: var(--tinta-suave); }

.talao {
  background: var(--talao); color: var(--talao-tinta);
  border-left: 2px dashed var(--talao-picotado);
  padding: var(--s5) var(--s4); display: flex; flex-direction: column; gap: var(--s2); min-width: 0;
}
.talao .resumo { font-family: var(--titulo); font-weight: 800; font-size: 1.875rem; line-height: 1; overflow-wrap: break-word; hyphens: auto; }
.talao .resumo.longo { font-size: 1.4375rem; }
.talao .como-titulo { font-weight: 700; font-size: .875rem; margin: var(--s2) 0 0; }
.talao .como { margin: 0; font-size: .9375rem; line-height: 1.4; }

@media (max-width: 36rem) {
  .vale { grid-template-columns: 1fr; -webkit-mask: none; mask: none; }
  .talao { border-left: 0; border-bottom: 2px dashed var(--talao-picotado); order: -1; }
  .talao .resumo, .talao .resumo.longo { font-size: 1.75rem; }
}

.vazio { border: 1.5px dashed var(--linha); border-radius: 14px; padding: var(--s5); max-width: 34rem; }
.vazio p { margin: 0 0 var(--s3); }
.botao-sec {
  font: inherit; font-weight: 700; cursor: pointer;
  background: none; color: var(--tinta); border: 1.5px solid var(--tinta-suave); border-radius: 10px; padding: .45rem 1rem;
}

footer { border-top: 1px solid var(--linha); }
footer div { max-width: 68rem; margin: 0 auto; padding: var(--s5) var(--s4); font-size: .9375rem; color: var(--tinta-suave); }
footer p { margin: 0 0 var(--s2); max-width: 46rem; }
footer a { overflow-wrap: anywhere; }
.botao-sair { font: inherit; font-size: .9375rem; background: none; border: 0; padding: 0; color: var(--ligacao); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- ecrã sem link ---------- */
.sem-link { min-height: 80vh; min-height: 80dvh; display: grid; place-items: center; padding: var(--s6) var(--s4); }
.sem-link-bloco { width: min(100%, 28rem); }
.sem-link img { width: 7rem; height: auto; background: #FFF; border-radius: 18px; padding: 6px; margin-bottom: var(--s5); }
.sem-link h1 { font-family: var(--titulo); font-weight: 800; color: var(--titulo-cor); font-size: clamp(1.875rem, 7vw, 2.5rem); line-height: 1.05; margin: 0 0 var(--s3); }
.sem-link p { margin: 0 0 var(--s3); color: var(--tinta-suave); }

/* ---------- verificação (v.html) ---------- */
.verif { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.verif-estado {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: var(--s3);
  padding: var(--s6) var(--s5); color: #FFF;
}
.verif-estado.valido { background: var(--ok); }
.verif-estado.invalido { background: var(--nok); }
.verif-estado.indisponivel, .verif-estado.a-verificar { background: #2B3550; }
.verif-estado .grande { font-family: var(--titulo); font-weight: 800; font-size: clamp(3rem, 16vw, 6rem); line-height: .95; margin: 0; }
.verif-estado .quem { font-family: var(--titulo); font-weight: 700; font-size: clamp(1.5rem, 6vw, 2.25rem); line-height: 1.1; margin: 0; }
.verif-estado p { margin: 0; font-size: 1.125rem; max-width: 30rem; }
.verif-estado .hora { font-size: .9375rem; opacity: .85; }
.verif-rodape { padding: var(--s4) var(--s5); background: #000; color: #A3B0CA; font-size: .875rem; display: flex; align-items: center; gap: var(--s3); }
.verif-rodape img { width: 2.25rem; background: #FFF; border-radius: 8px; padding: 2px; }

@media (prefers-reduced-motion: no-preference) {
  .cartao.entra { animation: entra .6s cubic-bezier(.2,.8,.2,1) both; }
  @keyframes entra { from { transform: translateY(10px) rotate(-1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
}

@media print {
  :root, :root[data-theme] {
    --fundo: #FFF; --superficie: #FFF; --linha: #C9D3E3; --tinta: #1D2A44; --tinta-suave: #56627C;
    --titulo-cor: #13336B; --ligacao: #13336B; --talao: #FDF1C4; --talao-picotado: #D9AE16;
    --chip: #FFF; --chip-ativo: #13336B; --chip-ativo-tinta: #FFF; color-scheme: light;
  }
  .acoes-topo, .filtros, .aviso-maquete, footer .botao-sair { display: none !important; }
  .vale { break-inside: avoid; }
  .cartao { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .talao { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
