/* ─────────────────────────────────────────
   TOKENS
───────────────────────────────────────── */
:root {
  --bg: #04050f;
  --s1: rgba(8, 10, 28, 0.86);
  --s2: rgba(14, 18, 42, 0.60);
  --border: rgba(255, 255, 255, 0.065);
  --borderhi: rgba(139, 92, 246, 0.4);

  --blue: #3b82f6;
  --purp: #8b5cf6;
  --pink: #ec4899;

  --grad: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 55%, #ec4899 100%);
  --gbtn: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 50%, #be185d 100%);
  --gname: linear-gradient(135deg, #93c5fd 0%, #c4b5fd 45%, #f9a8d4 100%);

  --text: #f1f3ff;
  --t2: rgba(241, 243, 255, 0.50);
  --t3: rgba(241, 243, 255, 0.24);

  --ok: #34d399;
  --err: #f87171;
  --inf: #60a5fa;
  --r: 15px;
}

/* ─────────────────────────────────────────
   RESET
───────────────────────────────────────── */
html {
  -webkit-text-size-adjust: none !important;
  text-size-adjust: none !important;
  font-size: 16px !important;
  zoom: 1
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  outline: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none
}

input {
  -webkit-user-select: text;
  user-select: text
}

::selection {
  background: rgba(139, 92, 246, .22)
}

/* ─────────────────────────────────────────
   BODY + GRAIN
───────────────────────────────────────── */
body {
  font-family: 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

/* grain texture — premium feel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23g)' opacity='0.18'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  mix-blend-mode: overlay;
}

/* ─────────────────────────────────────────
   SCENE — deep space breathing glow
───────────────────────────────────────── */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* primary breathe orb */
.orb-main {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(700px, 140vw);
  height: min(700px, 140vw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
      rgba(99, 60, 180, .22) 0%,
      rgba(59, 82, 180, .12) 35%,
      transparent 70%);
  animation: breathe 9s ease-in-out infinite;
  filter: blur(2px);
}

@keyframes breathe {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: .7
  }

  50% {
    transform: translate(-50%, -50%) scale(1.12);
    opacity: 1
  }
}

/* secondary accent — bottom right pink */
.orb-accent {
  position: absolute;
  bottom: -15%;
  right: -10%;
  width: min(480px, 100vw);
  height: min(480px, 100vw);
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
      rgba(190, 24, 93, .13) 0%,
      rgba(139, 92, 246, .07) 45%,
      transparent 70%);
  animation: breathe2 12s ease-in-out infinite;
  filter: blur(1px);
}

@keyframes breathe2 {

  0%,
  100% {
    transform: scale(.9);
    opacity: .6
  }

  60% {
    transform: scale(1.1);
    opacity: 1
  }
}

/* top left cold blue */
.orb-cold {
  position: absolute;
  top: -12%;
  left: -8%;
  width: min(420px, 90vw);
  height: min(420px, 90vw);
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
      rgba(37, 99, 235, .12) 0%,
      rgba(59, 130, 246, .06) 50%,
      transparent 70%);
  animation: breathe 14s ease-in-out infinite reverse;
  filter: blur(1px);
}

/* floating dust particles */
.dust {
  position: absolute;
  inset: 0
}

.d {
  position: absolute;
  border-radius: 50%;
  animation: drift linear infinite;
}

@keyframes drift {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0
  }

  10% {
    opacity: 1
  }

  90% {
    opacity: .6
  }

  100% {
    transform: translateY(-100vh) translateX(var(--tx, 20px));
    opacity: 0
  }
}

/* ─────────────────────────────────────────
   VIEWPORT
───────────────────────────────────────── */
.viewport {
  position: relative;
  z-index: 2;


  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─────────────────────────────────────────
   STAGE
───────────────────────────────────────── */
.stage {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;



  padding: 72px 20px 56px;
}

/* ─────────────────────────────────────────
   LOGO SECTION
───────────────────────────────────────── */
.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 28px;

  animation: logoEnter .9s cubic-bezier(.34, 1.4, .64, 1) both;
}

@keyframes logoEnter {}

.logo-img-wrap {
  position: relative;
  width: 124px;
  height: 124px;
  background: transparent;
  animation: logoFloat 7s ease-in-out infinite;
}

@keyframes logoFloat {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-11px)
  }
}

