/* LibOTP open / loading splash — privacy story while server waits */
.libotp-splash {
  --sp-bg0: #071018;
  --sp-bg1: #0c1a24;
  --sp-mint: #3dffc5;
  --sp-amber: #fb923c;
  --sp-sky: #60a5fa;
  --sp-text: #e8f1f5;
  --sp-muted: #8aa0ad;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(700px 420px at 80% 10%, rgba(61, 255, 197, 0.12), transparent 55%),
    radial-gradient(500px 360px at 10% 90%, rgba(96, 165, 250, 0.1), transparent 50%),
    linear-gradient(165deg, var(--sp-bg0), var(--sp-bg1) 60%, #0a1620);
  color: var(--sp-text);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  opacity: 1;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.libotp-splash.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.libotp-splash__inner {
  width: min(420px, 100%);
  text-align: center;
}

.libotp-splash__logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.1rem;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(61, 255, 197, 0.22);
  animation: splashLogoIn 0.7s ease both, splashLogoPulse 2.4s ease-in-out 0.7s infinite;
}

.libotp-splash__logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.libotp-splash__brand {
  font-family: 'Bricolage Grotesque', 'IBM Plex Sans', sans-serif;
  font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 2.15rem);
  letter-spacing: -0.04em;
  margin: 0 0 0.35rem;
  animation: splashFadeUp 0.55s ease 0.1s both;
}

.libotp-splash__tag {
  margin: 0 0 1.35rem;
  color: var(--sp-muted);
  font-size: 0.95rem;
  animation: splashFadeUp 0.55s ease 0.18s both;
}

/* Scene: person + phones */
.libotp-splash__scene {
  position: relative;
  height: 168px;
  margin: 0 auto 1.35rem;
  animation: splashFadeUp 0.6s ease 0.25s both;
}

