/* ============================================================
   ScreenImmos — Consent banner (opt-in analytics gate)
   Injected by js/analytics.js on every page. Honors the
   Datenschutzerklärung §4 promise: no tracking before consent.
   ============================================================ */

.si-consent {
  position: fixed;
  left: var(--gutter);
  bottom: var(--gutter);
  z-index: 120; /* above the sticky header (z 50) */
  width: min(420px, calc(100vw - var(--gutter) * 2));
}

.si-consent[hidden] { display: none; }

.si-consent-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  padding: 1.25rem 1.35rem 1.15rem;
  /* entrance */
  transform: translateY(14px);
  opacity: 0;
  transition: transform var(--duration-normal) var(--ease-out),
              opacity var(--duration-normal) var(--ease-out);
}

.si-consent.is-in .si-consent-card {
  transform: translateY(0);
  opacity: 1;
}

/* Accent hairline — ties the card to the brand gradient without shouting */
.si-consent-card::before {
  content: "";
  display: block;
  width: 40px;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--grad-intel);
  margin-bottom: 0.95rem;
}

.si-consent-title {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
}

.si-consent-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted-tint);
  margin: 0 0 1.05rem;
}

.si-consent-desc a {
  color: var(--purple-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.si-consent-desc a:hover { color: var(--ink-strong); }

.si-consent-actions {
  display: flex;
  gap: 0.6rem;
}

/* Equal-weight accept / decline — no dark pattern: both are the same
   size and clearly legible (TDDDG/DSGVO require a genuine choice). */
.si-consent-btn {
  flex: 1 1 0;
  height: 44px;
  padding-inline: 1rem;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out);
}

.si-consent-btn.si-accept {
  border: 0;
  color: #fff;
  /* darkened brand purple so white label clears WCAG AA (>=4.5:1) at every stop */
  background: linear-gradient(120deg, #6a4be8 15%, #5a3fd0 55%, #6a4be8 85%);
  box-shadow: 0 6px 16px rgba(123, 97, 255, 0.32);
}
.si-consent-btn.si-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(123, 97, 255, 0.42);
}
.si-consent-btn.si-accept:active { transform: translateY(0); }

.si-consent-btn.si-decline {
  color: var(--ink-strong);
  background: transparent;
  border: 1.5px solid var(--border);
}
.si-consent-btn.si-decline:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}
.si-consent-btn.si-decline:active { transform: translateY(0); }

/* Footer "Cookie-Einstellungen" entry point (injected into .footer-legal nav) */
.si-consent-reopen {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
}
.si-consent-reopen:hover { text-decoration: underline; }

@media (max-width: 560px) {
  .si-consent {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
  }
  .si-consent-actions { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .si-consent-card {
    transition: opacity var(--duration-fast) linear;
    transform: none;
  }
  .si-consent.is-in .si-consent-card { transform: none; }
  .si-consent-btn.si-accept:hover,
  .si-consent-btn.si-decline:hover { transform: none; }
}
