/* ═══════════════════════════════════════════════════════════════
   CYNO.GG — Cookie Consent (Floating card, GDPR-equal-prominence)
   Redesign 2026-06-25.
   Goals:
     - Smaller footprint (corner card, not full-width bar)
     - Accept and Decline visually equal (no dark pattern)
     - Tight typography, clear hierarchy (title → body → links)
     - Mobile reverts to full-width bottom sheet
   ═══════════════════════════════════════════════════════════════ */

.cookie-consent-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  right: auto;
  width: 420px;
  max-width: calc(100vw - 40px);
  z-index: 10000;
  background:
    radial-gradient(140% 90% at 100% 0%, rgba(123, 220, 255, 0.07), transparent 55%),
    linear-gradient(160deg, rgba(11, 16, 28, 0.94), rgba(6, 9, 18, 0.96));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 16px;
  padding: 20px 20px 16px;
  /* Horizontally centered. Off-screen 20px on first paint, slides to 0 on .is-visible. */
  transform: translate(-50%, 20px);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s ease;
  box-shadow:
    0 12px 40px rgba(2, 6, 14, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.cookie-consent-banner.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.cookie-consent-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

/* Close (decline shortcut) — equal weight to other dismiss paths */
.cookie-consent-close {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.cookie-consent-close:hover {
  background: color-mix(in srgb, var(--glass-bg) 60%, transparent);
  color: var(--text);
}

.cookie-consent-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Text block — title, body, policy links */
.cookie-consent-text {
  padding-right: 36px;  /* clear the close button */
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.cookie-consent-title {
  display: block;
  font-family: var(--font-display, inherit);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 6px;
}

.cookie-consent-text p {
  margin: 0;
}

.cookie-consent-text p + p {
  margin-top: 8px;
}

.cookie-consent-links {
  font-size: 12px;
  color: var(--text-muted);
}

.cookie-consent-links a {
  color: var(--text-soft);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--text-muted) 40%, transparent);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.cookie-consent-links a:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 60%, transparent);
}

/* Actions row — three buttons of equal visual weight */
.cookie-consent-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}

.cookie-btn {
  flex: 1;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-display, inherit);
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--glass-border) 60%, transparent);
  background: color-mix(in srgb, var(--glass-bg) 50%, transparent);
  color: var(--text);
  text-transform: uppercase;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.2s ease;
  white-space: nowrap;
}

.cookie-btn:hover {
  background: color-mix(in srgb, var(--glass-bg-strong) 70%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  transform: translateY(-1px);
}

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

.cookie-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* GDPR: Accept and Decline must look equally prominent.
   We give them identical structural styles; only a subtle 1px accent line
   on Accept signals it's the affirmative choice without being a dark pattern. */
.cookie-btn-accept {
  position: relative;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}

.cookie-btn-accept:hover {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    0 4px 14px rgba(123, 220, 255, 0.08);
}

/* Customize — secondary text-style button */
.cookie-btn-settings {
  flex: 0 0 auto;
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  padding: 9px 10px;
  letter-spacing: 0.05em;
}

.cookie-btn-settings:hover {
  background: color-mix(in srgb, var(--glass-bg) 40%, transparent);
  border-color: transparent;
  color: var(--text-soft);
  transform: none;
}

/* ── Cookie Settings Modal — unchanged structure, light polish ──── */
.cookie-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cookie-settings-modal.is-visible {
  opacity: 1;
  visibility: visible;
}

.cookie-settings-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 12, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cookie-settings-dialog {
  position: relative;
  background:
    radial-gradient(120% 90% at 12% 8%, rgba(123, 220, 255, 0.05), transparent 56%),
    linear-gradient(160deg, rgba(16, 24, 40, 0.97), rgba(11, 18, 34, 0.98));
  border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 16px;
  padding: 24px;
  max-width: 460px;
  width: 92%;
  max-height: 82vh;
  overflow-y: auto;
  box-shadow:
    0 20px 50px rgba(2, 6, 14, 0.65),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.cookie-settings-dialog h3 {
  color: var(--text);
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cookie-settings-dialog h3 + .cookie-setting {
  margin-top: 10px;
}

.cookie-setting {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--glass-border) 30%, transparent);
}

.cookie-setting:last-of-type {
  border-bottom: none;
}

.cookie-setting-info {
  flex: 1;
  padding-right: 16px;
}

.cookie-setting-name {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.cookie-setting-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}

/* Toggle switch (unchanged) */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-left: 16px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-2);
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, var(--glass-border) 40%, transparent);
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.cookie-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background: color-mix(in srgb, var(--accent) 30%, var(--bg-2));
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.cookie-toggle input:checked + .cookie-toggle-slider::before {
  transform: translateX(20px);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(123, 220, 255, 0.4);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-settings-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--glass-border) 30%, transparent);
}

.cookie-settings-actions .cookie-btn {
  flex: 0 0 auto;
  min-width: 140px;
}

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner,
  .cookie-settings-modal,
  .cookie-btn,
  .cookie-consent-close {
    transition: none !important;
  }
}

/* ── Responsive: mobile reverts to full-width bottom sheet ─ */
@media (max-width: 540px) {
  .cookie-consent-banner {
    bottom: 0;
    right: 0;
    left: 0;
    width: auto;
    max-width: none;
    border-radius: 16px 16px 0 0;
    padding: 18px 16px 16px;
    /* Cancel the desktop -50% horizontal centering. */
    transform: translate(0, 100%);
  }

  .cookie-consent-banner.is-visible {
    transform: translate(0, 0);
  }

  .cookie-consent-actions {
    gap: 6px;
  }

  .cookie-btn-settings {
    flex: 1 0 100%;
    order: 3;
    padding: 8px;
  }
}
