/* ============================================================
   Poddle — Analytics consent banner
   Dark glass theme matching the Poddle brand.
   ============================================================ */

.ac-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  padding: 0 var(--pad) max(18px, env(safe-area-inset-bottom));
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.ac-wrap.ac-gone {
  opacity: 0;
  transform: translateY(20px);
}

.ac-bar {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 18px;
  padding: 16px 20px;
  border-radius: 20px;
  background: linear-gradient(158deg, rgba(23,21,28,0.96), rgba(17,15,21,0.96));
  -webkit-backdrop-filter: blur(26px) saturate(1.5);
          backdrop-filter: blur(26px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 18px 48px -18px rgba(0,0,0,0.85);
  pointer-events: auto;
}

.ac-body {
  flex: 1 1 260px;
  min-width: 0;
}
.ac-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  line-height: 1.2;
}
.ac-text {
  margin: 5px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--fg-3);
}

.ac-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.ac-btn {
  border: 0;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 11px 18px;
  cursor: pointer;
  white-space: nowrap;
  transition: filter .15s, transform .08s, box-shadow .15s;
}
.ac-btn:hover { filter: brightness(1.18); }
.ac-btn:active { transform: scale(0.96); }

.ac-btn--decline {
  background: rgba(255,255,255,0.08);
  color: var(--fg-2);
  border: 1px solid rgba(255,255,255,0.12);
}
.ac-btn--decline:hover { background: rgba(255,255,255,0.12); }

.ac-btn--allow {
  background: var(--gradient-pink);
  color: #fff;
  box-shadow: 0 8px 22px -8px rgba(255,47,158,0.55);
}

/* reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .ac-wrap { transition: none; }
  .ac-pref-trigger { transition: none; }
  .ac-pref-panel { transition: none; }
}

/* ---- preferences trigger (visible only after declined consent) ---- */
.ac-pref-trigger {
  position: fixed;
  right: 16px;
  bottom: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 999;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(23,21,28,0.94);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
          backdrop-filter: blur(18px) saturate(1.3);
  color: var(--fg-3);
  opacity: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), box-shadow 0.2s;
  animation: ac-pref-in 0.35s var(--ease) both;
}

.ac-pref-trigger:hover {
  color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.25);
}
.ac-pref-trigger:focus-visible {
  color: #fff;
  outline: 2px solid var(--pink-400);
  outline-offset: 2px;
}
.ac-pref-trigger:active { transform: scale(0.94); }
.ac-pref-trigger svg {
  width: 18px;
  height: 18px;
}
@keyframes ac-pref-in {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---- preferences panel ---- */
.ac-pref-panel {
  position: fixed;
  right: 16px;
  bottom: 64px;
  bottom: max(64px, calc(env(safe-area-inset-bottom) + 48px));
  z-index: 1001;
  max-width: 300px;
  width: calc(100vw - 32px);
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(158deg, rgba(23,21,28,0.98), rgba(17,15,21,0.98));
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
          backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 48px -12px rgba(0,0,0,0.85);
  animation: ac-pref-in 0.25s var(--ease) both;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

/* Landing mobile: the trigger is the third direct header child. */
@media (max-width: 767px) {
  body.landing .topbar__in {
    padding-top: 9px;
    padding-bottom: 9px;
  }
  body.landing .topbar__in > .ac-pref-trigger {
    position: static;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
  }
  body.landing .ac-pref-panel {
    top: 64px;
    right: 12px;
    bottom: auto;
    left: auto;
    width: min(300px, calc(100vw - 24px));
  }
}

/* Landing tablet and desktop: use the approved lower-right empty gutter. */
@media (min-width: 768px) {
  body.landing .ac-pref-trigger {
    position: fixed;
    right: 24px;
    bottom: max(108px, calc(env(safe-area-inset-bottom) + 92px));
    width: 38px;
    height: 38px;
  }
  body.landing .ac-pref-panel {
    top: auto;
    right: 24px;
    bottom: max(154px, calc(env(safe-area-inset-bottom) + 138px));
    left: auto;
  }
}
.ac-pref-panel.ac-pref-gone {
  opacity: 0;
  transform: translateY(12px) scale(0.95);
  pointer-events: none;
}
.ac-pref-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--fg-3);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.15s;
}
.ac-pref-close:hover { color: #fff; }
.ac-pref-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--fg-1);
}
.ac-pref-status {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-3);
}
.ac-pref-status span {
  color: var(--fg-1);
}
.ac-pref-text {
  margin: 8px 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--fg-3);
}
.ac-pref-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.ac-pref-actions .ac-btn {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  font-size: 11.5px;
}
.ac-btn--active {
  box-shadow: inset 0 0 0 2px var(--pink-500), 0 0 14px rgba(255,47,158,0.4);
}
