/* UnifiedIQ cookie consent (1.40.0). Scoped to .uiqc-* so no theme style leaks in.
   Contrast-safe (WCAG AA), keyboard focus visible, respects reduced motion. */

.uiqc-root, .uiqc-root * { box-sizing: border-box; }

/* Colors as variables so a site accent can override --uiqc-accent inline. */
.uiqc-root {
  --uiqc-bg: #ffffff;
  --uiqc-fg: #1a1d21;
  --uiqc-muted: #51565d;
  --uiqc-line: #d5d9de;
  --uiqc-accent: #1452ff;         /* AA on white and as a button bg with white text */
  --uiqc-accent-fg: #ffffff;
  --uiqc-ghost-bg: #eef1f5;
  --uiqc-ghost-fg: #1a1d21;
  --uiqc-focus: #0b3ad6;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--uiqc-fg);
}
@media (prefers-color-scheme: dark) {
  .uiqc-root.uiqc-auto {
    --uiqc-bg: #14171a; --uiqc-fg: #eef1f5; --uiqc-muted: #b4bbc4; --uiqc-line: #343a42;
    --uiqc-accent: #5b8cff; --uiqc-accent-fg: #0b1220; --uiqc-ghost-bg: #232a31; --uiqc-ghost-fg: #eef1f5; --uiqc-focus: #9db9ff;
  }
}

/* ── Banner ── */
.uiqc-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 2147483000;
  max-width: 920px; margin: 0 auto;
  background: var(--uiqc-bg); color: var(--uiqc-fg);
  border: 1px solid var(--uiqc-line); border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  padding: 18px 20px;
  display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; justify-content: space-between;
}
.uiqc-bar__text { flex: 1 1 320px; min-width: 260px; margin: 0; color: var(--uiqc-fg); }
.uiqc-bar__text a { color: var(--uiqc-accent); text-decoration: underline; }
.uiqc-bar__actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Buttons (Reject is visually equal to Accept) ── */
.uiqc-btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 8px; padding: 11px 18px; border: 1px solid transparent;
  min-height: 44px;             /* touch target */
  transition: filter .12s ease, background .12s ease;
}
@media (prefers-reduced-motion: reduce) { .uiqc-btn, .uiqc-bar, .uiqc-modal__panel { transition: none !important; animation: none !important; } }
.uiqc-btn:hover { filter: brightness(.96); }
.uiqc-btn--primary { background: var(--uiqc-accent); color: var(--uiqc-accent-fg); }
.uiqc-btn--ghost { background: var(--uiqc-ghost-bg); color: var(--uiqc-ghost-fg); border-color: var(--uiqc-line); }
.uiqc-btn--link {
  background: none; border: none; color: var(--uiqc-fg); text-decoration: underline;
  padding: 11px 8px; min-height: 44px;
}
.uiqc-root :focus-visible, .uiqc-root :focus {
  outline: 3px solid var(--uiqc-focus); outline-offset: 2px;
}

/* ── Re-open handle (change choice later — required for withdrawal) ── */
.uiqc-reopen {
  position: fixed; left: 14px; bottom: 14px; z-index: 2147482000;
  background: var(--uiqc-bg); color: var(--uiqc-fg);
  border: 1px solid var(--uiqc-line); border-radius: 999px;
  min-height: 40px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,.16); display: inline-flex; gap: 7px; align-items: center;
}

/* ── Preferences modal ── */
.uiqc-modal {
  position: fixed; inset: 0; z-index: 2147483001;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,10,14,.55); padding: 16px;
}
.uiqc-modal__panel {
  background: var(--uiqc-bg); color: var(--uiqc-fg);
  border: 1px solid var(--uiqc-line); border-radius: 14px;
  width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto;
  padding: 24px; box-shadow: 0 16px 60px rgba(0,0,0,.4);
}
.uiqc-modal__title { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.uiqc-modal__intro { margin: 0 0 16px; color: var(--uiqc-muted); }
.uiqc-cat {
  border-top: 1px solid var(--uiqc-line); padding: 14px 0;
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: start;
}
.uiqc-cat__name { font-weight: 600; margin: 0; }
.uiqc-cat__desc { grid-column: 1 / 2; margin: 4px 0 0; color: var(--uiqc-muted); font-size: 14px; }
.uiqc-cat__always { color: var(--uiqc-muted); font-weight: 600; font-size: 14px; white-space: nowrap; }

/* Toggle switch (real checkbox underneath for screen readers + keyboard) */
.uiqc-switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.uiqc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.uiqc-switch__track {
  position: absolute; inset: 0; background: #b7bdc6; border-radius: 999px; transition: background .12s ease; pointer-events: none;
}
.uiqc-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; transition: transform .12s ease; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.uiqc-switch input:checked + .uiqc-switch__track { background: var(--uiqc-accent); }
.uiqc-switch input:checked + .uiqc-switch__track::after { transform: translateX(20px); }
.uiqc-switch input:focus-visible + .uiqc-switch__track { outline: 3px solid var(--uiqc-focus); outline-offset: 2px; }
.uiqc-switch input:disabled + .uiqc-switch__track { background: var(--uiqc-accent); opacity: .5; }

.uiqc-modal__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.uiqc-modal__actions .uiqc-btn { flex: 1 1 auto; }

.uiqc-hidden { display: none !important; }
.uiqc-sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 560px) {
  .uiqc-bar { left: 8px; right: 8px; bottom: 8px; padding: 16px; }
  .uiqc-bar__actions { width: 100%; }
  .uiqc-bar__actions .uiqc-btn { flex: 1 1 auto; }
}
