/*
 * Velquix cookie consent UI. Self-contained and scoped under #vq-consent-root
 * so it is safe to load on the React app and the static HTML pages alike.
 * Warm neutral surfaces + copper accent, matching the Velquix landing palette.
 */
#vq-consent-root {
  --vq-surface: #fbf8f3;
  --vq-surface-soft: #f3efe7;
  --vq-text: #1a1613;
  --vq-muted: #5c544c;
  --vq-line: #e4ddd1;
  --vq-copper: #c76a2b;
  --vq-copper-dark: #a9541c;
  --vq-copper-soft: rgba(199, 106, 43, 0.12);
  --vq-shadow: 0 18px 50px rgba(40, 24, 10, 0.18);
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  color: var(--vq-text);
}

#vq-consent-root *,
#vq-consent-root *::before,
#vq-consent-root *::after {
  box-sizing: border-box;
}

/* ── banner (bottom, non-blocking) ───────────────────────────────── */
.vq-consent-banner {
  position: fixed;
  z-index: 2147483000;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 560px;
  margin: 0 auto;
  padding: 1.25rem 1.35rem;
  background: var(--vq-surface);
  border: 1px solid var(--vq-line);
  border-radius: 1rem;
  box-shadow: var(--vq-shadow);
  animation: vq-rise 0.3s ease both;
}

@keyframes vq-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

/* ── preference panel (centred, modal) ───────────────────────────── */
.vq-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(26, 22, 19, 0.45);
  animation: vq-fade 0.2s ease both;
}

@keyframes vq-fade {
  from {
    opacity: 0;
  }
}

.vq-consent-panel {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.6rem;
  background: var(--vq-surface);
  border: 1px solid var(--vq-line);
  border-radius: 1.1rem;
  box-shadow: var(--vq-shadow);
  animation: vq-rise 0.3s ease both;
}

/* ── text ─────────────────────────────────────────────────────────── */
.vq-consent-title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.vq-consent-text {
  margin: 0 0 1.1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--vq-muted);
}

.vq-consent-text a,
.vq-pref-desc a {
  color: var(--vq-copper-dark);
  font-weight: 600;
  text-decoration: underline;
}

/* ── preference rows ──────────────────────────────────────────────── */
.vq-pref {
  padding: 1rem 0;
  border-top: 1px solid var(--vq-line);
}

.vq-pref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}

.vq-pref-name {
  font-size: 0.98rem;
  font-weight: 700;
}

.vq-pref-locked {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--vq-copper-dark);
  background: var(--vq-copper-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.vq-pref-desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--vq-muted);
}

/* ── toggle switch ────────────────────────────────────────────────── */
.vq-switch {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.vq-switch-input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 24px;
  margin: 0;
  cursor: pointer;
}

.vq-switch-ui {
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cdc5b8;
  transition: background 0.2s ease;
}

.vq-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.vq-switch-input:checked + .vq-switch-ui {
  background: var(--vq-copper);
}

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

.vq-switch-input:focus-visible + .vq-switch-ui {
  outline: 2px solid var(--vq-copper);
  outline-offset: 2px;
}

/* ── buttons ──────────────────────────────────────────────────────── */
.vq-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.vq-btn {
  flex: 1 1 auto;
  min-width: 7.5rem;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.vq-btn-primary {
  background: var(--vq-copper);
  color: #fff;
}

.vq-btn-primary:hover {
  background: var(--vq-copper-dark);
}

.vq-btn-ghost {
  background: transparent;
  color: var(--vq-text);
  border-color: var(--vq-line);
}

.vq-btn-ghost:hover {
  background: var(--vq-surface-soft);
  border-color: var(--vq-copper);
}

.vq-btn:focus-visible {
  outline: 2px solid var(--vq-copper);
  outline-offset: 2px;
}

/* ── footer trigger ───────────────────────────────────────────────── */
.vq-cookie-settings {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.vq-cookie-settings:hover {
  color: var(--vq-copper-dark);
}

/* ── responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .vq-consent-actions .vq-btn {
    flex-basis: 100%;
  }
}

/* ── reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vq-consent-banner,
  .vq-consent-panel,
  .vq-consent-overlay {
    animation: none;
  }
  .vq-switch-ui,
  .vq-switch-ui::after,
  .vq-btn {
    transition: none;
  }
}