/* glow beneath logo — depth illusion */
.logo-shadow {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 14px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, .6) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(5px);
  animation: shadowSync 7s ease-in-out infinite;
}

@keyframes shadowSync {

  0%,
  100% {
    opacity: .7;
    transform: translateX(-50%) scaleX(1)
  }

  50% {
    opacity: .25;
    transform: translateX(-50%) scaleX(.55)
  }
}

.logo-img {
  width: 124px;
  height: 124px;
  object-fit: contain;
  display: block;
  mix-blend-mode: multiply;
  filter: drop-shadow(0 10px 32px rgba(139, 92, 246, .5)) drop-shadow(0 2px 8px rgba(0, 0, 0, .4));
  transition: filter .4s;
}

.logo-img:hover {
  filter: drop-shadow(0 14px 40px rgba(139, 92, 246, .65)) drop-shadow(0 4px 12px rgba(0, 0, 0, .4));
}

.logo-name {
  margin-top: 18px;
  font-size: 31px;
  font-weight: 800;
  letter-spacing: -.9px;
  background: var(--gname);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: .3px;
  color: var(--t2);
}

/* ─────────────────────────────────────────
   CARD
───────────────────────────────────────── */
.card {
  width: 100%;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: 22px;
  backdrop-filter: blur(40px) saturate(170%);
  -webkit-backdrop-filter: blur(40px) saturate(170%);
  overflow: hidden;
  position: relative;
  transform: translateZ(0);
  /* separate layer */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .035) inset,
    0 28px 80px rgba(0, 0, 0, .6),
    0 1px 0 rgba(255, 255, 255, .06) inset;
  animation: cardEnter .85s cubic-bezier(.34, 1.25, .64, 1) .22s both;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(28px) scale(.97)
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1)
  }
}

/* animated gradient top line */
.card-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  z-index: 10;
  background: var(--grad);
  opacity: .55;
}

/* shimmer sweep on card line */
.card-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  animation: lineShimmer 4s linear infinite;
}

@keyframes lineShimmer {
  0% {
    transform: translateX(-100%)
  }

  100% {
    transform: translateX(100%)
  }
}

/* reflection / specular highlight — top of card */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, .028), transparent);
  border-radius: 22px 22px 0 0;
}

/* ─────────────────────────────────────────
   TABS
───────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 2;
}

.tab-btn {
  flex: 1;
  padding: 16px 8px;
  border: none;
  background: none;
  color: var(--t2);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .1px;
  cursor: pointer;
  position: relative;
  transition: color .22s;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 18%;
  right: 18%;
  height: 2px;
  background: var(--grad);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .28s cubic-bezier(.34, 1.4, .64, 1);
}

.tab-btn.active {
  color: var(--text)
}

.tab-btn.active::after {
  transform: scaleX(1)
}

/* ─────────────────────────────────────────
   CARD BODY
───────────────────────────────────────── */
.cbody {
  padding: 28px 26px 30px;
  position: relative;
  z-index: 2
}

/* ─────────────────────────────────────────
   ALERT
───────────────────────────────────────── */
.alert {
  display: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
  margin-bottom: 18px;
}

.alert.error {
  background: rgba(248, 113, 113, .09);
  border: 1px solid rgba(248, 113, 113, .22);
  color: var(--err)
}

.alert.success {
  background: rgba(52, 211, 153, .09);
  border: 1px solid rgba(52, 211, 153, .22);
  color: var(--ok)
}

.alert.info {
  background: rgba(96, 165, 250, .09);
  border: 1px solid rgba(96, 165, 250, .22);
  color: var(--inf)
}

/* ─────────────────────────────────────────
   STEPS
───────────────────────────────────────── */
.step {
  display: none
}

.step.active {
  display: block;
  animation: stepIn .3s cubic-bezier(.34, 1.3, .64, 1)
}

@keyframes stepIn {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.progress {
  display: flex;
  gap: 5px;
  margin-bottom: 24px
}

.pdot {
  flex: 1;
  height: 1.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .09);
  transition: background .35s
}

.pdot.done {
  background: var(--grad)
}

.step-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  letter-spacing: -.4px
}

.step-sub {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 22px;
  line-height: 1.55;
  font-weight: 400
}

/* ─────────────────────────────────────────
   FIELDS
───────────────────────────────────────── */
.field {
  margin-bottom: 14px
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .75px;
  text-transform: uppercase;
  color: var(--t3);
  margin-bottom: 7px;
}

