/* ==================================================
   QCEG MAG — Luxury Consent Popup (FINAL)
================================================== */

/* ===============================
   DESIGN TOKENS
================================ */
:root {
  --qceg-black: #000000;
  --qceg-soft-black: #0b0b0b;
  --qceg-gold: #c8a24d;
  --qceg-gold-soft: rgba(200,162,77,0.35);
  --qceg-gray: #9a9a9a;
  --qceg-white: #ffffff;
  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===============================
   OVERLAY (TOPMOST LAYER)
================================ */
.qceg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 2147483647; /* MAX SAFE Z-INDEX */

  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s var(--ease-editorial);
}

.qceg-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ===============================
   MODAL
================================ */
.qceg-modal {
  position: relative;
  overflow: hidden;

  background: linear-gradient(180deg, #0b0b0b 0%, #000 100%);
  width: 90%;
  max-width: 580px;
  max-height: 90vh;

  padding: 56px 54px;
  border-radius: 18px;
  text-align: center;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;

  border: 1px solid var(--qceg-gold-soft);
  box-shadow: 0 40px 120px rgba(0,0,0,0.7);

  opacity: 0;
  transform: translateY(28px) scale(0.985);
  transition: all 1.1s var(--ease-editorial);

  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.qceg-overlay.active .qceg-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ===============================
   LOGO + FOIL SHIMMER
================================ */
.qceg-logo {
  font-size: 28px;
  letter-spacing: 2px;
  font-weight: 600;
  color: var(--qceg-gold);
  margin-bottom: 6px;
  position: relative;
}

.qceg-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 30%,
    rgba(255,255,255,0.35) 50%,
    transparent 70%
  );
  opacity: 0;
  transform: translateX(-40%);
}

.qceg-logo:hover::after {
  opacity: 1;
  animation: qcegFoilShimmer 1.4s var(--ease-editorial);
}

@keyframes qcegFoilShimmer {
  from { transform: translateX(-40%); }
  to   { transform: translateX(120%); }
}

/* ===============================
   GOLD HAIRLINE
================================ */
.qceg-hairline {
  width: 0;
  height: 1px;
  margin: 18px auto 26px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--qceg-gold),
    transparent
  );
  opacity: 0.85;
  transition: width 1.2s var(--ease-editorial);
}

.qceg-overlay.active .qceg-hairline {
  width: 120px;
}

/* ===============================
   LANGUAGE SELECTOR
================================ */
.qceg-lang {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 26px;
}

.qceg-lang button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--qceg-gray);
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 999px;
  cursor: pointer;
}

.qceg-lang button.active {
  color: var(--qceg-gold);
  border-color: var(--qceg-gold-soft);
}

/* ===============================
   TYPOGRAPHY
================================ */
.qceg-title {
  font-size: 22px;
  color: var(--qceg-white);
  margin-bottom: 16px;
}

.qceg-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--qceg-gray);
  margin-bottom: 30px;
}

/* ===============================
   CONSENT OPTIONS (CENTERED)
================================ */
.qceg-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--qceg-gray);
  margin-bottom: 32px;
}

.qceg-options label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qceg-options input {
  accent-color: var(--qceg-gold);
}

/* ===============================
   LEGAL LINKS
================================ */
.qceg-legal {
  font-size: 13px;
  color: var(--qceg-gray);
  margin-bottom: 34px;
}

.qceg-legal a {
  color: var(--qceg-gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(200,162,77,0.4);
}

/* ===============================
   ACTION BUTTONS
================================ */
.qceg-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.qceg-btn {
  padding: 14px 38px;
  font-size: 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.35s var(--ease-editorial);
}

.qceg-btn.primary {
  background: linear-gradient(135deg, #d6b15a, #b8943e);
  color: #000;
  border: none;
}

.qceg-btn.secondary {
  background: transparent;
  color: var(--qceg-gray);
  border: 1px solid rgba(255,255,255,0.18);
}

.qceg-btn:hover {
  transform: translateY(-2px);
}

/* ===============================
   MICRO FILM GRAIN
================================ */
.qceg-grain {
  position: absolute;
  inset: -100%;
  pointer-events: none;
  opacity: 0.045;
  z-index: 1;

  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");

  animation: qcegGrainMove 6s steps(10) infinite;
}

.qceg-modal > *:not(.qceg-grain) {
  position: relative;
  z-index: 2;
}

@keyframes qcegGrainMove {
  0%   { transform: translate(0,0); }
  25%  { transform: translate(-2%,1%); }
  50%  { transform: translate(1%,-2%); }
  75%  { transform: translate(2%,1%); }
  100% { transform: translate(0,0); }
}

/* ===============================
   MOBILE OPTIMIZATION
================================ */
@media (max-width: 480px) {
  .qceg-modal {
    padding: 40px 28px;
  }
}

@media (max-width: 360px) {
  .qceg-lang {
    flex-wrap: wrap;
    gap: 10px;
  }
}
