/* =========================================================================
 *  SMART STOPS · CAPTIVE PORTAL — playful / colorful / interactive
 * ========================================================================= */

:root {
  --bg-0: #07030f;
  --bg-1: #100922;
  --fg-0: #ffffff;
  --fg-1: #d6dce8;
  --fg-2: #97a1b8;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);

  --pink:   #fb7185;
  --purple: #c084fc;
  --indigo: #818cf8;
  --blue:   #38bdf8;
  --teal:   #34d399;
  --gold:   #fbbf24;

  --r-md: 14px;
  --r-lg: 22px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", system-ui, sans-serif;
  background: var(--bg-0);
  color: var(--fg-0);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* -- Background: colorful drifting blobs ---------------------------------- */
.bg-blobs {
  position: fixed; inset: 0; z-index: -2;
  pointer-events: none;
  filter: blur(60px) saturate(135%);
  opacity: 0.85;
  contain: strict;
}
.bg-blobs .blob {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: translate, transform;
  transition: translate .15s ease-out;
}
.blob-pink   { background: radial-gradient(circle, var(--pink)   0%, transparent 65%); top: -22%; left: -18%; animation: drift1 24s ease-in-out infinite; }
.blob-purple { background: radial-gradient(circle, var(--purple) 0%, transparent 65%); top:  35%; right: -22%; animation: drift2 28s ease-in-out infinite; }
.blob-blue   { background: radial-gradient(circle, var(--blue)   0%, transparent 65%); bottom: -25%; left: 12%; animation: drift3 32s ease-in-out infinite; }
.blob-teal   { background: radial-gradient(circle, var(--teal)   0%, transparent 65%); top:  55%; left: -18%; animation: drift4 30s ease-in-out infinite; }
.blob-gold   { background: radial-gradient(circle, var(--gold)   0%, transparent 65%); top: -10%; right: 8%; width: 42vmax; height: 42vmax; opacity: 0.6; animation: drift5 36s ease-in-out infinite; }

@keyframes drift1 { 0%,100% { transform: translate(0,0) scale(1);    } 50% { transform: translate(8vw,  6vh) scale(1.08); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0) scale(1);    } 50% { transform: translate(-9vw, 5vh) scale(1.05); } }
@keyframes drift3 { 0%,100% { transform: translate(0,0) scale(1);    } 50% { transform: translate(7vw,-7vh) scale(1.1);  } }
@keyframes drift4 { 0%,100% { transform: translate(0,0) scale(1);    } 50% { transform: translate(10vw,-4vh) scale(1.06); } }
@keyframes drift5 { 0%,100% { transform: translate(0,0) scale(1);    } 50% { transform: translate(-7vw, 8vh) scale(1.1);  } }

.bg-vignette {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.45) 100%),
    linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.25) 100%);
}

/* -- Main layout: centered everything ------------------------------------- */
.portal {
  width: 100%;
  max-width: 760px;
  padding: 1.75rem 1.25rem 2.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* -- Brand pill ----------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(52,211,153,0.18), 0 0 14px rgba(52,211,153,0.55);
  animation: pulseDot 1.8s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(52,211,153,0.15), 0 0 10px rgba(52,211,153,0.45); }
  50%      { box-shadow: 0 0 0 4px rgba(52,211,153,0.30), 0 0 22px rgba(52,211,153,0.75); }
}

/* -- Title / subtitle ----------------------------------------------------- */
.portal-head { text-align: center; }
.portal-head h1 {
  font-size: clamp(1.9rem, 6vw, 2.9rem);
  font-weight: 800;
  margin: 0.75rem 0 0;
  line-height: 1.06;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #f9a8d4 35%, #c4b5fd 65%, #93c5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(192,132,252,0.25));
}
.portal-head .subtitle {
  margin: 0.6rem auto 0;
  color: var(--fg-1);
  font-size: 1rem;
  font-weight: 400;
  max-width: 500px;
  line-height: 1.45;
}
.portal-head .portal-tag {
  margin: 0.85rem auto 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: linear-gradient(135deg, rgba(251,113,133,0.18), rgba(192,132,252,0.18));
  border: 1px solid rgba(192,132,252,0.35);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.portal-head .portal-tag .pin { filter: drop-shadow(0 0 6px rgba(251,113,133,0.6)); }

/* -- Ad stage: friendly rounded glass card -------------------------------- */
.ad-frame {
  width: 100%;
  position: relative;
}
.ad-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, #000 0%, #050310 100%);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.08) inset,
    0 25px 70px -25px rgba(192,132,252,0.55),
    0 35px 90px -50px rgba(251,113,133,0.5),
    0 0 0 1px rgba(192,132,252,0.18);
}
.ad-stage img,
.ad-stage video,
.ad-stage iframe {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  border: 0;
  display: block;
}
.ad-stage .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .4s ease; }
.ad-stage .slide.active { opacity: 1; }
.ad-empty {
  color: var(--fg-2);
  font-size: 0.95rem;
  text-align: center;
  padding: 0 1rem;
}

