/* Banner LGPD / cookies — neutro para portal, registro e app */

.brvc-cc-host {
  position: static;
}

/* Botão flutuante (modo não intrusivo) */
.brvc-cc-fab {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 37, 26, 0.14);
  background: rgba(255, 255, 255, 0.96);
  color: #0d5c2e;
  box-shadow: 0 4px 18px rgba(16, 37, 26, 0.12);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.brvc-cc-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(16, 37, 26, 0.16);
}

.brvc-cc-fab:focus-visible {
  outline: 2px solid #008a3e;
  outline-offset: 2px;
}

.brvc-cc-fab--minimal {
  padding: 8px;
  opacity: 0.82;
}

.brvc-cc-fab--minimal:hover {
  opacity: 1;
}

.brvc-cc-fab-label {
  line-height: 1;
}

.brvc-cc-fab-dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #008a3e;
  box-shadow: 0 0 0 2px #fff;
}

.brvc-cc-fab.brvc-cc-fab--minimal .brvc-cc-fab-dot {
  display: none;
}

.brvc-cc-modal-lead {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--brvc-cc-muted, #4a6356);
}

.brvc-cc-modal-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--brvc-cc-border);
}

.brvc-cc-modal-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.8125rem;
}

.brvc-cc-modal-foot-links a {
  color: var(--brvc-cc-accent, #008a3e);
  text-decoration: none;
}

.brvc-cc-modal-foot-links a:hover {
  text-decoration: underline;
}

.brvc-cc-modal-foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.brvc-cc {
  --brvc-cc-bg: rgba(255, 255, 255, 0.94);
  --brvc-cc-border: rgba(16, 37, 26, 0.12);
  --brvc-cc-text: #10251a;
  --brvc-cc-muted: #4a6356;
  --brvc-cc-accent: #008a3e;
  --brvc-cc-accent-hover: #006b2f;
  --brvc-cc-shadow: 0 12px 40px rgba(16, 37, 26, 0.14);
  position: fixed;
  z-index: 2147483000;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  width: min(960px, calc(100vw - 24px));
  transform: translateX(-50%);
  opacity: 1;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--brvc-cc-text);
  background: var(--brvc-cc-bg);
  border: 1px solid var(--brvc-cc-border);
  border-radius: 16px;
  box-shadow: var(--brvc-cc-shadow);
  backdrop-filter: blur(10px);
  animation: brvc-cc-in 0.35s ease-out;
}

@keyframes brvc-cc-in {
  from {
    transform: translateX(-50%) translateY(12px);
  }
  to {
    transform: translateX(-50%) translateY(0);
  }
}

.brvc-cc.is-leaving {
  animation: brvc-cc-out 0.28s ease-in forwards;
}

@keyframes brvc-cc-out {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
}

.brvc-cc-inner {
  display: grid;
  gap: 14px;
  padding: 18px 20px 16px;
}

@media (min-width: 720px) {
  .brvc-cc-inner {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
  }
}

.brvc-cc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e8f5ee, #d4ecdf);
  color: var(--brvc-cc-accent);
  flex-shrink: 0;
}

.brvc-cc-icon svg {
  width: 22px;
  height: 22px;
}

.brvc-cc-copy h2 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brvc-cc-copy p {
  margin: 0;
  color: var(--brvc-cc-muted);
  font-size: 0.875rem;
}

.brvc-cc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

@media (min-width: 720px) {
  .brvc-cc-actions {
    flex-direction: column;
    align-items: stretch;
    min-width: 200px;
  }
}

.brvc-cc-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.3;
  padding: 10px 14px;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.brvc-cc-btn:focus-visible {
  outline: 2px solid var(--brvc-cc-accent);
  outline-offset: 2px;
}

.brvc-cc .brvc-cc-btn--primary {
  background-color: var(--brvc-cc-accent);
  background: var(--brvc-cc-accent);
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 107, 47, 0.25);
}

.brvc-cc .brvc-cc-btn--primary:hover {
  background-color: var(--brvc-cc-accent-hover);
  background: var(--brvc-cc-accent-hover);
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}

/* Modal é irmão do .brvc-cc: não herda --brvc-cc-*. Cores fixas para contraste garantido. */
.brvc-cc-modal .brvc-cc-btn--primary {
  background-color: #008a3e !important;
  background: #008a3e !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 107, 47, 0.35);
}

.brvc-cc-modal .brvc-cc-btn--primary:hover {
  background-color: #006b2f !important;
  background: #006b2f !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}

.brvc-cc-btn--ghost {
  background: transparent;
  color: var(--brvc-cc-muted);
  border: 1px solid var(--brvc-cc-border);
}

.brvc-cc-btn--ghost:hover {
  background: rgba(16, 37, 26, 0.04);
  color: var(--brvc-cc-text);
}

.brvc-cc-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding-top: 10px;
  border-top: 1px solid var(--brvc-cc-border);
  font-size: 0.8125rem;
}

