/* ================================================================
   FILE: assets/consent.css  →  loaded by every page
   PURPOSE: Cookie consent banner + preferences panel. Pairs with
   assets/consent.js and the Consent Mode v2 defaults set inline in
   each page <head>.
   NOTE: sub-pages define their own design tokens independently, so
   every value below carries a literal fallback and this file never
   assumes :root tokens exist.
   ================================================================ */

.or-consent,
.or-consent * { box-sizing: border-box; }

.or-consent {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 2147483000;
  display: none;
  padding: 16px;
  font-family: var(--font-sans, "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
}

.or-consent[data-open="true"] { display: block; }

.or-consent__panel {
  max-width: var(--max, 1120px);
  margin: 0 auto;
  padding: 20px 22px;
  background: var(--bg-elev, #101218);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: var(--radius, 8px);
  box-shadow: var(--shadow, 0 24px 80px rgba(0, 0, 0, 0.35));
  color: var(--text, #f7f8fb);
}

@supports (backdrop-filter: blur(12px)) {
  .or-consent__panel {
    background: rgba(16, 18, 24, 0.92);
    backdrop-filter: blur(12px);
  }
}

.or-consent__row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.or-consent__copy { flex: 1 1 420px; min-width: 0; }

.or-consent__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.or-consent__text {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-muted, #b4bac8);
}

.or-consent__text a {
  color: var(--accent, #00e8b0);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.or-consent__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.or-consent__btn {
  appearance: none;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  padding: 11px 18px;
  min-width: 128px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 160ms var(--ease, cubic-bezier(0.22, 1, 0.36, 1)),
              border-color 160ms var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

/* Reject and Accept are deliberately the same size and weight:
   the ICO requires rejecting to be as easy as accepting. */
.or-consent__btn--accept {
  background: var(--accent, #00e8b0);
  color: var(--accent-on-dark, #05100d);
}
.or-consent__btn--accept:hover { background: var(--accent-hover, #28f5c3); }

.or-consent__btn--reject {
  background: var(--surface, rgba(255, 255, 255, 0.045));
  border-color: var(--line-strong, rgba(255, 255, 255, 0.2));
  color: var(--text, #f7f8fb);
}
.or-consent__btn--reject:hover {
  background: var(--surface-hover, rgba(255, 255, 255, 0.07));
}

.or-consent__btn--ghost {
  background: transparent;
  color: var(--text-muted, #b4bac8);
  min-width: 0;
  padding: 11px 14px;
}
.or-consent__btn--ghost:hover { color: var(--text, #f7f8fb); }

.or-consent__btn:focus-visible,
.or-consent__toggle input:focus-visible + .or-consent__track {
  outline: 2px solid var(--accent, #00e8b0);
  outline-offset: 2px;
}

/* ---- preferences ---- */

.or-consent__prefs {
  display: none;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft, rgba(255, 255, 255, 0.08));
}

.or-consent[data-view="prefs"] .or-consent__prefs { display: block; }

.or-consent__group {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
}
.or-consent__group + .or-consent__group {
  border-top: 1px solid var(--line-soft, rgba(255, 255, 255, 0.08));
}

.or-consent__group-copy { flex: 1 1 auto; min-width: 0; }

.or-consent__group-name {
  margin: 0 0 4px;
  font-size: 13.5px;
  font-weight: 600;
}

.or-consent__group-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-subtle, #7f8798);
}

.or-consent__toggle {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  margin-top: 2px;
}
.or-consent__toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.or-consent__track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 160ms ease;
  pointer-events: none;
}
.or-consent__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f7f8fb;
  transition: transform 160ms ease;
}
.or-consent__toggle input:checked + .or-consent__track {
  background: var(--accent, #00e8b0);
}
.or-consent__toggle input:checked + .or-consent__track::after {
  transform: translateX(18px);
}
.or-consent__toggle input:disabled { cursor: not-allowed; }
.or-consent__toggle input:disabled + .or-consent__track { opacity: 0.55; }

.or-consent__prefs-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 720px) {
  .or-consent { padding: 10px; }
  .or-consent__panel { padding: 18px; }
  .or-consent__row { gap: 16px; }
  .or-consent__actions { width: 100%; }
  .or-consent__btn { flex: 1 1 auto; }
  .or-consent__prefs-actions { justify-content: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .or-consent__btn,
  .or-consent__track,
  .or-consent__track::after { transition: none; }
}

/* ---- "manage preferences" trigger, used on /cookies ---- */

.or-consent-trigger {
  appearance: none;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent, #00e8b0);
  background: var(--accent-subtle, rgba(0, 232, 176, 0.12));
  border: 1px solid var(--accent, #00e8b0);
  border-radius: 6px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 160ms var(--ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.or-consent-trigger:hover { background: rgba(0, 232, 176, 0.2); }

.or-consent-trigger:focus-visible {
  outline: 2px solid var(--accent, #00e8b0);
  outline-offset: 2px;
}