/* -- Sound toggle: tiny, low-key ----------------------------------------- */
.sound-toggle {
  position: absolute;
  bottom: 10px; right: 10px;
  z-index: 5;
  width: 32px; height: 32px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  opacity: 0.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .15s ease, border-color .15s ease, background .15s ease;
}
.sound-toggle:hover, .sound-toggle:focus-visible {
  opacity: 1; outline: none;
  border-color: rgba(192,132,252,0.5);
  background: rgba(192,132,252,0.25);
}
.sound-toggle .sound-ico { font-size: 0.9rem; line-height: 1; }
.sound-toggle .sound-lbl { display: none; }

/* -- Progress bar --------------------------------------------------------- */
.ad-progress {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.ad-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue));
  box-shadow: 0 0 14px rgba(192,132,252,0.55);
  transition: width .1s linear;
}

/* -- Terms ---------------------------------------------------------------- */
.terms {
  width: 100%;
  text-align: left;
  font-size: 0.82rem;
  color: var(--fg-1);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 0.75rem 1rem;
  line-height: 1.5;
}
.terms p { margin: 0; }

/* -- Accept button: pill with vibrant gradient ---------------------------- */
.accept-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.accept-form button {
  width: 100%;
  max-width: 460px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1.05rem 1.5rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #fb7185 0%, #c084fc 50%, #38bdf8 100%);
  background-size: 200% 200%;
  cursor: pointer;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.12) inset,
    0 14px 38px -10px rgba(192,132,252,0.7);
  animation: gradientShift 6s ease-in-out infinite;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.accept-form button .btn-arrow {
  font-size: 1.15rem;
  font-weight: 800;
  transition: transform .2s ease;
}
.accept-form button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.22) inset,
    0 18px 48px -10px rgba(251,113,133,0.8);
  filter: brightness(1.05) saturate(1.1);
}
.accept-form button:hover:not(:disabled) .btn-arrow { transform: translateX(4px); }
.accept-form button:active:not(:disabled) { transform: translateY(0) scale(0.99); }
.accept-form button:disabled {
  cursor: not-allowed;
  color: var(--fg-2);
  background: rgba(255,255,255,0.06);
  animation: none;
  box-shadow: none;
}
.accept-form button:disabled .btn-arrow { display: none; }
.accept-form button.unlocked { animation: bouncy .9s ease-in-out 1, gradientShift 6s ease-in-out infinite; }
@keyframes bouncy {
  0%   { transform: scale(0.94); }
  40%  { transform: scale(1.06); }
  70%  { transform: scale(0.98); }
  100% { transform: scale(1); }
}
.accept-form .warn {
  color: #fcd34d;
  font-size: 0.82rem;
  margin: 0;
  text-align: center;
  background: rgba(252,211,77,0.08);
  border: 1px solid rgba(252,211,77,0.25);
  padding: 0.5rem 0.85rem;
  border-radius: var(--r-md);
}

/* -- Footer --------------------------------------------------------------- */
.portal-foot {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-2);
}

/* -- Result page ---------------------------------------------------------- */
.portal-result { gap: 1.4rem; }
.result-icon {
  width: 96px; height: 96px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 800;
  position: relative;
}
.result-icon.ok {
  background: linear-gradient(135deg, var(--teal), #22d3ee);
  color: #07101f;
  box-shadow: 0 0 0 6px rgba(52,211,153,0.16), 0 25px 60px -10px rgba(52,211,153,0.55);
}
.result-icon.err {
  background: linear-gradient(135deg, var(--pink), #ef4444);
  color: #fff;
  box-shadow: 0 0 0 6px rgba(248,113,113,0.16), 0 25px 60px -10px rgba(248,113,113,0.55);
}
.err-msg {
  color: #fda4af;
  max-width: 92%;
  font-size: 0.85rem;
  word-break: break-word;
}
.continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.6rem;
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--blue));
  background-size: 200% 200%;
  animation: gradientShift 6s ease-in-out infinite;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 14px 38px -10px rgba(192,132,252,0.7);
  transition: transform .2s ease, filter .2s ease;
}
.continue-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* -- Responsive ----------------------------------------------------------- */
@media (max-width: 540px) {
  .portal { padding: 1.25rem 0.9rem 1.5rem; }
  .brand { font-size: 0.65rem; padding: 0.35rem 0.7rem; }
  .accept-form button { padding: 0.95rem 1.1rem; font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-blobs .blob, .brand-dot, .accept-form button, .continue-btn { animation: none !important; }
}