.brvc-cc-links a {
  color: var(--brvc-cc-accent);
  text-decoration: none;
}

.brvc-cc-links a:hover {
  color: var(--brvc-cc-accent-hover);
}

/* Modal preferências */
.brvc-cc-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 20, 15, 0.45);
  backdrop-filter: blur(4px);
}

.brvc-cc-modal.is-open {
  display: flex;
}

.brvc-cc-modal-panel {
  width: min(480px, 100%);
  max-height: min(88vh, 640px);
  overflow: auto;
  background: #fff;
  color: #10251a;
  border-radius: 16px;
  box-shadow: var(--brvc-cc-shadow);
  border: 1px solid var(--brvc-cc-border);
  /* Tokens locais: o modal não fica dentro de .brvc-cc */
  --brvc-cc-accent: #008a3e;
  --brvc-cc-accent-hover: #006b2f;
  --brvc-cc-text: #10251a;
  --brvc-cc-muted: #4a6356;
  --brvc-cc-border: rgba(16, 37, 26, 0.12);
  --brvc-cc-shadow: 0 12px 40px rgba(16, 37, 26, 0.14);
}

.brvc-cc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--brvc-cc-border);
}

.brvc-cc-modal-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.brvc-cc-modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--brvc-cc-muted);
  padding: 4px 8px;
  border-radius: 8px;
}

.brvc-cc-modal-close:hover {
  background: rgba(16, 37, 26, 0.06);
  color: var(--brvc-cc-text);
}

.brvc-cc-modal-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brvc-cc-modal-body .brvc-cc-check-copy h4 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brvc-cc-text);
  letter-spacing: -0.01em;
}

.brvc-cc-modal-body .brvc-cc-check-copy p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--brvc-cc-muted);
}

/* Título em destaque só quando a categoria está ligada (ou essenciais). */
.brvc-cc-modal-body .brvc-cc-row--essential .brvc-cc-check-copy h4,
.brvc-cc-modal-body .brvc-cc-row:has(.brvc-cc-toggle-input:checked) .brvc-cc-check-copy h4 {
  color: var(--brvc-cc-accent);
}

.brvc-cc-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin: 0;
  cursor: pointer;
}

.brvc-cc-toggle-row--locked {
  cursor: default;
}

/* Interruptor: input cobre a área (evita clique “morto” por cima do trilho). */
.brvc-cc-switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  margin-top: 2px;
}

label.brvc-cc-switch {
  display: inline-block;
  margin: 0;
  cursor: pointer;
}

/* Essenciais: mesmo visual de interruptor “ligado”, só leitura (sem input). */
.brvc-cc-switch--readonly {
  pointer-events: none;
  cursor: default;
}

.brvc-cc-switch--readonly .brvc-cc-switch-ui.is-on {
  background: var(--brvc-cc-accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.brvc-cc-switch--readonly .brvc-cc-switch-ui.is-on::after {
  transform: translateX(20px);
}

.brvc-cc-toggle-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 28px;
  margin: 0;
  padding: 0;
  opacity: 0.01;
  cursor: pointer;
  z-index: 2;
  appearance: none;
  -webkit-appearance: none;
}

.brvc-cc-toggle-input:focus-visible {
  outline: none;
}

.brvc-cc-toggle-input:focus-visible + .brvc-cc-switch-ui {
  outline: 2px solid var(--brvc-cc-accent);
  outline-offset: 2px;
}

.brvc-cc-switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #c5d0c8;
  pointer-events: none;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(16, 37, 26, 0.12);
}

.brvc-cc-switch-ui::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 37, 26, 0.22);
  transition: transform 0.22s ease;
}

