/* css/beta-gate.css — WAYLAB-BETA-GATE (T-1240).
   Только префикс .wlbg-*; глобальные :root-токены не переопределяются. */

.wlbg-root {
  --wlbg-bg-0: #04101a;
  --wlbg-bg-1: #071520;
  --wlbg-bg-2: #0b1620;
  --wlbg-card-1: #13232f;
  --wlbg-card-2: #0a1520;
  --wlbg-ink-0: #f0fdfa;
  --wlbg-ink-1: #c3d1d2;
  --wlbg-ink-2: #9fb4b6;
  --wlbg-teal-100: #ccfbf1;
  --wlbg-teal-300: #5eead4;
  --wlbg-teal-400: #2dd4bf;
  --wlbg-teal-500: #14b8a6;
  --wlbg-teal-600: #0d9488;
  --wlbg-teal-700: #0f766e;
  --wlbg-amber-300: #fcd34d;
  --wlbg-amber-400: #fbbf24;
  --wlbg-amber-500: #f59e0b;
  --wlbg-amber-700: #b45309;
  --wlbg-cta-ink: #04231f;
  --wlbg-radius-card: 20px;
  --wlbg-radius-cta: 14px;
  --wlbg-dur-in: 220ms;
  --wlbg-dur-out: 140ms;
  --wlbg-ease-out: cubic-bezier(.22, 1, .36, 1);

  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: var(--wlbg-bg-0);
  background-image:
    radial-gradient(1100px 760px at 50% -12%, rgba(13, 110, 110, .42), transparent 62%),
    radial-gradient(900px 680px at 88% 112%, rgba(180, 83, 9, .20), transparent 66%),
    radial-gradient(720px 560px at 6% 88%, rgba(56, 189, 248, .12), transparent 68%),
    linear-gradient(162deg, #051019 0%, var(--wlbg-bg-1) 46%, var(--wlbg-bg-0) 100%);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  animation: wlbg-overlay-in 200ms ease-out both;
}

.wlbg-root[hidden] { display: none; }

.wlbg-root.is-leaving {
  animation: wlbg-overlay-out var(--wlbg-dur-out) ease-in both;
  pointer-events: none;
}

/* ---- Сцена: свечения и частицы ---- */
.wlbg-aurora,
.wlbg-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.wlbg-aurora { z-index: 0; }
.wlbg-stars { z-index: 0; }

.wlbg-glow {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: .55;
  animation: wlbg-float 18s ease-in-out infinite;
}

.wlbg-glow-a {
  top: -14%;
  right: -8%;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(20, 184, 166, .55) 0%, rgba(13, 110, 110, .18) 52%, transparent 72%);
}

.wlbg-glow-b {
  bottom: -16%;
  left: -10%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(180, 83, 9, .42) 0%, rgba(180, 83, 9, .12) 55%, transparent 74%);
  animation-duration: 22s;
  animation-delay: -7s;
}

.wlbg-glow-c {
  top: 42%;
  left: 54%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(56, 189, 248, .28) 0%, transparent 70%);
  animation-duration: 26s;
  animation-delay: -13s;
}

.wlbg-star {
  position: absolute;
  display: block;
  border-radius: 50%;
  opacity: .2;
  background: radial-gradient(circle, rgba(240, 253, 250, .95) 0%, rgba(94, 234, 212, .6) 52%, transparent 72%);
  animation: wlbg-twinkle 5s ease-in-out infinite;
}

.wlbg-star:nth-child(1)  { left: 8%;  top: 18%; width: 4px; height: 4px; animation-duration: 4200ms; animation-delay: -400ms; }
.wlbg-star:nth-child(2)  { left: 16%; top: 72%; width: 3px; height: 3px; animation-duration: 5000ms; animation-delay: -1600ms; }
.wlbg-star:nth-child(3)  { left: 24%; top: 34%; width: 5px; height: 5px; animation-duration: 6000ms; animation-delay: -2800ms; }
.wlbg-star:nth-child(4)  { left: 38%; top: 12%; width: 3px; height: 3px; animation-duration: 4600ms; animation-delay: -900ms; }
.wlbg-star:nth-child(5)  { left: 52%; top: 82%; width: 4px; height: 4px; animation-duration: 5400ms; animation-delay: -3400ms; }
.wlbg-star:nth-child(6)  { left: 64%; top: 26%; width: 3px; height: 3px; animation-duration: 4800ms; animation-delay: -2100ms; }
.wlbg-star:nth-child(7)  { left: 72%; top: 64%; width: 5px; height: 5px; animation-duration: 6400ms; animation-delay: -200ms; }
.wlbg-star:nth-child(8)  { left: 84%; top: 16%; width: 4px; height: 4px; animation-duration: 5200ms; animation-delay: -1200ms; }
.wlbg-star:nth-child(9)  { left: 90%; top: 46%; width: 3px; height: 3px; animation-duration: 4400ms; animation-delay: -3900ms; }
.wlbg-star:nth-child(10) { left: 44%; top: 52%; width: 3px; height: 3px; animation-duration: 5800ms; animation-delay: -2500ms; }
.wlbg-star:nth-child(11) { left: 30%; top: 88%; width: 4px; height: 4px; animation-duration: 4900ms; animation-delay: -1900ms; }
.wlbg-star:nth-child(12) { left: 78%; top: 90%; width: 3px; height: 3px; animation-duration: 5600ms; animation-delay: -3100ms; }

