/* ============================================================
   OneLP consent banner + preferences drawer
   Scoped via #onelp-consent-* so it can't collide with the rest
   of styles.css. Matches the dark-cyan theme via CSS variables
   declared in styles.css; falls back to literal values so this
   stylesheet can be loaded standalone.
   ============================================================ */

#onelp-consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9998;
  display: none;
  background: var(--background-alt, #0d1220);
  color: var(--foreground, #f8fafc);
  border: 1px solid var(--border-hover, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, 0.5));
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  max-width: 1100px;
  margin: 0 auto;
}
#onelp-consent-banner.onelp-consent--visible { display: block; }

.onelp-consent-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
}

.onelp-consent-copy { flex: 1; min-width: 0; }
.onelp-consent-copy h2 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.onelp-consent-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted, #94a3b8);
}
.onelp-consent-copy a {
  color: var(--accent, #6bdcff);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.onelp-consent-copy a:hover { color: var(--accent-600, #38bdf8); }

.onelp-consent-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.onelp-consent-btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  padding: 10px 18px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.onelp-consent-btn:focus-visible {
  outline: 2px solid var(--accent, #6bdcff);
  outline-offset: 2px;
}
.onelp-consent-btn--secondary {
  background: transparent;
  color: var(--foreground, #f8fafc);
  border-color: var(--border-hover, rgba(255, 255, 255, 0.12));
}
.onelp-consent-btn--secondary:hover {
  background: var(--card-hover, rgba(255, 255, 255, 0.06));
  border-color: var(--foreground-soft, #e2e8f0);
}
.onelp-consent-btn--primary {
  background: var(--accent, #6bdcff);
  color: #050810;
  border-color: var(--accent, #6bdcff);
}
.onelp-consent-btn--primary:hover {
  background: var(--accent-600, #38bdf8);
  border-color: var(--accent-600, #38bdf8);
}

/* Narrow viewport — stack copy above buttons */
@media (max-width: 720px) {
  #onelp-consent-banner { left: 8px; right: 8px; bottom: 8px; }
  .onelp-consent-inner { flex-direction: column; align-items: stretch; gap: 16px; padding: 18px 20px; }
  .onelp-consent-actions { justify-content: flex-start; }
  .onelp-consent-btn { flex: 1 1 auto; min-width: 100px; }
}

/* ============================================================
   Preferences drawer (modal)
   ============================================================ */

#onelp-consent-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}
#onelp-consent-drawer.onelp-consent--visible { display: block; }

.onelp-consent-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.7);
  backdrop-filter: blur(4px);
}

.onelp-consent-drawer-panel {
  position: absolute;
  right: 24px;
  top: 24px;
  bottom: 24px;
  width: min(480px, calc(100vw - 48px));
  background: var(--background-alt, #0d1220);
  color: var(--foreground, #f8fafc);
  border: 1px solid var(--border-hover, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius-lg, 20px);
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(0, 0, 0, 0.5));
  display: flex;
  flex-direction: column;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.onelp-consent-drawer-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}
.onelp-consent-drawer-panel > header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.onelp-consent-drawer-close {
  background: transparent;
  border: none;
  color: var(--muted, #94a3b8);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.onelp-consent-drawer-close:hover { color: var(--foreground, #f8fafc); background: var(--card-hover, rgba(255,255,255,0.06)); }

.onelp-consent-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.onelp-consent-drawer-body > p {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted, #94a3b8);
}
.onelp-consent-drawer-body a {
  color: var(--accent, #6bdcff);
  text-decoration: underline;
}

.onelp-consent-category {
  padding: 16px 0;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}
.onelp-consent-category:first-of-type { border-top: none; padding-top: 0; }

.onelp-consent-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.onelp-consent-category h3 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.onelp-consent-category p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted, #94a3b8);
}

/* iOS-style switch */
.onelp-consent-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.onelp-consent-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.onelp-consent-switch span {
  position: absolute;
  inset: 0;
  background: var(--muted-soft, #64748b);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.onelp-consent-switch span::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}
.onelp-consent-switch input:checked + span { background: var(--accent, #6bdcff); }
.onelp-consent-switch input:checked + span::before { transform: translateX(18px); }
.onelp-consent-switch input:disabled + span { opacity: 0.6; cursor: not-allowed; }

.onelp-consent-drawer-panel > footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  justify-content: flex-end;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .onelp-consent-drawer-panel {
    right: 0;
    left: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    border-right: none;
    border-left: none;
    border-bottom: none;
  }
}
