/*
 * Cookie consent banner + preferences modal.
 * Reuses theme.css's brand tokens (--color-charcoal/teal/sand/amber) but
 * lives in its own file — theme.css itself is locked in and stays
 * untouched (see CLAUDE.md).
 */

.ra-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: color-mix(in srgb, var(--color-charcoal) 96%, black);
  border-top: 1px solid color-mix(in srgb, var(--color-sand) 20%, transparent);
  font-family: var(--font-sans);
}

.ra-consent-banner-text {
  margin: 0;
  max-width: 40rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-sand) 80%, transparent);
}

.ra-consent-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ra-consent-btn {
  border-radius: 0.5rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.ra-consent-btn-primary {
  background: var(--color-amber);
  color: var(--color-charcoal);
}
.ra-consent-btn-primary:hover { filter: brightness(1.1); }

.ra-consent-btn-outline {
  background: transparent;
  color: var(--color-sand);
  border-color: color-mix(in srgb, var(--color-sand) 35%, transparent);
}
.ra-consent-btn-outline:hover { background: color-mix(in srgb, var(--color-sand) 8%, transparent); }

.ra-consent-btn-ghost {
  background: transparent;
  color: color-mix(in srgb, var(--color-sand) 70%, transparent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ra-consent-btn-ghost:hover { color: var(--color-sand); }

.ra-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: color-mix(in srgb, var(--color-charcoal) 70%, transparent);
}

.ra-consent-panel {
  width: 100%;
  max-width: 30rem;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 0.75rem;
  padding: 1.5rem;
  background: var(--color-charcoal);
  border: 1px solid color-mix(in srgb, var(--color-sand) 20%, transparent);
  font-family: var(--font-sans);
}

.ra-consent-panel-title {
  margin: 0 0 1rem;
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--color-sand);
}

.ra-consent-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid color-mix(in srgb, var(--color-sand) 12%, transparent);
}
.ra-consent-row:first-of-type { border-top: none; }

.ra-consent-row-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-sand);
}

.ra-consent-row-desc {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--color-sand) 60%, transparent);
}

.ra-consent-switch {
  position: relative;
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.5rem;
  margin-top: 0.15rem;
}

.ra-consent-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.ra-consent-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-sand) 20%, transparent);
  transition: background 0.15s ease;
  pointer-events: none;
}

.ra-consent-slider::before {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--color-sand);
  transition: transform 0.15s ease;
}

.ra-consent-switch input:checked + .ra-consent-slider {
  background: var(--color-teal);
}
.ra-consent-switch input:checked + .ra-consent-slider::before {
  transform: translateX(1rem);
  background: var(--color-amber);
}

.ra-consent-switch input:disabled + .ra-consent-slider {
  background: color-mix(in srgb, var(--color-teal) 60%, transparent);
  opacity: 0.7;
}
.ra-consent-switch input:disabled + .ra-consent-slider::before {
  transform: translateX(1rem);
}

.ra-consent-panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 480px) {
  .ra-consent-banner { flex-direction: column; align-items: stretch; }
  .ra-consent-banner-actions { justify-content: flex-end; }
}