/* ---- Карточка ---- */
.wlbg-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-width: 100%;
  padding: 28px 28px 24px;
  border: 1px solid rgba(45, 212, 191, .22);
  border-radius: var(--wlbg-radius-card);
  background-color: var(--wlbg-bg-2);
  background-image: linear-gradient(168deg, var(--wlbg-card-1) 0%, var(--wlbg-bg-2) 58%, var(--wlbg-card-2) 100%);
  box-shadow:
    0 28px 70px rgba(2, 8, 16, .62),
    inset 0 2px 0 rgba(240, 253, 250, .04),
    0 0 0 1px rgba(2, 8, 16, .28);
  text-align: center;
  animation: wlbg-card-in var(--wlbg-dur-in) var(--wlbg-ease-out) both;
}

.wlbg-root.is-leaving .wlbg-card {
  animation: wlbg-card-out var(--wlbg-dur-out) ease-in both;
}

/* ---- Маршрут ---- */
.wlbg-route { margin: -2px -6px 14px; }

.wlbg-route-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.wlbg-route-path,
.wlbg-route-flow {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wlbg-route-path {
  stroke: var(--wlbg-teal-300);
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 5px rgba(45, 212, 191, .5));
  animation: wlbg-route-draw 1200ms cubic-bezier(.65, .05, .36, 1) 180ms both;
}

.wlbg-route-flow {
  stroke: var(--wlbg-teal-100);
  stroke-width: 2.2;
  stroke-dasharray: .02 .03;
  stroke-dashoffset: 0;
  opacity: 0;
  animation: wlbg-route-flow 3600ms linear 1500ms infinite both;
}

.wlbg-route-dot {
  fill: var(--wlbg-teal-300);
  stroke: #06121b;
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: wlbg-dot-in 260ms ease-out both;
}

.wlbg-route-dot-start { animation-delay: 180ms; }

.wlbg-route-dot-end {
  fill: var(--wlbg-amber-400);
  animation-delay: 1220ms;
}

.wlbg-route-pulse {
  fill: none;
  stroke: var(--wlbg-amber-400);
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: wlbg-end-pulse 2200ms ease-out 1500ms infinite both;
}

/* ---- Бейдж ---- */
.wlbg-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(251, 191, 36, .28);
  border-radius: 999px;
  background: rgba(251, 191, 36, .10);
  color: var(--wlbg-amber-300);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .04em;
}

.wlbg-badge-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--wlbg-amber-400);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .18);
  animation: wlbg-blink 2400ms ease-in-out infinite;
}

/* ---- Тексты ---- */
.wlbg-title {
  margin: 14px 0 0;
  color: var(--wlbg-ink-0);
  font-size: clamp(1.5rem, 5.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.03em;
  text-wrap: balance;
}

.wlbg-text {
  max-width: 34ch;
  margin: 10px auto 0;
  color: var(--wlbg-ink-1);
  font-size: .9375rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ---- CTA ---- */
.wlbg-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin: 20px 0 0;
  padding: 0 20px;
  border: 0;
  border-radius: var(--wlbg-radius-cta);
  background-color: var(--wlbg-teal-400);
  background-image: linear-gradient(118deg, #5eead4 0%, #2dd4bf 44%, #14b8a6 100%);
  color: var(--wlbg-cta-ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow:
    0 10px 26px rgba(20, 184, 166, .26),
    inset 0 1px 0 rgba(255, 255, 255, .38);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.wlbg-cta::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -38%;
  width: 34%;
  height: 220%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, .55) 50%, transparent 100%);
  transform: translateX(-140%) rotate(18deg);
  animation: wlbg-shine 4200ms ease-in-out 900ms infinite;
  pointer-events: none;
}

.wlbg-cta-label,
.wlbg-cta-arrow {
  position: relative;
  z-index: 1;
}

.wlbg-cta-arrow {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 180ms ease;
}

.wlbg-cta:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    0 16px 32px rgba(20, 184, 166, .38),
    inset 0 1px 0 rgba(255, 255, 255, .44);
}

