/* =========================
   Cookie Design Tokens
========================= */

:root {
  --cookie-bg: var(--surface);
  --cookie-text: var(--text);
  --cookie-muted: var(--muted);
  --cookie-border: var(--border);
  --cookie-soft: var(--section-soft);

  --cookie-accent: var(--leaf);
  --cookie-accent-soft: rgba(78, 192, 166, 0.25);

  --cookie-radius: 18px;
  --cookie-shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

/* =========================
   Cookie Banner Overlay
========================= */

.cookie-banner {
  position: fixed;
  inset: 0;
  background: rgba(11, 16, 32, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* =========================
   Cookie Card
========================= */

.cookie-card {
  background: var(--cookie-bg);
  color: var(--cookie-text);
  width: min(92vw, 460px);
  padding: clamp(1.75rem, 3vw, 2.25rem);
  border-radius: var(--cookie-radius);
  box-shadow: var(--cookie-shadow);
  animation: cookieFadeIn 0.35s ease;
}

.cookie-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
  opacity: 0.95;
  min-height: 80px;
  animation: cookieLogoBeat 1.8s ease-in-out infinite alternate;
}

.cookie-logo svg {
  width: clamp(120px, 18vw, 150px);
  height: auto;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.35));
  transition: transform 0.4s ease, filter 0.4s ease;
}

.cookie-logo svg:hover,
.cookie-logo svg:focus-visible {
  transform: translateY(-3px) scale(1.05);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

@keyframes cookieLogoBeat {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.03);
  }
}

@keyframes cookieFadeIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================
   Typography
========================= */

.cookie-card h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.cookie-card p {
  margin: 0 0 1.5rem;
  color: var(--cookie-muted);
  font-size: clamp(0.9rem, 1.9vw, 0.98rem);
  line-height: 1.6;
}

/* =========================
   Cookie Options
========================= */

.cookie-option {
  position: relative;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.9rem;
  font-size: clamp(0.9rem, 1.9vw, 1rem);
}

.cookie-option label {
  cursor: pointer;
  color: var(--cookie-text);
}

.cookie-option__hint {
  display: block;
  font-size: 0.75rem;
  color: var(--cookie-muted);
  margin-top: 0.15rem;
}

.cookie-option input[type="checkbox"] {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 2px solid var(--leaf);
  background: var(--surface);
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.cookie-option input[type="checkbox"]::after {
  content: "";
  width: 12px;
  height: 6px;
  border-left: 3px solid var(--surface);
  border-bottom: 3px solid var(--surface);
  transform: rotate(-45deg) scale(0.8);
  opacity: 0;
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.cookie-option input[type="checkbox"]:checked {
  background: var(--leaf);
  border-color: var(--leaf);
  box-shadow: 0 0 0 4px rgba(78, 192, 166, 0.25);
}

.cookie-option input[type="checkbox"]:checked::after {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.cookie-option input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(245, 182, 87, 0.5);
}

.cookie-option input[type="checkbox"]:disabled {
  border-color: var(--cookie-soft);
  background: var(--cookie-soft);
  cursor: not-allowed;
}

.cookie-option input[type="checkbox"]:disabled + label {
  opacity: 0.65;
  font-weight: 600;
}

/* =========================
   Actions
========================= */

.cookie-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
}

.cookie-actions .btn {
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cookie-actions .btn.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);

  padding: 0.6rem 1.1rem;
  border-radius: 10px;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);

  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.cookie-actions .btn.secondary:hover {
  background: rgba(52, 84, 209, 0.05);
  border-color: rgba(52, 84, 209, 0.25);
  color: var(--text);
}

.cookie-actions .btn.primary {
  background: var(--cookie-accent);
  color: white;
  border: none;
  padding: 0.65rem 1.25rem;
  box-shadow: var(--glow);
}

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

/* =========================
   Footer & Meta
========================= */

.cookie-footer {
  margin-top: 1.25rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--cookie-muted);
}

.cookie-footer__tag {
  font-weight: 600;
  color: var(--cookie-text);
}

.cookie-footer__divider {
  color: var(--cookie-muted);
}

.cookie-footer a {
  color: var(--cookie-muted);
  text-decoration: underline;
}

.cookie-footer-links {
  margin-top: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--cookie-muted);
}

.cookie-footer-links a {
  color: var(--cookie-muted);
  text-decoration: underline;
}

/* =========================
   Floating Cookie Button
========================= */

.cookie-fab {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;

  width: 48px;
  height: 48px;
  border-radius: 50%;

  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);

  color: var(--text);

  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);

  cursor: pointer;
  z-index: 9998;

  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.cookie-fab span {
  display: inline-block;
  font-size: 1.25rem;
  opacity: 0.75;
  transition:
    transform 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
}

.cookie-fab:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.cookie-fab:hover span {
  transform: rotate(360deg);
  opacity: 1;
}

/* =========================
   Utility
========================= */

.hidden {
  display: none !important;
}
@media (prefers-reduced-motion: reduce) {
  .cookie-card,
  .cookie-fab span {
    animation: none;
    transition: none;
  }
}

@media (max-width: 768px) {
  .cookie-card {
    width: min(94vw, 420px);
  }

  .cookie-actions {
    gap: 0.85rem;
  }
}

@media (max-width: 480px) {
  .cookie-banner {
    padding: 1rem;
    background: rgba(11, 16, 32, 0.65);
  }

  .cookie-card {
    width: 100%;
    max-width: 100%;
    padding: 1.5rem 1.25rem;
    border-radius: 14px;
  }

  .cookie-card p {
    margin-bottom: 1.25rem;
  }

  .cookie-option {
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .cookie-option input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }

  .cookie-actions {
    flex-direction: column-reverse;
    gap: 0.75rem;
  }

  .cookie-actions .btn {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .cookie-footer {
    margin-top: 1rem;
    line-height: 1.5;
  }

  .cookie-fab {
    width: 44px;
    height: 44px;
    bottom: 0.85rem;
    left: 0.85rem;
  }

  .cookie-fab span {
    font-size: 1.15rem;
  }
}