.brvc-cc-toggle-input:checked + .brvc-cc-switch-ui {
  background: var(--brvc-cc-accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.brvc-cc-toggle-input:checked + .brvc-cc-switch-ui::after {
  transform: translateX(20px);
}

.brvc-cc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--brvc-cc-border);
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

/* Categoria obrigatória (sempre ligada) */
.brvc-cc-modal-body .brvc-cc-row--essential {
  border-color: rgba(0, 138, 62, 0.35);
  background: rgba(0, 138, 62, 0.06);
  box-shadow: inset 0 0 0 1px rgba(0, 138, 62, 0.08);
}

/* Opcional ativado */
.brvc-cc-modal-body .brvc-cc-row:has(.brvc-cc-toggle-input:checked) {
  border-color: rgba(0, 138, 62, 0.5);
  background: linear-gradient(105deg, rgba(0, 138, 62, 0.1) 0%, rgba(0, 138, 62, 0.03) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 138, 62, 0.12);
}

body.brvc-theme-dark .brvc-cc-fab,
.admin-mode.brvc-theme-dark .brvc-cc-fab,
.app-mode.brvc-theme-dark .brvc-cc-fab {
  background: rgba(28, 38, 32, 0.94);
  color: #b8e6cc;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

body.brvc-theme-dark .brvc-cc-fab-dot,
.admin-mode.brvc-theme-dark .brvc-cc-fab-dot,
.app-mode.brvc-theme-dark .brvc-cc-fab-dot {
  box-shadow: 0 0 0 2px #1c2620;
}

body.brvc-theme-dark .brvc-cc,
.admin-mode.brvc-theme-dark .brvc-cc,
.app-mode.brvc-theme-dark .brvc-cc {
  --brvc-cc-bg: rgba(22, 32, 28, 0.96);
  --brvc-cc-border: rgba(255, 255, 255, 0.1);
  --brvc-cc-text: #e8f0eb;
  --brvc-cc-muted: #9cb0a4;
  --brvc-cc-accent: #3dd68c;
  --brvc-cc-accent-hover: #2ebd7a;
  --brvc-cc-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.brvc-theme-dark .brvc-cc-modal-panel,
.admin-mode.brvc-theme-dark .brvc-cc-modal-panel,
.app-mode.brvc-theme-dark .brvc-cc-modal-panel {
  background: #1a2420;
  color: #e8f0eb;
  border-color: rgba(255, 255, 255, 0.1);
  --brvc-cc-accent: #3dd68c;
  --brvc-cc-accent-hover: #5ae9a4;
  --brvc-cc-text: #e8f0eb;
  --brvc-cc-muted: #9cb0a4;
  --brvc-cc-border: rgba(255, 255, 255, 0.12);
  --brvc-cc-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

body.brvc-theme-dark .brvc-cc-modal .brvc-cc-btn--primary,
.admin-mode.brvc-theme-dark .brvc-cc-modal .brvc-cc-btn--primary,
.app-mode.brvc-theme-dark .brvc-cc-modal .brvc-cc-btn--primary {
  background-color: #0d7a45 !important;
  background: #0d7a45 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff;
}

body.brvc-theme-dark .brvc-cc-modal .brvc-cc-btn--primary:hover,
.admin-mode.brvc-theme-dark .brvc-cc-modal .brvc-cc-btn--primary:hover,
.app-mode.brvc-theme-dark .brvc-cc-modal .brvc-cc-btn--primary:hover {
  background-color: #0a5c34 !important;
  background: #0a5c34 !important;
}

body.brvc-theme-dark .brvc-cc-modal-body .brvc-cc-row--essential,
.admin-mode.brvc-theme-dark .brvc-cc-modal-body .brvc-cc-row--essential,
.app-mode.brvc-theme-dark .brvc-cc-modal-body .brvc-cc-row--essential {
  border-color: rgba(61, 214, 140, 0.35);
  background: rgba(61, 214, 140, 0.08);
}

body.brvc-theme-dark .brvc-cc-modal-body .brvc-cc-row:has(.brvc-cc-toggle-input:checked),
.admin-mode.brvc-theme-dark .brvc-cc-modal-body .brvc-cc-row:has(.brvc-cc-toggle-input:checked),
.app-mode.brvc-theme-dark .brvc-cc-modal-body .brvc-cc-row:has(.brvc-cc-toggle-input:checked) {
  border-color: rgba(61, 214, 140, 0.45);
  background: linear-gradient(105deg, rgba(61, 214, 140, 0.14) 0%, rgba(61, 214, 140, 0.04) 100%);
}

body.brvc-theme-dark .brvc-cc-switch-ui,
.admin-mode.brvc-theme-dark .brvc-cc-switch-ui,
.app-mode.brvc-theme-dark .brvc-cc-switch-ui {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

body.brvc-theme-dark .brvc-cc-toggle-input:checked + .brvc-cc-switch-ui,
.admin-mode.brvc-theme-dark .brvc-cc-toggle-input:checked + .brvc-cc-switch-ui,
.app-mode.brvc-theme-dark .brvc-cc-toggle-input:checked + .brvc-cc-switch-ui {
  background: var(--brvc-cc-accent);
}

body.brvc-theme-dark .brvc-cc-icon,
.admin-mode.brvc-theme-dark .brvc-cc-icon,
.app-mode.brvc-theme-dark .brvc-cc-icon {
  background: linear-gradient(135deg, #1e3d2e, #163828);
}