.wlbg-cta:hover .wlbg-cta-arrow { transform: translateX(3px); }

.wlbg-cta:active {
  transform: translateY(0) scale(.985);
  box-shadow:
    0 6px 16px rgba(20, 184, 166, .3),
    inset 0 1px 0 rgba(255, 255, 255, .3);
}

.wlbg-cta:focus-visible {
  outline: 2px solid var(--wlbg-amber-400);
  outline-offset: 3px;
  box-shadow:
    0 0 0 6px rgba(251, 191, 36, .22),
    0 10px 26px rgba(20, 184, 166, .26);
}

.wlbg-cta:disabled,
.wlbg-cta[aria-busy="true"] {
  opacity: .62;
  cursor: progress;
  transform: none;
  filter: none;
}

.wlbg-cta:disabled::after,
.wlbg-cta[aria-busy="true"]::after {
  animation: none;
  opacity: 0;
}

/* ---- Тикер ---- */
.wlbg-ticker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--wlbg-ink-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  font-size: .75rem;
  line-height: 1.3;
  letter-spacing: .02em;
}

.wlbg-ticker-dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--wlbg-teal-400);
  box-shadow: 0 0 8px rgba(45, 212, 191, .8);
  animation: wlbg-breathe 1800ms ease-in-out infinite;
}

/* ---- Keyframes ---- */
@keyframes wlbg-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes wlbg-overlay-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes wlbg-card-in {
  0%   { opacity: 0; transform: translateY(10px) scale(.9); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wlbg-card-out {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(.96); }
}

@keyframes wlbg-route-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

@keyframes wlbg-route-flow {
  0%   { stroke-dashoffset: 0; opacity: 0; }
  10%  { opacity: .5; }
  90%  { opacity: .5; }
  100% { stroke-dashoffset: -1; opacity: 0; }
}

@keyframes wlbg-dot-in {
  0%   { opacity: 0; transform: scale(.4); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes wlbg-end-pulse {
  0%   { opacity: .55; transform: scale(1); }
  70%  { opacity: 0;   transform: scale(3.2); }
  100% { opacity: 0;   transform: scale(3.2); }
}

@keyframes wlbg-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33%      { transform: translate3d(24px, -18px, 0) scale(1.08); }
  66%      { transform: translate3d(-18px, 14px, 0) scale(.94); }
}

@keyframes wlbg-twinkle {
  0%, 100% { opacity: .12; transform: scale(.8); }
  50%      { opacity: .85; transform: scale(1.15); }
}

@keyframes wlbg-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px rgba(251, 191, 36, .18); }
  50%      { opacity: .45; box-shadow: 0 0 0 5px rgba(251, 191, 36, .06); }
}

@keyframes wlbg-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .35; transform: scale(.82); }
}

@keyframes wlbg-shine {
  0%, 62% { transform: translateX(-140%) rotate(18deg); }
  100%    { transform: translateX(420%) rotate(18deg); }
}

/* ---- Респонсив ---- */
@media (max-width: 380px) {
  .wlbg-card { padding: 24px 18px 20px; }
  .wlbg-title { font-size: 1.375rem; }
  .wlbg-text { font-size: .875rem; line-height: 1.5; }
  .wlbg-route { margin-bottom: 12px; }
  .wlbg-cta { min-height: 48px; margin-top: 18px; font-size: .9375rem; }
}

@media (max-height: 560px) {
  .wlbg-route { display: none; }
  .wlbg-card { padding-top: 22px; padding-bottom: 18px; }
  .wlbg-title { font-size: 1.375rem; }
  .wlbg-text { margin-top: 8px; }
  .wlbg-cta { min-height: 46px; margin-top: 16px; }
  .wlbg-ticker { margin-top: 12px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .wlbg-root { animation: none; }
  .wlbg-root.is-leaving { animation: none; opacity: 0; }
  .wlbg-card { animation: none; }
  .wlbg-root.is-leaving .wlbg-card { animation: none; }
  .wlbg-cta { transition: none; }
  .wlbg-cta:hover { transform: none; }
  .wlbg-cta:hover .wlbg-cta-arrow { transform: none; }
  .wlbg-cta::after { animation: none; opacity: 0; }
  .wlbg-glow,
  .wlbg-star,
  .wlbg-badge-dot,
  .wlbg-ticker-dot,
  .wlbg-route-pulse { animation: none; }
  .wlbg-route-path { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
  .wlbg-route-dot { animation: none; opacity: 1; transform: none; }
  .wlbg-route-flow { display: none; }
  .wlbg-star { opacity: .32; }
}
