/* Legal — cookies, modals, a11y widget, demo ribbon */

.demo-ribbon {
  position: fixed;
  top: 0;
  inset-inline: 0;
  width: 100%;
  z-index: 8000;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--demo-h);
  padding: 0.4rem 1rem;
  background: #121218;
  color: rgba(255,255,255,.88);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.demo-ribbon a {
  color: #c4b5fd;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.demo-ribbon a:hover { color: #ddd6fe; opacity: 1; }

/* Cookie card — Gym-style floating panel */
.cookie-banner {
  position: fixed;
  inset-inline-start: 1.15rem;
  bottom: 1.15rem;
  z-index: 9000;
  width: min(420px, calc(100vw - 2.3rem));
  padding: 1.2rem 1.3rem;
  background: linear-gradient(160deg, rgba(255,255,255,.98), rgba(248,248,250,.97));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transform: translateY(120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.5s var(--ease, cubic-bezier(0.22,1,0.36,1)), opacity 0.4s;
}

.cookie-banner.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.cookie-banner__title {
  font-size: 1.02rem;
  font-weight: 650;
  margin-bottom: 0.3rem;
  color: #16161c;
}

.cookie-banner__text {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.55;
}

.cookie-banner__text button {
  background: none;
  border: none;
  font: inherit;
  color: #4338ca;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}

.cookie-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.cookie-btn {
  padding: 0.62rem 1.1rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, color 0.2s;
  border: none;
}

.cookie-btn:hover { transform: translateY(-1px); }

.cookie-btn--secondary {
  background: transparent;
  color: #222;
  border: 1px solid rgba(0,0,0,.16);
}

.cookie-btn--secondary:hover { background: #f3f3f5; }

.cookie-btn--primary {
  background: #16161c;
  color: #fff;
}

.cookie-btn--primary:hover { background: #2a2a34; }

.legal-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.legal-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.legal-modal {
  background: #fff;
  color: #222;
  border-radius: 16px;
  width: min(640px, 100%);
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.28);
  transform: translateY(18px) scale(0.98);
  transition: transform 0.35s var(--ease, cubic-bezier(0.22,1,0.36,1));
}

.legal-modal-overlay.is-open .legal-modal {
  transform: translateY(0) scale(1);
}

.legal-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.45rem;
  border-bottom: 1px solid #eee;
}

.legal-modal__title { font-size: 1.12rem; font-weight: 650; }

.legal-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  background: #f4f4f6;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legal-modal__close:hover { background: #e8e8ec; }

.legal-modal__body {
  padding: 1.45rem;
  overflow-y: auto;
  font-size: 0.94rem;
  line-height: 1.75;
  color: #444;
}

.legal-modal__body h3 {
  font-size: 1rem;
  font-weight: 650;
  color: #1a1a1a;
  margin: 1.2rem 0 0.45rem;
}

.legal-modal__body h3:first-child { margin-top: 0; }

.legal-modal__body ul {
  margin: 0.45rem 1.2rem 0 0;
  padding: 0;
  list-style: disc;
}

.legal-modal__body li { margin-bottom: 0.32rem; }

.legal-modal__body a { color: #4338ca; text-decoration: underline; }

/* Accessibility widget */
.a11y-widget {
  position: fixed;
  bottom: 1.35rem;
  inset-inline-end: 1.35rem;
  z-index: 8500;
}

.a11y-widget__toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #16161c;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.a11y-widget__toggle:hover {
  transform: scale(1.06);
  background: #2a2a34;
}

.a11y-widget__toggle svg { width: 24px; height: 24px; }

.a11y-widget__panel {
  position: absolute;
  bottom: calc(100% + 0.75rem);
  inset-inline-end: 0;
  width: 268px;
  background: #fff;
  color: #222;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}

.a11y-widget__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.a11y-widget__panel h3 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
  color: #333;
}

.a11y-widget__btn {
  display: block;
  width: 100%;
  padding: 0.52rem 0.7rem;
  margin-bottom: 0.35rem;
  border: 1px solid #e6e6ea;
  border-radius: 8px;
  background: #fafafa;
  font: inherit;
  font-size: 0.84rem;
  text-align: right;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.a11y-widget__btn:hover {
  background: #f0f0f3;
  border-color: #ccc;
}

.a11y-widget__btn.is-active {
  background: #16161c;
  color: #fff;
  border-color: #16161c;
}

@media (max-width: 640px) {
  .cookie-banner {
    inset-inline: 0.75rem;
    bottom: 5.5rem;
    width: auto;
  }
  .a11y-widget { inset-inline-end: 0.85rem; bottom: 0.85rem; }
}