.iw {
  position: relative
}

.field input {
  width: 100%;
  padding: 13px 15px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  transition: border-color .22s, box-shadow .22s, background .22s;
  appearance: none;
  -webkit-appearance: none;
}

.field input:focus {
  border-color: rgba(139, 92, 246, .6);
  background: rgba(139, 92, 246, .06);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .11), 0 6px 24px rgba(139, 92, 246, .08);
}

.field input::placeholder {
  color: var(--t3)
}

.field input.pr {
  padding-right: 46px
}

.field input.pl {
  padding-left: 30px
}

.eye-btn {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--t3);
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  transition: color .2s;
  display: flex;
  align-items: center;
}

.eye-btn.on {
  color: var(--purp)
}

.at-pfx {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--purp);
  font-size: 15px;
  font-weight: 600;
  pointer-events: none;
}

.fhint {
  font-size: 12px;
  margin-top: 5px;
  min-height: 15px;
  color: var(--t3);
  font-weight: 400
}

/* ─────────────────────────────────────────
   CODE INPUT
───────────────────────────────────────── */
.code-input {
  width: 100%;
  text-align: center;
  letter-spacing: 14px;
  padding: 17px 15px 17px 30px;
  font-size: 26px;
  font-weight: 700;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r);
  color: var(--text);
  font-family: inherit;
  transition: border-color .22s, box-shadow .22s;
  appearance: none;
  -webkit-appearance: none;
}

.code-input:focus {
  border-color: rgba(139, 92, 246, .6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .11);
}

.code-input::placeholder {
  letter-spacing: 8px;
  font-size: 20px;
  opacity: .5
}

/* ─────────────────────────────────────────
   BUTTONS
───────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 14.5px;
  border: none;
  border-radius: var(--r);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: .1px;
  cursor: pointer;
  transition: opacity .18s, transform .12s, box-shadow .2s;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}

.btn:active:not(:disabled) {
  transform: scale(.975)
}

.btn:disabled {
  opacity: .38;
  cursor: not-allowed
}

.btn-primary {
  background: var(--gbtn);
  color: #fff;
  box-shadow: 0 4px 20px rgba(109, 40, 217, .3), 0 1px 3px rgba(0, 0, 0, .3);
}

/* shimmer on hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -110%;
  width: 60%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .18), transparent);
  skewX(-15deg);
  transition: left .5s ease;
}

.btn-primary:hover:not(:disabled)::after {
  left: 160%
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 28px rgba(109, 40, 217, .42), 0 2px 6px rgba(0, 0, 0, .3);
}

.btn-ghost {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .08);
  color: var(--t2);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(255, 255, 255, .14)
}

/* ─────────────────────────────────────────
   SPINNER
───────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* ─────────────────────────────────────────
   2FA
───────────────────────────────────────── */
.twofa-notice {
  text-align: center;
  margin-top: 12px
}

.twofa-notice p {
  font-size: 13px;
  color: var(--t2);
  margin-bottom: 8px;
  line-height: 1.55;
  font-weight: 400
}

.twofa-notice b {
  color: #c4b5fd;
  font-weight: 600
}

.twofa-link {
  background: none;
  border: none;
  color: var(--inf);
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(96, 165, 250, .3);
}

/* ─────────────────────────────────────────
   SWITCH
───────────────────────────────────────── */
.switch-link {
  margin-top: 20px;
  font-size: 13px;
  color: var(--t2);
  font-weight: 400;
  text-align: center;
  animation: cardEnter .7s ease .5s both;
}

.switch-link span {
  font-weight: 600;
  cursor: pointer;
  background: var(--gname);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: filter .2s;
}

.switch-link span:hover {
  filter: brightness(1.15)
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media(max-width:480px) {
  .stage {
    padding: 44px 16px 50px
  }

  .cbody {
    padding: 22px 20px 26px
  }

  .logo-img-wrap {
    width: 108px;
    height: 108px
  }

  .logo-img {
    width: 108px;
    height: 108px
  }

  .logo-name {
    font-size: 26px
  }

  .logo-section {
    margin-bottom: 28px
  }
}

@media(min-width:768px) {
  .stage {
    padding: 72px 20px 56px
  }
}

@media(max-width:767px) {
  body {
    overflow-y: auto;
    align-items: flex-start
  }
}