/* ════════════════════════════════════════════════════════════════════
 * v10.253 · Cookie / Consent banner · Claude.com-style
 *
 * Per user reference (claude.com/download): bottom-right corner
 * positioned, compact card, no icons, clean buttons, minimal flair.
 * Still keeps Astarter's dark + subtle purple accent for brand
 * cohesion.
 *
 * Controller: js/cookie-consent.js
 * ════════════════════════════════════════════════════════════════════ */

.consent-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  top: auto;
  z-index: 9000;
  display: block;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity .2s ease,
    transform .22s cubic-bezier(.2,.8,.2,1);
}
.consent-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.consent-banner.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

/* Panel · corner card */
.consent-banner__panel {
  pointer-events: auto;
  position: relative;
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 26px 26px 22px;
  border-radius: 18px;
  color: #fff;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: rgba(10, 6, 20, 0.96);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
/* Expanded mode · wider to fit 3 buttons (Reject / Save / Accept) */
.consent-banner__panel--expanded {
  width: 540px;
}

/* Close (×) button */
.consent-banner__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
  z-index: 2;
}
.consent-banner__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.consent-banner__close:focus-visible {
  outline: 2px solid rgba(157, 92, 255, 0.7);
  outline-offset: 2px;
}

/* Head */
.consent-banner__head { margin: 0 0 18px; padding-right: 24px; }
.consent-banner__title {
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: #fff;
}
.consent-banner__intro {
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  margin: 0;
}

/* Rows */
.consent-banner__list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.consent-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  transition: background .18s ease, border-color .18s ease;
}
.consent-row:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.10);
}
.consent-row__main { flex: 1; min-width: 0; }
.consent-row__name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 2px;
  letter-spacing: -0.005em;
}
.consent-row__desc {
  font-size: 0.76rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* Toggle */
.consent-toggle {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 18px;
  cursor: pointer;
}
.consent-toggle input {
  position: absolute; inset: 0;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.consent-toggle__track {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background .18s ease;
}
.consent-toggle__dot {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform .22s cubic-bezier(.34, 1.5, .64, 1);
}
.consent-toggle input:focus-visible ~ .consent-toggle__track {
  outline: 2px solid rgba(157, 92, 255, 0.6);
  outline-offset: 2px;
}
.consent-toggle input:checked ~ .consent-toggle__track {
  background: #6f00ff;
}
.consent-toggle input:checked ~ .consent-toggle__track .consent-toggle__dot {
  transform: translateX(14px);
}
.consent-toggle--locked .consent-toggle__track {
  background: #6f00ff;
  opacity: 0.5;
  cursor: not-allowed;
}
.consent-toggle--locked input { cursor: not-allowed; }
.consent-toggle--locked .consent-toggle__dot { transform: translateX(14px); }

/* Actions */
.consent-banner__actions {
  display: flex;
  gap: 10px;
}
.consent-btn {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
  white-space: normal;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Expanded mode · 3 buttons share the row, tighten padding + shrink font */
.consent-banner__panel--expanded .consent-btn {
  font-size: 0.84rem;
  padding: 11px 10px;
}
.consent-btn:focus-visible { outline: 2px solid rgba(157, 92, 255, 0.7); outline-offset: 2px; }

.consent-btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.20);
}
.consent-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.36);
}

.consent-btn--primary {
  background: #6f00ff;
  color: #fff;
}
.consent-btn--primary:hover {
  background: #7c1aff;
}

/* Customize button · full width, ghost style, slightly more prominent */
.consent-btn--customize {
  width: 100%;
  margin: 0 0 10px;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 0.95rem;
  padding: 13px 18px;
  border-radius: 10px;
}
.consent-btn--customize:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.45);
}

/* Privacy link */
.consent-banner__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  font-size: 0.78rem;
  color: rgba(157, 92, 255, 0.85);
  text-decoration: none;
  font-weight: 500;
  transition: color .18s ease;
}
.consent-banner__link:hover { color: #fff; }

/* ── v10.457 · bottom-padding reservation while banner is visible ──
 * The banner is `position: fixed; bottom: 10px` and on mobile spans the
 * full width with ~350-600 px height. Without reserving space below the
 * normal document flow, the banner overlays the bottom of the page ·
 * specifically the footer link columns · and intercepts taps on links
 * like A-Core and ISPO Dashboard (bug repro pre-v10.457: on first visit,
 * footer links underneath the banner were untappable on phone).
 * cookie-consent.js sets `body.has-consent-banner` + the
 * `--consent-banner-offset` CSS variable to the live banner height + a
 * 24 px buffer. Cleared on dismiss. Belt-and-braces: fall back to a
 * safe default if the variable is missing (e.g. ResizeObserver missing). */
body.has-consent-banner {
  padding-bottom: var(--consent-banner-offset, 420px);
}

/* Mobile (<= 600px) · full-width strip at bottom; expanded buttons stack */
@media (max-width: 600px) {
  .consent-banner {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .consent-banner__panel,
  .consent-banner__panel--expanded {
    width: 100%;
    padding: 22px 20px 18px;
    border-radius: 16px;
  }
  .consent-banner__title { font-size: 1.18rem; }
  .consent-banner__intro { font-size: 0.88rem; }
  .consent-row { padding: 10px 12px; }
  .consent-btn { padding: 12px 14px; font-size: 0.86rem; }
  /* On phones, stack the 3-button expanded action row */
  .consent-banner__panel--expanded .consent-banner__actions {
    flex-direction: column;
  }
  .consent-banner__panel--expanded .consent-btn {
    flex: 1 0 auto;
    font-size: 0.86rem;
    padding: 12px 14px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .consent-banner,
  .consent-banner__panel,
  .consent-toggle__dot,
  .consent-row,
  .consent-btn,
  .consent-banner__link,
  .consent-banner__close {
    transition: none !important;
  }
}
