/*
 * Kit de consentimento LGPD — visual.
 * Cada LP define só os tokens --jc-* (cores e fontes dela); o resto é igual em todas.
 */
:where(:root) {
  --jc-bg: #121214;
  --jc-fg: #f2efe8;
  --jc-muted: #b4ada2;
  --jc-line: rgba(255, 255, 255, 0.14);
  --jc-accent: #c4a574;
  --jc-accent-ink: #0b0b0c;
  --jc-font-title: Georgia, serif;
  --jc-font-body: system-ui, -apple-system, sans-serif;
  --jc-radius: 4px;
}

.jc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2147483000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.jc-banner[hidden] { display: none; }
.jc-banner.jc-open { opacity: 1; transform: none; }

.jc-card {
  pointer-events: auto;
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--jc-bg);
  color: var(--jc-fg);
  border: 1px solid var(--jc-line);
  border-top: 3px solid var(--jc-accent);
  border-radius: var(--jc-radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  padding: 22px 24px 20px;
  font-family: var(--jc-font-body);
  font-size: 15px;
  line-height: 1.55;
  text-align: left;
}

.jc-title {
  margin: 0 0 6px;
  font-family: var(--jc-font-title);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--jc-fg);
  text-transform: none;
}

.jc-desc { margin: 0; color: var(--jc-muted); }
.jc-card a,
.jc-legal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.jc-desc a { color: var(--jc-fg); }

.jc-prefs { margin-top: 16px; border-top: 1px solid var(--jc-line); }
.jc-prefs[hidden] { display: none; }
.jc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--jc-line);
  cursor: pointer;
}
.jc-row:first-child { cursor: default; }
.jc-banner .jc-row { line-height: 1.45; margin: 0; font-weight: 400; }
.jc-row strong { display: block; color: var(--jc-fg); font-weight: 600; }
.jc-row span { display: block; color: var(--jc-muted); font-size: 14px; }
.jc-always { flex: none; font-size: 13px !important; color: var(--jc-accent) !important; font-weight: 600; }

.jc-switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 44px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: var(--jc-line);
  border: 1px solid var(--jc-line);
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}
.jc-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--jc-fg);
  transition: transform 0.2s ease;
}
.jc-switch:checked { background: var(--jc-accent); border-color: var(--jc-accent); }
.jc-switch:checked::after { transform: translateX(20px); background: var(--jc-accent-ink); }

.jc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.jc-actions [hidden] { display: none; }

/* Seletores com prefixo para vencer o CSS de botões dos temas (ex.: Hello Elementor pinta todo [type=button]). */
.jc-banner .jc-btn {
  font-family: var(--jc-font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
  min-height: 44px;
  margin: 0;
  padding: 11px 20px;
  border-radius: var(--jc-radius);
  border: 1px solid transparent;
  box-shadow: none;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
}
.jc-banner .jc-btn-primary,
.jc-banner .jc-btn-primary:hover,
.jc-banner .jc-btn-primary:focus { background: var(--jc-accent); color: var(--jc-accent-ink); border-color: var(--jc-accent); }
/* Rejeitar tem o mesmo peso visual de Aceitar (recomendação da ANPD). */
.jc-banner .jc-btn-outline,
.jc-banner .jc-btn-outline:hover,
.jc-banner .jc-btn-outline:focus { background: transparent; color: var(--jc-fg); border-color: var(--jc-fg); }
.jc-banner .jc-btn-ghost,
.jc-banner .jc-btn-ghost:hover,
.jc-banner .jc-btn-ghost:focus { background: transparent; color: var(--jc-fg); border-color: transparent; text-decoration: underline; text-underline-offset: 3px; margin-right: auto; padding-left: 0; }
.jc-banner .jc-btn:hover { filter: brightness(1.08); }

.jc-banner .jc-btn:focus-visible,
.jc-banner .jc-switch:focus-visible,
.jc-card a:focus-visible,
.jc-legal a:focus-visible,
.jc-legal .jc-link-btn:focus-visible,
.jc-check input:focus-visible {
  outline: 2px solid var(--jc-accent);
  outline-offset: 2px;
}

/* Rodapé legal */
.jc-legal {
  background: var(--jc-legal-bg, transparent);
  color: var(--jc-legal-fg, inherit);
  font-family: var(--jc-font-body);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  padding: 20px 16px 24px;
}
.jc-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin-bottom: 8px;
}
.jc-legal .jc-link-btn,
.jc-legal .jc-link-btn:hover,
.jc-legal .jc-link-btn:focus {
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  border-radius: 0;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.jc-legal-company { margin: 0; font-size: 12px; opacity: 0.75; }

/* Checkbox LGPD nos formulários */
.jc-form-consent { display: grid; gap: 10px; margin: 6px 0 16px; text-align: left; }
.jc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--jc-font-body);
  font-size: 13.5px;
  line-height: 1.45;
  cursor: pointer;
}
.jc-check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--jc-accent);
  cursor: pointer;
}
.jc-check a { color: inherit; text-decoration: underline; }

@media (max-width: 640px) {
  .jc-banner { left: 0; right: 0; bottom: 0; }
  .jc-card { border-radius: var(--jc-radius) var(--jc-radius) 0 0; padding: 18px 16px 16px; font-size: 14px; }
  .jc-title { font-size: 18px; }
  .jc-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .jc-banner .jc-btn-ghost { grid-column: 1 / -1; order: 3; margin: 0; justify-self: center; padding: 6px 0; min-height: 0; }
  .jc-banner .jc-actions [data-jc="save"] { grid-column: 1 / -1; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .jc-banner, .jc-switch, .jc-switch::after { transition: none; }
}
