/* Banner e preferências de cookies (templates/_cookie_consent.html). Cores do tema ativo
   (--brand-*: navy/ciano no site, verde no portal), cartão no padrão dos toasts (.pye-toast). */

.pye-cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1085;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 22px;
  border-radius: 12px;
  border: 1px solid rgba(13, 33, 66, 0.08);
  background: #fff;
  box-shadow: 0 10px 30px rgba(13, 33, 66, 0.16), 0 2px 8px rgba(13, 33, 66, 0.06);
  font-family: "Nunito", sans-serif;
  color: var(--brand-dark, #221638);
  animation: pye-cookie-in 0.35s ease-out both;
}
.pye-cookie-banner[hidden],
.pye-cookie-dialog__when[hidden] { display: none; }
@keyframes pye-cookie-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pye-cookie-banner { animation: none; }
}
.pye-cookie-banner__text { flex: 1 1 420px; min-width: 0; }
.pye-cookie-banner__text p { margin: 0; font-size: 14.5px; line-height: 1.55; color: inherit; }
.pye-cookie-banner__text .pye-cookie-banner__title { font-size: 16px; font-weight: 800; margin-bottom: 4px; }
.pye-cookie-banner a,
.pye-cookie-dialog a { color: var(--brand-blue, var(--brand-accent, #2cdb61)); text-decoration: underline; }
.pye-cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 1 auto;
}

/* Recusar e Aceitar têm o mesmo peso visual: recusar não pode ser mais difícil que aceitar. */
.pye-cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  background-color: var(--brand-blue, var(--brand-accent, #2cdb61));
  background-image: var(--brand-gradient, none);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: filter 0.15s ease, background-color 0.15s ease;
}
.pye-cookie-btn:hover { filter: brightness(0.94); }
.pye-cookie-btn:focus-visible,
.pye-cookie-dialog__close:focus-visible,
.pye-cookie-switch:focus-visible {
  outline: 3px solid var(--brand-accent-soft, #25c557);
  outline-offset: 2px;
}
.pye-cookie-btn--outline {
  background: #fff;
  color: var(--brand-dark, #221638);
  box-shadow: inset 0 0 0 2px var(--brand-blue, var(--brand-accent, #2cdb61));
}
.pye-cookie-btn--link {
  background: transparent;
  color: var(--brand-dark, #221638);
  text-decoration: underline;
  padding-left: 8px;
  padding-right: 8px;
}
.pye-cookie-btn--outline:hover,
.pye-cookie-btn--link:hover { filter: none; background-color: rgba(13, 33, 66, 0.05); }

.pye-cookie-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(13, 33, 66, 0.25);
  color: var(--brand-dark, #221638);
  font-family: "Nunito", sans-serif;
}
.pye-cookie-dialog::backdrop { background: rgba(7, 16, 24, 0.55); }
.pye-cookie-dialog form { padding: 24px 26px 22px; }
.pye-cookie-dialog__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pye-cookie-dialog h2 { margin: 0; font-size: 21px; font-weight: 800; color: inherit; }
.pye-cookie-dialog__close {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.pye-cookie-dialog__close:hover { background: rgba(13, 33, 66, 0.06); }
.pye-cookie-dialog p { color: inherit; }
.pye-cookie-dialog__intro { margin: 10px 0 14px; font-size: 14.5px; line-height: 1.55; }

.pye-cookie-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid rgba(13, 33, 66, 0.1);
}
.pye-cookie-option__text { flex: 1 1 auto; margin: 0; cursor: pointer; }
.pye-cookie-option__text p { margin: 0; font-size: 14px; line-height: 1.5; }
.pye-cookie-option__name { display: block; margin: 0 0 2px; font-size: 16px; font-weight: 800; }
.pye-cookie-option__text .pye-cookie-option__name { font-size: 16px; }
.pye-cookie-option__desc { display: block; font-size: 14px; line-height: 1.5; font-weight: 400; }
.pye-cookie-option__always {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(13, 33, 66, 0.07);
  font-size: 12px;
  font-weight: 700;
  vertical-align: 2px;
}

/* Interruptor (checkbox nativo, acessível pelo teclado e leitores de tela) */
.pye-cookie-switch {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 46px;
  height: 26px;
  margin: 2px 0 0;
  border-radius: 999px;
  background: #c5cfda;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.pye-cookie-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.pye-cookie-switch:checked { background: var(--brand-blue, var(--brand-accent, #2cdb61)); }
.pye-cookie-switch:checked::after { transform: translateX(20px); }
.pye-cookie-switch:disabled { opacity: 0.55; cursor: not-allowed; }

.pye-cookie-dialog__when { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid rgba(13, 33, 66, 0.1); font-size: 13px; opacity: 0.85; }
.pye-cookie-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 575px) {
  .pye-cookie-banner { left: 8px; right: 8px; bottom: 8px; padding: 16px; }
  .pye-cookie-banner__actions { width: 100%; justify-content: stretch; }
  .pye-cookie-banner__actions .pye-cookie-btn:not(.pye-cookie-btn--link) { flex: 1 1 40%; }
  .pye-cookie-banner__actions .pye-cookie-btn--link { order: 3; flex: 1 1 100%; min-height: 36px; }
  .pye-cookie-dialog form { padding: 20px 18px 18px; }
  .pye-cookie-dialog__actions .pye-cookie-btn { flex: 1 1 100%; }
}

/* Impressão: o banner não entra no papel. */
@media print {
  .pye-cookie-banner,
  .pye-cookie-dialog { display: none !important; }
}