.libotp-splash__person {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 88px;
  height: 130px;
  transform: translateX(-50%);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.libotp-splash__person.is-out {
  opacity: 0;
  transform: translateX(-50%) scale(0.92);
  pointer-events: none;
}

.libotp-splash__head {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 50%;
  background: linear-gradient(160deg, #d4a574, #b8835a);
  position: relative;
}

.libotp-splash__person[data-gender='female'] .libotp-splash__head::before {
  content: '';
  position: absolute;
  left: -6px;
  right: -6px;
  top: -4px;
  height: 28px;
  border-radius: 20px 20px 8px 8px;
  background: #2a1f18;
  z-index: -1;
}

.libotp-splash__person[data-gender='male'] .libotp-splash__head::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: -2px;
  height: 10px;
  border-radius: 0 0 8px 8px;
  background: #3a2a22;
}

.libotp-splash__body {
  width: 54px;
  height: 58px;
  margin: 6px auto 0;
  border-radius: 18px 18px 12px 12px;
  background: linear-gradient(180deg, #1a3a44, #123038);
  position: relative;
}

.libotp-splash__person[data-gender='female'] .libotp-splash__body {
  width: 48px;
  border-radius: 16px 16px 22px 22px;
  background: linear-gradient(180deg, #1e4a52, #164048);
}

.libotp-splash__arm {
  position: absolute;
  width: 14px;
  height: 36px;
  border-radius: 10px;
  background: #1a3a44;
  top: 8px;
  right: -10px;
  transform-origin: top center;
  animation: splashArm 1.8s ease-in-out infinite;
}

.libotp-splash__phone {
  position: absolute;
  right: calc(50% - 118px);
  top: 18px;
  width: 54px;
  height: 92px;
  border-radius: 10px;
  background: #0a141c;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: splashPhoneIn 0.7s ease 0.35s both;
}

.libotp-splash__phone::before {
  content: '';
  display: block;
  height: 8px;
  background: #142230;
}

.libotp-splash__phone-screen {
  padding: 8px 6px;
  font-size: 0.55rem;
  line-height: 1.25;
  color: var(--sp-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
}

.libotp-splash__phone-screen .blur-num {
  filter: blur(3px);
  opacity: 0.55;
  text-decoration: line-through;
  color: #f87171;
}

.libotp-splash__vphone {
  position: absolute;
  left: calc(50% - 118px);
  top: 28px;
  width: 58px;
  height: 98px;
  border-radius: 12px;
  background: linear-gradient(160deg, #123038, #0a1c24);
  border: 2px solid rgba(61, 255, 197, 0.45);
  box-shadow: 0 0 0 1px rgba(61, 255, 197, 0.15), 0 12px 32px rgba(61, 255, 197, 0.15);
  overflow: hidden;
  animation: splashVphone 2.2s ease-in-out infinite;
}

.libotp-splash__vphone::before {
  content: 'VIRTUAL';
  display: block;
  text-align: center;
  font-size: 0.45rem;
  letter-spacing: 0.12em;
  color: var(--sp-mint);
  padding: 6px 0 4px;
  font-weight: 700;
}

.libotp-splash__otp {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px 0;
}

.libotp-splash__otp span {
  width: 10px;
  height: 14px;
  border-radius: 3px;
  background: rgba(61, 255, 197, 0.15);
  border: 1px solid rgba(61, 255, 197, 0.35);
  color: var(--sp-mint);
  font-size: 0.55rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  animation: splashDigit 1.6s ease-in-out infinite;
}

.libotp-splash__otp span:nth-child(2) {
  animation-delay: 0.12s;
}
.libotp-splash__otp span:nth-child(3) {
  animation-delay: 0.24s;
}
.libotp-splash__otp span:nth-child(4) {
  animation-delay: 0.36s;
}

.libotp-splash__shield {
  position: absolute;
  left: 50%;
  top: 4px;
  transform: translateX(-50%);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sp-mint);
  background: rgba(61, 255, 197, 0.1);
  border: 1px solid rgba(61, 255, 197, 0.28);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  animation: splashShield 2s ease-in-out infinite;
}

.libotp-splash__tip {
  min-height: 4.6rem;
  padding: 0 0.25rem;
  animation: splashFadeUp 0.55s ease 0.3s both;
}

.libotp-splash__tip h2 {
  font-family: 'Bricolage Grotesque', 'IBM Plex Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.45rem;
  transition: opacity 0.35s ease;
}

.libotp-splash__tip p {
  margin: 0;
  color: var(--sp-muted);
  font-size: 0.92rem;
  line-height: 1.45;
  transition: opacity 0.35s ease;
}

.libotp-splash__tip.is-swap h2,
.libotp-splash__tip.is-swap p {
  opacity: 0;
}

.libotp-splash__dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin: 1.1rem 0 0.85rem;
}

.libotp-splash__dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.25s, transform 0.25s;
}

.libotp-splash__dots i.on {
  background: var(--sp-mint);
  transform: scale(1.2);
}

.libotp-splash__bar {
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.libotp-splash__bar > span {
  display: block;
  height: 100%;
  width: 35%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sp-mint), var(--sp-sky));
  animation: splashBar 1.15s ease-in-out infinite;
}

.libotp-splash__status {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: var(--sp-muted);
  letter-spacing: 0.04em;
}

@keyframes splashLogoIn {
  from {
    opacity: 0;
    transform: scale(0.7) rotate(-8deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes splashLogoPulse {
  0%,
  100% {
    box-shadow: 0 12px 40px rgba(61, 255, 197, 0.22);
  }
  50% {
    box-shadow: 0 14px 48px rgba(61, 255, 197, 0.4);
  }
}

@keyframes splashFadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splashArm {
  0%,
  100% {
    transform: rotate(8deg);
  }
  50% {
    transform: rotate(22deg);
  }
}

@keyframes splashPhoneIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splashVphone {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes splashDigit {
  0%,
  100% {
    background: rgba(61, 255, 197, 0.12);
  }
  40% {
    background: rgba(61, 255, 197, 0.35);
  }
}

@keyframes splashShield {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

@keyframes splashBar {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .libotp-splash__logo,
  .libotp-splash__arm,
  .libotp-splash__vphone,
  .libotp-splash__otp span,
  .libotp-splash__bar > span,
  .libotp-splash__shield {
    animation: none !important;
  }
}
