/* Oftcer CMP — compact glass bar (no AI-card clutter) */
.consent-lock { overflow: hidden !important; }

#consent-root {
  --c: #05b1fa;
  --fg: #f0f2f5;
  --mute: rgba(240, 242, 245, 0.68);
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(8, 12, 18, 0.78);
  --sans: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --display: Syne, "Instrument Sans", sans-serif;
  font-family: var(--sans);
  color: var(--fg);
}

.consent-bar[hidden],
.consent-panel[hidden] { display: none !important; }

/* Cookie SVG animation */
.consent-mark {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

.consent-cookie {
  width: 28px;
  height: 28px;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
  animation: ck-float 3.2s ease-in-out infinite;
}

.consent-cookie .ck-left {
  transform-origin: 210px 225px;
  animation: ck-tilt-l 3.2s ease-in-out infinite;
}

.consent-cookie .ck-right {
  transform-origin: 290px 275px;
  animation: ck-tilt-r 3.2s ease-in-out infinite;
}

@keyframes ck-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes ck-tilt-l {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-4deg); }
}

@keyframes ck-tilt-r {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}

@media (prefers-reduced-motion: reduce) {
  .consent-cookie,
  .consent-cookie .ck-left,
  .consent-cookie .ck-right {
    animation: none !important;
  }
}

/* —— Floating glass card (desktop a bit larger / clearer) —— */
.consent-bar {
  position: fixed;
  z-index: 10050;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(440px, calc(100% - 1.5rem));
}

.consent-bar-glass {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(22, 32, 48, 0.82), rgba(8, 12, 18, 0.92)),
    var(--glass);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.consent-bar-row {
  width: 100%;
  margin: 0;
  padding: 0.95rem 1.05rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon title"
    "desc desc"
    "actions actions";
  column-gap: 0.65rem;
  row-gap: 0.7rem;
  align-items: center;
}

.consent-bar-head {
  display: contents;
}

.consent-bar-head .consent-mark {
  grid-area: icon;
  width: 34px;
  height: 34px;
}

.consent-bar-head .consent-cookie {
  width: 34px;
  height: 34px;
}

.consent-bar-head h2 {
  grid-area: title;
  margin: 0;
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.consent-bar-desc {
  grid-area: desc;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--mute);
}

.consent-bar-desc a,
.consent-panel a {
  color: var(--c);
  text-underline-offset: 2px;
}

.consent-bar-actions {
  grid-area: actions;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.45rem;
}

.consent-bar-actions .c-btn {
  text-align: center;
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 9px;
}

.consent-bar-actions .c-btn-text {
  padding-inline: 0.5rem;
}

/* Buttons — soft rect, not pill spam */
.c-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0.55rem 0.95rem;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.c-btn:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}

.c-btn-solid {
  background: var(--c);
  color: #041018;
}

.c-btn-solid:hover { background: #3ec4fb; }

.c-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg);
  border: 1px solid var(--line);
}

.c-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.09);
}

.c-btn-text {
  background: transparent;
  color: var(--mute);
  padding-inline: 0.55rem;
}

.c-btn-text:hover { color: var(--fg); }

/* —— Compact manage panel —— */
.consent-panel {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: grid;
  place-items: end center;
  padding: 0 0.75rem max(0.85rem, env(safe-area-inset-bottom, 0px));
}

.consent-panel-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.consent-panel-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  max-height: min(86vh, 640px);
  overflow: auto;
  margin: 0 auto;
  padding: 1rem 1.05rem 1.05rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(20, 30, 44, 0.86), rgba(8, 12, 18, 0.94));
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  outline: none;
}

.consent-panel-top {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  margin: 0 0 0.75rem;
}

.consent-panel-top {
  align-items: center;
}

.consent-panel-top .consent-mark {
  width: 26px;
  height: 26px;
}

.consent-panel-top .consent-cookie {
  width: 26px;
  height: 26px;
}

.consent-panel-head {
  flex: 1 1 auto;
  min-width: 0;
}

.consent-panel-head h2 {
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.consent-panel-head p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--mute);
}

.consent-x {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--mute);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.consent-x:hover { color: var(--fg); background: rgba(255, 255, 255, 0.08); }

/* Compact glass chips — not oversized cards */
.consent-chips {
  width: 100%;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.consent-chip {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 0;
  padding: 0.65rem 0.75rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin: 0;
}

.consent-chip.is-locked {
  border-color: rgba(5, 177, 250, 0.22);
  background: rgba(5, 177, 250, 0.07);
}

.consent-chip-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.consent-chip-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.consent-chip-desc {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--mute);
}

.consent-chip-fixed {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--c);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.consent-laws {
  margin: 0.7rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.consent-laws-title {
  margin: 0 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.consent-laws ul {
  margin: 0;
  padding-left: 1rem;
}

.consent-laws li {
  font-size: 0.66rem;
  line-height: 1.4;
  color: var(--mute);
}

.consent-laws li + li {
  margin-top: 0.28rem;
}

.consent-laws strong {
  color: rgba(240, 242, 245, 0.88);
  font-weight: 600;
}

.consent-toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.consent-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
}

.consent-switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  display: block;
  transition: background 0.15s ease;
}

.consent-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.consent-toggle input:checked + .consent-switch {
  background: var(--c);
  border-color: transparent;
}

.consent-toggle input:checked + .consent-switch::after {
  transform: translateX(18px);
}

.consent-toggle input:focus-visible + .consent-switch {
  outline: 2px solid var(--c);
  outline-offset: 2px;
}

.consent-panel-foot {
  width: 100%;
  margin: 0.75rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.consent-panel-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.consent-panel-actions .c-btn {
  flex: 1 1 auto;
  text-align: center;
}

.consent-toast {
  position: fixed;
  z-index: 10070;
  left: 50%;
  bottom: 1.1rem;
  transform: translate(-50%, 10px);
  opacity: 0;
  pointer-events: none;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  background: rgba(10, 16, 24, 0.92);
  border: 1px solid rgba(5, 177, 250, 0.3);
  font: 600 0.8rem/1.3 var(--sans);
  backdrop-filter: blur(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.consent-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Mobile: tamanho compacto anterior (PC permanece 440px) */
@media (max-width: 720px) {
  .consent-bar {
    width: min(360px, calc(100% - 1.25rem));
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  }

  .consent-bar-glass {
    border-radius: 14px;
  }

  .consent-bar-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.7rem 0.8rem 0.75rem;
  }

  .consent-bar-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .consent-bar-head .consent-mark,
  .consent-bar-head .consent-cookie {
    width: 26px;
    height: 26px;
  }

  .consent-bar-head h2 {
    font-size: 0.88rem;
  }

  .consent-bar-desc {
    font-size: 0.72rem;
    line-height: 1.4;
  }

  .consent-bar-actions {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 0.35rem;
  }

  .consent-bar-actions .c-btn {
    flex: 1 1 0;
    padding: 0.45rem 0.4rem;
    font-size: 0.72rem;
    border-radius: 8px;
  }

  .consent-bar-actions .c-btn-text {
    flex: 0 0 auto;
    order: 0;
    padding-inline: 0.35rem;
    justify-self: auto;
  }
}

/* Legal pages keep previous helpers */
.legal-page .nav { position: relative; }
.footer .linkish {
  appearance: none; border: 0; background: none; color: inherit;
  font: inherit; cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.footer .linkish:hover { color: #05b1fa; }
