/* ==========================================================================
   consent.css — cookie banner, preferences dialog and re-open control
   Consequence Consulting / Action & Consequence AB

   Shared by every page on consequence.se. Colours fall back to sensible
   defaults, so this works even on pages that define different tokens.
   ========================================================================== */

.cc-banner {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 900;
  width: min(420px, calc(100vw - 48px));
  background: rgba(12,15,24,0.92);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-light, rgba(255,255,255,0.10));
  border-radius: var(--radius, 16px);
  padding: 28px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  font-family: var(--font-body, 'DM Sans', sans-serif);
  color: #ffffff;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.cc-banner.cc-show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.cc-banner[hidden] { display: none; }

.cc-title {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #ffffff;
}

.cc-title::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent, #00c8aa);
  flex-shrink: 0;
}

.cc-copy {
  font-size: 13px;
  line-height: 1.7;
  color: #d6ddec;
  font-weight: 300;
  margin: 0 0 22px;
}

.cc-copy a {
  color: var(--accent, #00c8aa);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,200,170,0.35);
}

.cc-copy a:hover { border-bottom-color: var(--accent, #00c8aa); }

.cc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Accept and Reject carry identical visual weight — required in the EU */
.cc-btn {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  height: 40px;
  padding: 0 20px;
  border-radius: 100px;
  cursor: pointer;
  border: 1px solid var(--border-light, rgba(255,255,255,0.10));
  background: transparent;
  color: #ffffff;
  transition: border-color 0.25s, background 0.25s, color 0.25s;
  flex: 1 1 auto;
  min-width: 108px;
}

.cc-btn:hover { border-color: var(--accent, #00c8aa); }

.cc-btn-primary {
  background: var(--accent, #00c8aa);
  border-color: var(--accent, #00c8aa);
  color: #07090e;
}

.cc-btn-primary:hover { background: #00b096; border-color: #00b096; }

.cc-btn-text {
  background: none;
  border: none;
  color: #9aa4b8;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  font-size: 12px;
  cursor: pointer;
  padding: 8px 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  flex: 1 0 100%;
  text-align: left;
  transition: color 0.25s;
}

.cc-btn-text:hover { color: #ffffff; }

/* --- preferences dialog --- */
.cc-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(3,5,9,0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cc-overlay[hidden] { display: none; }
.cc-overlay.cc-show { opacity: 1; }

.cc-modal {
  width: min(520px, 100%);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  background: var(--bg-card, #0c0f18);
  border: 1px solid var(--border-light, rgba(255,255,255,0.10));
  border-radius: var(--radius, 16px);
  padding: 36px;
  font-family: var(--font-body, 'DM Sans', sans-serif);
  color: #ffffff;
}

.cc-modal h2 {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 12px;
  color: #ffffff;
}

.cc-modal-intro {
  font-size: 13.5px;
  line-height: 1.75;
  color: #d6ddec;
  font-weight: 300;
  margin: 0 0 28px;
}

.cc-cat {
  padding: 20px 0;
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.cc-cat:last-of-type { border-bottom: 1px solid var(--border, rgba(255,255,255,0.06)); }

.cc-cat-name {
  font-family: var(--font-display, 'Syne', sans-serif);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #ffffff;
}

.cc-cat-desc {
  font-size: 12.5px;
  line-height: 1.7;
  color: #d6ddec;
  font-weight: 300;
  max-width: 340px;
  margin: 0;
}

/* --- switch --- */
.cc-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; margin-top: 2px; }

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

.cc-switch-ui {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.10);
  border: 1px solid var(--border-light, rgba(255,255,255,0.10));
  border-radius: 100px;
  transition: background 0.25s, border-color 0.25s;
  pointer-events: none;
}

.cc-switch-ui::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #d6ddec;
  transition: transform 0.25s, background 0.25s;
}

.cc-switch input:checked + .cc-switch-ui {
  background: var(--accent-dim, rgba(0,200,170,0.10));
  border-color: var(--accent, #00c8aa);
}

.cc-switch input:checked + .cc-switch-ui::after {
  transform: translateX(18px);
  background: var(--accent, #00c8aa);
}

.cc-switch input:focus-visible + .cc-switch-ui {
  outline: 2px solid var(--accent, #00c8aa);
  outline-offset: 3px;
}

.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled + .cc-switch-ui { opacity: 0.45; }

.cc-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.cc-modal-actions .cc-btn { flex: 1 1 130px; }

/* --- floating re-open control (consent must be withdrawable) --- */
.cc-reopen {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 880;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-light, rgba(255,255,255,0.10));
  background: rgba(12,15,24,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #9aa4b8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s, border-color 0.25s;
}

.cc-reopen[hidden] { display: none; }
.cc-reopen:hover { color: var(--accent, #00c8aa); border-color: rgba(0,200,170,0.28); }
.cc-reopen svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }

/* Focus ring, in case the host page doesn't define one */
.cc-banner :focus-visible,
.cc-modal :focus-visible,
.cc-reopen:focus-visible {
  outline: 2px solid var(--accent, #00c8aa);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 520px) {
  .cc-banner { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 24px 22px; }
  .cc-modal { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner, .cc-overlay { transition-duration: 0.001ms !important; }
  .cc-banner.cc-show { opacity: 1; transform: none; }
}
