/* Cookie banner — base tokens when front-page.css is not loaded */
.cm-cookie-banner {
  --cm-bg: #0d1117;
  --cm-surface: #161b22;
  --cm-accent: #14b8a6;
  --cm-text-primary: #f8fafc;
  --cm-text-muted: #94a3b8;
}

.cm-cookie-banner .cm-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: none;
  background: var(--cm-accent);
  color: #041412;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.cm-cookie-banner .cm-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--cm-text-primary);
  font-weight: 500;
  text-decoration: none;
}

/* Legal pages + cookie banner */

.cm-legal-page {
  min-height: 100vh;
}

.cm-legal-main {
  padding: 7rem clamp(1rem, 2.5vw, 2rem) 4rem;
}

.cm-legal-container {
  max-width: 820px;
  margin: 0 auto;
}

.cm-legal-h1 {
  font-family: var(--cm-font-heading);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: normal;
  color: var(--cm-heading-color);
  text-shadow: var(--cm-heading-glow);
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.cm-legal-updated {
  color: var(--cm-text-muted);
  font-size: 0.9rem;
  margin: 0 0 2rem;
}

.cm-legal-content section {
  margin-bottom: 2rem;
}

.cm-legal-content h2 {
  font-family: var(--cm-font-heading);
  font-size: 1.25rem;
  font-weight: normal;
  color: var(--cm-text-primary);
  margin: 0 0 0.85rem;
}

.cm-legal-content p,
.cm-legal-content li {
  color: var(--cm-text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.cm-legal-content ul {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.cm-legal-content a {
  color: var(--cm-accent);
  text-decoration: none;
}

.cm-legal-content a:hover {
  text-decoration: underline;
}

.cm-legal-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.cm-legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.cm-legal-table th,
.cm-legal-table td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.cm-legal-table th {
  background: rgba(22, 27, 34, 0.8);
  color: var(--cm-text-primary);
  font-weight: 600;
}

.cm-legal-table td {
  color: var(--cm-text-muted);
}

.cm-legal-table code {
  font-size: 0.82rem;
  color: var(--cm-accent);
}

.cm-nav-menu--legal {
  margin-right: 0.35rem;
}

.cm-footer-bottom .cm-disclaimer a {
  color: var(--cm-accent);
  text-decoration: none;
}

.cm-footer-bottom .cm-disclaimer a:hover {
  text-decoration: underline;
}

/* Cookie banner */
.cm-cookie-banner[hidden] {
  display: none !important;
}

.cm-cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  padding: 0.85rem clamp(0.75rem, 2vw, 1.25rem) calc(0.85rem + env(safe-area-inset-bottom));
  transform: translateY(110%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.35s ease;
  pointer-events: none;
}

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

.cm-cookie-banner-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: rgba(22, 27, 34, 0.88);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.cm-cookie-banner-text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--cm-text-muted);
}

.cm-cookie-banner-text a {
  color: var(--cm-accent);
  text-decoration: none;
}

.cm-cookie-banner-text a:hover {
  text-decoration: underline;
}

.cm-cookie-banner-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.65rem;
  align-items: center;
}

.cm-cookie-banner .cm-btn-primary,
.cm-cookie-banner .cm-btn-secondary {
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .cm-cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cm-cookie-banner-actions {
    flex-direction: column;
  }

  .cm-cookie-banner .cm-btn-primary,
  .cm-cookie-banner .cm-btn-secondary {
    width: 100%;
    text-align: center;
  }
}
