:root {
  --bg: #f7f8ff;
  --bg-soft: #fcfcff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #1c2240;
  --text-soft: #64709a;
  --title: #121933;
  --border: rgba(131, 146, 201, 0.18);
  --shadow: 0 24px 80px rgba(76, 88, 140, 0.14);
  --shadow-soft: 0 16px 40px rgba(76, 88, 140, 0.08);
  --primary: #6f7cff;
  --primary-2: #8f6dff;
  --accent: #63c7ff;
  --success: #24c483;
  --danger: #ff6f91;
  --radius: 30px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #f7f8ff 0%, #f5f8ff 52%, #ffffff 100%);
  color: var(--text);
  overflow: hidden;
}

.app-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.blur {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.45;
}

.blur-one {
  width: 360px;
  height: 360px;
  background: rgba(108, 124, 255, 0.26);
  top: 50px;
  left: -40px;
  animation: driftOne 14s ease-in-out infinite;
}

.blur-two {
  width: 420px;
  height: 420px;
  background: rgba(99, 199, 255, 0.2);
  right: -60px;
  top: 180px;
  animation: driftTwo 18s ease-in-out infinite;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(126, 146, 223, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 146, 223, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 38%, transparent 88%);
}

.app-shell {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.loading-screen,
.iframe-screen {
  position: absolute;
  inset: 0;
  transition: opacity 0.6s ease, visibility 0.6s ease, transform 0.6s ease;
}

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
}

.loading-screen.hide {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  pointer-events: none;
}

.loading-card {
  width: 100%;
  max-width: 760px;
  padding: 34px;
  border-radius: 34px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94) 0%, rgba(250,252,255,0.9) 100%);
  border: 1px solid rgba(255,255,255,0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 14px 34px rgba(111, 124, 255, 0.3);
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 1rem;
}

.brand-text,
.iframe-brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong,
.iframe-brand-text strong {
  color: var(--title);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-text span,
.iframe-brand-text span {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.scanner-wrap {
  position: relative;
  width: 142px;
  height: 142px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
}

.scanner-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(111, 124, 255, 0.18);
}

.scanner-ring-one {
  inset: 0;
  animation: pulseRing 2.2s ease-in-out infinite;
}

.scanner-ring-two {
  inset: 18px;
  animation: pulseRing 2.2s ease-in-out infinite 0.45s;
}

.scanner-core {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(111,124,255,0.12), rgba(99,199,255,0.16));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
  position: relative;
}

.scanner-core::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px dashed rgba(111, 124, 255, 0.22);
  animation: rotateCore 8s linear infinite;
}

.scanner-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #7be6b3);
  box-shadow: 0 0 0 10px rgba(36, 196, 131, 0.12);
}

.loading-copy {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 28px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(131, 146, 201, 0.18);
  color: #5f6d97;
  box-shadow: var(--shadow-soft);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.loading-copy h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  color: var(--title);
  margin-bottom: 14px;
}

.loading-copy p {
  color: var(--text-soft);
  font-size: 1.03rem;
}

.steps {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(137, 152, 208, 0.12);
  opacity: 0.5;
  transform: scale(0.985);
  transition: 0.28s ease;
}

.step.active {
  opacity: 1;
  transform: scale(1);
  background: linear-gradient(135deg, rgba(111,124,255,0.08), rgba(99,199,255,0.08));
  border-color: rgba(111, 124, 255, 0.18);
  box-shadow: 0 14px 32px rgba(95, 109, 160, 0.08);
}

.step-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 24px rgba(111, 124, 255, 0.22);
}

.step-text {
  display: flex;
  flex-direction: column;
}

.step-text strong {
  color: var(--title);
  font-size: 0.98rem;
}

.step-text small {
  color: var(--text-soft);
  font-size: 0.86rem;
}

.progress-area {
  margin-bottom: 18px;
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #5f6d97;
  font-weight: 700;
  font-size: 0.92rem;
}

.progress-top strong {
  color: var(--title);
}

.progress-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(208, 216, 244, 0.52);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(87, 97, 132, 0.08);
}

.progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  box-shadow: 0 8px 22px rgba(111, 124, 255, 0.28);
  transition: width 0.22s ease;
}

.loading-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #62709b;
  font-size: 0.92rem;
  font-weight: 600;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(36, 196, 131, 0.45);
  animation: pulseDot 1.8s infinite;
}

.iframe-screen {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 14px;
}

.iframe-screen.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.iframe-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.86);
  border: 1px solid rgba(255,255,255,0.82);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.iframe-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(131, 146, 201, 0.18);
  color: #58678f;
  font-weight: 700;
}

.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(36, 196, 131, 0.14);
}

.iframe-wrap {
  flex: 1;
  min-height: 0;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.82);
  box-shadow: var(--shadow);
}

.iframe-wrap iframe {
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 110px);
  border: 0;
  display: block;
  background: #fff;
}

@keyframes pulseRing {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.06);
    opacity: 1;
  }
}

@keyframes rotateCore {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(36, 196, 131, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(36, 196, 131, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(36, 196, 131, 0);
  }
}

@keyframes driftOne {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(26px, 28px, 0); }
}

@keyframes driftTwo {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-20px, 22px, 0); }
}

@media (max-width: 768px) {
  body {
    overflow: auto;
  }

  .loading-screen {
    padding: 16px;
  }

  .loading-card {
    padding: 22px;
    border-radius: 28px;
  }

  .loading-copy h1 {
    font-size: 2rem;
  }

  .loading-copy p {
    font-size: 0.96rem;
  }

  .step {
    align-items: flex-start;
  }

  .iframe-screen {
    padding: 10px;
  }

  .iframe-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .live-pill {
    justify-content: center;
  }

  .iframe-wrap {
    border-radius: 22px;
  }

  .iframe-wrap iframe {
    min-height: calc(100vh - 150px);
  }
}