/* ============================================
   NEURABRIDGE.AI — Cookie Consent Banner
   ============================================ */

#cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 9999;
  width: calc(100% - 48px);
  max-width: 740px;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#cookie-banner.cb-visible {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.cb-inner {
  background: var(--color-bg-primary, #ffffff);
  border: 0.5px solid var(--color-border-mid, rgba(0,0,0,0.14));
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  padding: 24px 28px;
  display: flex;
  gap: 24px;
  align-items: flex-end;
}

.cb-content {
  flex: 1;
  min-width: 0;
}

.cb-title {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary, #1a1a18);
  margin: 0 0 6px;
}

.cb-desc {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  color: var(--color-text-secondary, #5f5e5a);
  line-height: 1.6;
  margin: 0 0 16px;
}

.cb-link {
  color: var(--color-brand, #1D9E75);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

/* ── Toggles ─────────────────────────────── */

.cb-toggle-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.cb-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.cb-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cb-toggle__label {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-primary, #1a1a18);
}

.cb-toggle__track {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--color-border-mid, rgba(0,0,0,0.14));
  border-radius: 100px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.cb-toggle__track--locked {
  background: var(--color-brand, #1D9E75);
  opacity: 0.5;
}

.cb-toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Checked state */
.cb-toggle input:checked ~ .cb-toggle__track {
  background: var(--color-brand, #1D9E75);
}

.cb-toggle input:checked ~ .cb-toggle__track .cb-toggle__thumb {
  transform: translateX(16px);
}

/* Focus ring */
.cb-toggle input:focus-visible ~ .cb-toggle__track {
  outline: 2px solid var(--color-brand, #1D9E75);
  outline-offset: 2px;
}

.cb-toggle__always {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 11px;
  color: var(--color-text-tertiary, #888780);
  font-style: italic;
}

/* ── Action buttons ──────────────────────── */

.cb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.cb-btn {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 100px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  border: none;
}

.cb-btn--accept {
  background: var(--color-brand, #1D9E75);
  color: white;
  border: 1px solid var(--color-brand, #1D9E75);
}

.cb-btn--accept:hover {
  background: #0F6E56;
  border-color: #0F6E56;
}

.cb-btn--necessary {
  background: transparent;
  color: var(--color-text-primary, #1a1a18);
  border: 0.5px solid rgba(0,0,0,0.18);
}

.cb-btn--necessary:hover {
  background: var(--color-bg-secondary, #f7f6f2);
}

.cb-btn--refuse {
  background: transparent;
  color: var(--color-text-secondary, #5f5e5a);
  border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 12px;
}

.cb-btn--refuse:hover {
  color: var(--color-text-primary, #1a1a18);
}

/* ── Responsive ──────────────────────────── */

@media (max-width: 620px) {
  #cookie-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    transform: translateX(0) translateY(110%);
    border-radius: 0;
  }

  #cookie-banner.cb-visible {
    transform: translateX(0) translateY(0);
  }

  .cb-inner {
    flex-direction: column;
    border-radius: 14px 14px 0 0;
    gap: 20px;
    align-items: stretch;
  }

  .cb-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .cb-btn--refuse {
    margin-right: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  #cookie-banner,
  .cb-toggle__track,
  .cb-toggle__thumb,
  .cb-btn {
    transition: none !important;
  }
}
