/* Cookie Consent Card — Folveo Landing
   Brand colors từ docs/brand-guidelines.md
   Navy: #0D203D | Cyan: #22D3EE | Gradient: #A855F7 → #3B82F6

   Floating card (thay full-width bar): ít chặn nội dung, trông như notice
   thân thiện thay vì rào cản pháp lý → tăng tỷ lệ tương tác/accept. */

.cc-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: min(400px, calc(100vw - 48px));
  background: linear-gradient(165deg, #14294e 0%, #0d203d 100%);
  border: 1px solid rgba(34, 211, 238, 0.18);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.3);
  color: #fff;
  z-index: 9999;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
  opacity: 0;
  transform: translateY(16px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease-out, transform 0.28s ease-out, visibility 0s linear 0.28s;
}

.cc-banner.cc-visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.28s ease-out, transform 0.28s ease-out, visibility 0s;
}

.cc-banner__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cc-banner__icon {
  width: 20px;
  height: 20px;
  color: #22d3ee;
  flex-shrink: 0;
}

.cc-banner__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.cc-banner__text {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.78);
}

.cc-banner__text a {
  color: #22d3ee;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner__text a:hover {
  color: #67e8f9;
}

.cc-banner__text a:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
  border-radius: 2px;
}

.cc-banner__actions {
  display: flex;
  gap: 10px;
}

.cc-btn {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  transition: filter 0.15s ease, background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}

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

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

/* Accept: primary, chiếm phần lớn hàng, đặt bên phải (vị trí hành động mặc định) */
.cc-btn--accept {
  order: 2;
  flex: 1;
  background: linear-gradient(135deg, #a855f7, #3b82f6);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}

.cc-btn--accept:hover {
  filter: brightness(1.1);
}

/* Reject: secondary ghost — vẫn rõ ràng, 1 click (GDPR) nhưng không cạnh tranh thị giác */
.cc-btn--reject {
  order: 1;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.cc-btn--reject:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

@media (max-width: 640px) {
  .cc-banner {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 18px 16px;
  }
  .cc-banner__actions {
    flex-direction: column;
    gap: 8px;
  }
  /* Mobile xếp dọc: Accept lên TRÊN, Reject dưới */
  .cc-btn--accept {
    order: 1;
  }
  .cc-btn--reject {
    order: 2;
  }
  .cc-btn {
    width: 100%;
  }
}

/* Trang có mobile sticky download bar (styles.css): card nổi phía trên bar
   thay vì che nút Download — không hy sinh CTA chính của trang */
@media (max-width: 760px) {
  body:has(.mobile-cta-bar) .cc-banner {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner,
  .cc-btn {
    transition: none;
  }
}
