/*
 * Cookie consent banner + modal for cclabs.app.
 *
 * Self-contained — does not rely on the site's :root tokens, because three
 * pages (index.html, 404.html, remote/index.html) define their tokens inline
 * rather than via guide-styles.css. Hardcoded values match the site palette
 * (#0d0d1a / #1a1a2e dark surfaces, #ff69b4 / #9b59b6 neon).
 *
 * Loaded by /assets/cookie-consent.js and not required by anything else;
 * safe to remove together if the consent system is ever taken out.
 */

.cc-banner,
.cc-modal-backdrop {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  color: #ffffff;
  box-sizing: border-box;
}

.cc-banner *,
.cc-modal-backdrop *,
.cc-blocked-placeholder * {
  box-sizing: border-box;
}

/* ─── Bottom banner ──────────────────────────────────────────────────── */

.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99998;
  background: rgba(13, 13, 26, 0.97);
  border-top: 1px solid rgba(255, 105, 180, 0.25);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5),
    0 -2px 30px rgba(255, 105, 180, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.25rem 1.5rem;
}

.cc-banner-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 720px) {
  .cc-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }
}

.cc-banner-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #d8d8e8;
  margin: 0;
}

.cc-banner-text a {
  color: #ff69b4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner-text a:hover {
  color: #ff8faf;
}

.cc-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* ─── Buttons (equal prominence per Italian Garante) ────────────────── */

.cc-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease,
    transform 100ms ease;
  letter-spacing: 0.02em;
  min-width: 110px;
}

.cc-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.cc-btn:active {
  transform: scale(0.97);
}

.cc-btn:focus-visible {
  outline: 2px solid #ff69b4;
  outline-offset: 2px;
}

/* ─── Modal (Customize / Cookie preferences) ────────────────────────── */

.cc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.cc-modal {
  background: #1a1a2e;
  border: 1px solid rgba(255, 105, 180, 0.25);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(255, 105, 180, 0.12);
  max-width: 560px;
  width: 100%;
  padding: 2rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
}

.cc-modal h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  background: linear-gradient(135deg, #ff69b4 0%, #9b59b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cc-modal-lede {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #b0b0c0;
  margin: 0 0 1.5rem 0;
}

.cc-modal-lede a {
  color: #ff69b4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Toggle rows */

.cc-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cc-toggle:last-of-type {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 1.5rem;
}

.cc-toggle-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: #ffffff;
}

.cc-toggle-info p {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #909098;
  margin: 0;
}

.cc-toggle-info code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
}

.cc-toggle-locked {
  font-size: 0.75rem;
  color: #707090;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-top: 4px;
}

/* Custom switch */

.cc-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.cc-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-switch-track {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 180ms ease;
}

.cc-switch-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 180ms ease;
}

.cc-switch input:checked + .cc-switch-track {
  background: linear-gradient(135deg, #ff69b4 0%, #9b59b6 100%);
}

.cc-switch input:checked + .cc-switch-track::before {
  transform: translateX(20px);
}

.cc-switch input:focus-visible + .cc-switch-track {
  outline: 2px solid #ff69b4;
  outline-offset: 2px;
}

/* Modal action row */

.cc-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* ─── Click-to-load placeholder for blocked third-party iframes ─────── */

.cc-blocked-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  background: linear-gradient(
      135deg,
      rgba(255, 105, 180, 0.08) 0%,
      rgba(155, 89, 182, 0.06) 100%
    ),
    #1e1e3a;
  text-align: center;
  font-family: 'Poppins', -apple-system, sans-serif;
}

.cc-blocked-placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}

.cc-blocked-placeholder-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.cc-blocked-placeholder-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: #b0b0c0;
  margin: 0;
  max-width: 380px;
}

.cc-blocked-placeholder-text code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
}

/* Pink CTA button used for "Allow third-party content" inside placeholder
 * and "Save preferences" inside the modal. Visually distinct from the
 * neutral .cc-btn so users know it's the affirmative action. */
.cc-btn-primary {
  background: linear-gradient(135deg, #ff69b4 0%, #9b59b6 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 105, 180, 0.35);
}

.cc-btn-primary:hover {
  background: linear-gradient(135deg, #ff8faf 0%, #b06bd1 100%);
  border-color: transparent;
  box-shadow: 0 6px 28px rgba(255, 105, 180, 0.45);
}

/* ─── Footer "Cookie preferences" link ──────────────────────────────── */

#cc-footer-link {
  cursor: pointer;
}

/* Hide elements until JS decides what to render — avoids a flash of the
 * banner during page load on slow connections. */
.cc-hidden {
  display: none !important;
}

/* ─── Age gate (18+ confirmation) ───────────────────────────────────── */

.cc-age-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000; /* above cookie banner (99998) and modal (99999) */
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  color: #ffffff;
  overflow-y: auto;
}

.cc-age-modal {
  background: #1a1a2e;
  border: 1px solid rgba(255, 105, 180, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(255, 105, 180, 0.15);
  max-width: 460px;
  width: 100%;
  padding: 2.5rem 2rem;
  text-align: center;
}

.cc-age-modal h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
  background: linear-gradient(135deg, #ff69b4 0%, #9b59b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cc-age-modal p {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #d8d8e8;
  margin: 0 0 1.75rem 0;
}

.cc-age-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .cc-age-actions {
    flex-direction: row;
  }
}

.cc-age-btn {
  flex: 1;
  appearance: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.95rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 100ms ease, background-color 200ms ease,
    box-shadow 200ms ease, border-color 200ms ease, color 200ms ease;
}

.cc-age-btn:active {
  transform: scale(0.97);
}

.cc-age-btn:focus-visible {
  outline: 2px solid #ff69b4;
  outline-offset: 3px;
}

.cc-age-btn-confirm {
  background: linear-gradient(135deg, #ff69b4 0%, #9b59b6 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 20px rgba(255, 105, 180, 0.4);
}

.cc-age-btn-confirm:hover {
  background: linear-gradient(135deg, #ff8faf 0%, #b06bd1 100%);
  box-shadow: 0 6px 28px rgba(255, 105, 180, 0.55);
}

.cc-age-btn-leave {
  background: transparent;
  color: #b0b0c0;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.cc-age-btn-leave:hover {
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.cc-age-fineprint {
  margin-top: 1.75rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #707090;
}

/* While the age gate is up, prevent the page from scrolling and ensure the
 * underlying content isn't keyboard-reachable. */
html.cc-age-pending,
html.cc-age-pending body {
  overflow: hidden !important;
}
