/* PYPAG · banner de consentimento de cookies (componente único, sem build)
   --------------------------------------------------------------------------
   Carregue no <head>:
     <link rel="stylesheet" href="/assets/consent.css?v=20261022a">

   O componente usa as variáveis de tema que já existem no site
   (--card, --dark/--ink, --mut, --border/--line, --blue, --yellow) com valores
   de reserva, para funcionar em qualquer página — claro ou escuro.
   -------------------------------------------------------------------------- */

.pypag-consent {
  /* tema (com reserva para páginas que não definem a variável) */
  --pc-bg: var(--card, #fff);
  --pc-fg: var(--dark, var(--ink, #14212e));
  --pc-mut: var(--mut, #5b6b7a);
  --pc-line: var(--border, var(--line, #e3e7e6));
  --pc-blue: var(--blue, #3776ab);
  --pc-yellow: var(--yellow, #ffd43b);

  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 9999;
  width: min(680px, calc(100vw - 32px));
  padding: 20px 24px;
  border-radius: 16px;
  border: 1.5px solid var(--pc-line);
  background: var(--pc-bg);
  color: var(--pc-fg);
  box-shadow: 0 20px 60px rgba(20, 33, 46, .18);
  font-family: inherit;
  line-height: 1.5;
  text-align: left;
  animation: pypag-consent-in .35s cubic-bezier(.22, 1, .36, 1);
}

.pypag-consent[hidden] { display: none !important; }

@media (prefers-color-scheme: dark) {
  .pypag-consent {
    --pc-bg: var(--card, #17242f);
    --pc-fg: var(--dark, var(--ink, #eef2f4));
    --pc-mut: var(--mut, #9fb0be);
    --pc-line: var(--border, var(--line, #243441));
  }
}

@keyframes pypag-consent-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- texto ---------- */
.pc-topo { display: flex; align-items: flex-start; gap: 14px; }
.pc-icone { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--pc-blue); }
.pc-icone svg { display: block; width: 22px; height: 22px; }
.pc-textos { min-width: 0; flex: 1; }
.pc-titulo { display: block; font-size: .9rem; font-weight: 700; color: var(--pc-fg); margin-bottom: 4px; }
.pc-desc { margin: 0; font-size: .8rem; line-height: 1.55; color: var(--pc-mut); }
.pc-link { color: var(--pc-blue); font-weight: 600; text-underline-offset: 2px; }
.pc-link:hover { text-decoration: underline; }

/* ---------- botões ---------- */
.pc-botoes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pc-btn {
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 20px;
  border-radius: 8px;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  border: 1.5px solid var(--pc-line);
  background: var(--pc-bg);
  color: var(--pc-fg);
  transition: transform .2s, box-shadow .2s, border-color .2s, color .2s;
}
.pc-btn:hover { border-color: var(--pc-blue); color: var(--pc-blue); }
.pc-btn:focus-visible,
.pc-switch input:focus-visible + .pc-switch-trilho { outline: 3px solid var(--pc-yellow); outline-offset: 2px; }
.pc-btn-primario { background: var(--pc-yellow); border-color: var(--pc-yellow); color: #14212e; }
.pc-btn-primario:hover { color: #14212e; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 212, 59, .4); }
.pc-btn-texto { border-color: transparent; background: transparent; color: var(--pc-blue); padding-left: 8px; padding-right: 8px; text-decoration: underline; text-underline-offset: 3px; }
.pc-btn-texto:hover { color: var(--pc-blue); }

/* ---------- painel de preferências ---------- */
.pc-painel { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--pc-line); }
.pc-painel[hidden] { display: none !important; }
.pc-painel-titulo { margin: 0 0 12px; font-size: .82rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--pc-mut); }
.pc-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pc-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.pc-item-texto { min-width: 0; }
.pc-item-label { display: block; font-size: .86rem; font-weight: 700; color: var(--pc-fg); cursor: pointer; }
.pc-item-desc { display: block; margin-top: 2px; font-size: .78rem; line-height: 1.5; color: var(--pc-mut); }

/* ---------- switch ---------- */
.pc-switch { position: relative; display: inline-flex; align-items: center; flex: none; cursor: pointer; }
.pc-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.pc-switch-trilho {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 99px;
  background: var(--pc-line);
  position: relative;
  transition: background .25s;
}
.pc-switch-trilho::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
  transition: transform .25s;
}
.pc-switch input:checked + .pc-switch-trilho { background: var(--pc-blue); }
.pc-switch input:checked + .pc-switch-trilho::before { transform: translateX(20px); }
.pc-switch input:disabled + .pc-switch-trilho { opacity: .55; cursor: not-allowed; }
.pc-switch input:disabled ~ .pc-switch-estado { color: var(--pc-mut); font-size: .72rem; }
.pc-switch-estado { margin-left: 8px; font-size: .72rem; font-weight: 700; color: var(--pc-mut); }

/* ---------- rodapé do painel ---------- */
.pc-painel-botoes { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---------- responsivo ---------- */
@media (max-width: 560px) {
  .pypag-consent { bottom: 12px; padding: 16px; }
  .pc-botoes { flex-direction: column; align-items: stretch; }
  .pc-btn { width: 100%; text-align: center; }
  .pc-btn-texto { width: auto; align-self: center; }
  .pc-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pc-painel-botoes { flex-direction: column; }
}

/* ---------- movimento reduzido ---------- */
@media (prefers-reduced-motion: reduce) {
  .pypag-consent { animation: none; }
  .pc-btn,
  .pc-switch-trilho,
  .pc-switch-trilho::before { transition: none; }
}

/* ---------- impressão ---------- */
@media print {
  .pypag-consent { display: none !important; }
}
