:root {
  --ink: #1b1b1f;
  --muted: #6b6b76;
  --card-bg: #ffffff;
  --border: #e7e5ee;
  --accent: #6c5ce7;          /* overridden from settings */
  --accent-text: #ffffff;     /* overridden from settings */
  --gate-bg: #f3f1fb;         /* overridden from settings */
  --logo-h: 110px;             /* overridden from settings */
  --fine-color: #6b6b76;      /* overridden from settings */
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  overflow-x: hidden;
}

/* 4. Slowly shifting background gradient */
.gate {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: var(--gate-bg);
}

/* Optional slow shift, built from lighter tints of the chosen colour */
.gate--animated {
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--gate-bg) 45%, #ffffff),
    var(--gate-bg),
    color-mix(in srgb, var(--gate-bg) 70%, #fff4ea),
    var(--gate-bg),
    color-mix(in srgb, var(--gate-bg) 45%, #ffffff));
  background-size: 400% 400%;
  animation: bgShift 26s ease-in-out infinite;
}

/* On dark backgrounds, multiply-blending would make product images vanish */
.gate--dark .bg-img { mix-blend-mode: normal; }

@keyframes bgShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 2 & 3. Background product images: ripple entrance + ambient motion */
.bg-images {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.bg-img-wrap {
  position: absolute;
  top: 0;
  transition: transform 0.4s ease-out;
  will-change: transform;
}

/* continuous conveyor: starts below the screen, rises softly all the way past
   the top, fades out, and loops — the "reset" happens off-screen so it's
   never visible, which is what makes the loop feel seamless */
.bg-img-motion {
  animation: riseThrough var(--motion-dur, 34s) ease-in-out infinite var(--motion-delay, 0s);
}

.bg-img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 14px rgba(20, 10, 50, 0.05));
  mix-blend-mode: multiply;
}

@keyframes riseThrough {
  0%   { transform: translate(0, 80vh) rotate(var(--rot, 0deg)); opacity: 0; }
  8%   { opacity: var(--final-opacity, 0.9); }
  50%  { transform: translate(var(--sway, 12px), -45vh) rotate(var(--rot, 0deg)); }
  92%  { opacity: var(--final-opacity, 0.9); }
  100% { transform: translate(0, -180vh) rotate(var(--rot, 0deg)); opacity: 0; }
}

/* Decorative imagery, scaled down and toned back on phones so it reads as
   background texture rather than crowding the card. */
@media (max-width: 700px) {
  .bg-images { opacity: 0.6; }
  .bg-img-wrap { width: clamp(66px, 24vw, 155px) !important; }
  .logo img { height: min(var(--logo-h), 26vw); }
}

/* 1. Cascading entrance for logo / card / checkboxes / button */
.content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.enter {
  opacity: 0;
  transform: translateY(22px) scale(0.97);
  animation: fadeSlideIn 0.7s cubic-bezier(.16,1,.3,1) forwards;
}

@keyframes fadeSlideIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo {
  margin-bottom: 24px;
  max-width: 100%;
  animation-delay: 0.05s;
}
.logo img { height: var(--logo-h); max-width: 100%; width: auto; display: block; object-fit: contain; }

.card-wrap {
  position: relative;
  width: 100%;
  max-width: 430px;
}

.card-glow {
  position: absolute;
  inset: -30px;
  z-index: -1;
  border-radius: 40px;
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%);
  filter: blur(30px);
  opacity: 0;
  animation:
    glowIn 1s ease forwards 0.15s,
    glowPulse 6s ease-in-out infinite 1.1s;
}

@keyframes glowIn { to { opacity: 1; } }
@keyframes glowPulse {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.08); opacity: 1; }
}

.card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 26px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(30, 20, 70, 0.06);
  animation-delay: 0.2s;
}

h1 { font-size: 21px; margin: 0 0 8px; }
.card p.intro { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 18px; }

.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
}
.check-row:nth-of-type(1) { animation-delay: 0.35s; }
.check-row:nth-of-type(2) { animation-delay: 0.5s; }
.check-row p { margin: 0; font-size: 13.5px; line-height: 1.4; }

.box {
  width: 20px; height: 20px; flex: none;
  border: 2px solid #c9c6d6;
  border-radius: 6px;
  margin-top: 1px;
  position: relative;
  color: var(--accent-text);
  transition: border-color .15s ease, background-color .15s ease;
}
.check-row.checked .box { background: var(--accent); border-color: var(--accent); }
.box svg { position: absolute; inset: 0; margin: auto; opacity: 0; transform: scale(0.4); }
.check-row.checked .box svg { opacity: 1; }

/* 5. Checkbox "pop" feedback */
.check-row.pop .box { animation: checkPop 0.32s cubic-bezier(.34,1.56,.64,1); }
@keyframes checkPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.28); }
  100% { transform: scale(1); }
}

input[type="checkbox"] { display: none; }

.enter-btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border: none;
  border-radius: 12px;
  background: #d9d7e3;
  color: #8f8da0;
  font-size: 15px;
  font-weight: 600;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color .25s ease, color .25s ease, transform .2s ease, box-shadow .25s ease;
  animation-delay: 0.65s;
}

/* 5. Button lift + soft shadow once active, with a gentle "ready" pulse */
.enter-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  /* btnPulse replaces the .enter entrance animation, so lock in its end state;
     otherwise the button falls back to .enter's opacity:0 and disappears */
  opacity: 1;
  transform: none;
  animation: btnPulse 2.4s ease-in-out infinite;
}
.enter-btn.active:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 45%, transparent);
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 10px 20px color-mix(in srgb, var(--accent) 22%, transparent); }
  50%      { box-shadow: 0 14px 32px color-mix(in srgb, var(--accent) 42%, transparent); }
}

.fine-print {
  font-size: 12px;
  color: var(--fine-color);
  text-align: center;
  max-width: 430px;
  margin-top: 16px;
  line-height: 1.5;
}

/* 6. Respect reduced-motion preference completely */
@media (prefers-reduced-motion: reduce) {
  .gate, .gate--animated { animation: none; }
  .bg-img-motion { animation: none; transform: none; opacity: var(--final-opacity, 0.9); }
  .bg-img-wrap { transition: none; transform: none !important; }
  .enter { animation: none; opacity: 1; transform: none; }
  .check-row.pop .box { animation: none; }
  .card-glow { animation: none; opacity: 0.85; }
  .enter-btn.active { animation: none; }
  .enter-btn.active:hover { transform: none; }
}
