:root {
  color-scheme: dark;
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080812;
  color: #f8f7ff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 90% -10%, rgba(130, 70, 255, .4), transparent 36%),
    radial-gradient(circle at -10% 35%, rgba(0, 213, 255, .17), transparent 33%),
    #080812;
}
.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  margin: auto;
  padding:
    calc(76px + env(safe-area-inset-top) + var(--tg-content-safe-area-inset-top, 0px))
    20px
    calc(28px + env(safe-area-inset-bottom));
}
.hero { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(145deg, #8c4dff, #5420d1); font-size: 22px; font-weight: 900;
  box-shadow: 0 8px 30px rgba(112, 56, 255, .4);
}
.eyebrow { margin: 0 0 3px; color: #a7a0bd; font-size: 10px; letter-spacing: .16em; }
h1 { margin: 0; font-size: 21px; } h2 { margin: 4px 0 8px; font-size: 30px; } h3 { margin: 28px 0 14px; }
.muted { color: #aaa4bc; font-size: 13px; }
.client-card {
  position: relative; overflow: hidden; height: 190px; min-height: 190px;
  border: 1px solid rgba(255,255,255,.14); border-radius: 26px;
  background: transparent;
  box-shadow: 0 25px 60px rgba(52, 13, 128, .42);
  transform: perspective(900px) rotateX(var(--card-rx, 0deg)) rotateY(var(--card-ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), box-shadow .45s ease;
  animation: card-arrive .8s cubic-bezier(.2,.8,.2,1) both, card-breathe 6s ease-in-out .8s infinite;
  will-change: transform;
}
.client-card::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: -55%;
  width: 34%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.24), transparent);
  transform: skewX(-18deg);
  animation: card-shine 7s ease-in-out 1.2s infinite;
}
.card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .75s cubic-bezier(.2,.75,.2,1);
}
.client-card.is-flipped .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 17px 18px;
  border-radius: 26px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(circle at 85% 5%, rgba(80,230,255,.28), transparent 34%),
    linear-gradient(145deg, #6f32e7, #311179 72%);
}
.card-face::after { content: ""; position: absolute; width: 220px; height: 220px; border: 38px solid rgba(255,255,255,.055); border-radius: 50%; right: -105px; bottom: -130px; }
.card-front {
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.card-back {
  display: grid;
  place-items: center;
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 15% 90%, rgba(80,230,255,.22), transparent 38%),
    linear-gradient(145deg, #321078, #6c31df);
}
.code-content { position: relative; z-index: 1; width: 100%; text-align: center; }
.auth-code { display: block; margin: 14px 0 6px; font-family: "Space Grotesk", sans-serif; font-size: clamp(34px, 11vw, 42px); font-weight: 600; line-height: 1; letter-spacing: .16em; text-indent: .16em; white-space: nowrap; }
.code-note { display: block; color: rgba(255,255,255,.62); font-size: 12px; }
.client-card.is-touching {
  transition-duration: .12s;
  box-shadow: 0 32px 72px rgba(68, 21, 168, .58);
  animation-play-state: paused;
}
.card-top, .card-bottom, .card-balance { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; }
.card-label { font-size: 10px; font-weight: 800; letter-spacing: .15em; opacity: .75; }
.card-tools { display: flex; align-items: center; gap: 9px; }
.card-chip {
  position: relative; display: block; overflow: hidden; width: 30px; height: 22px;
  border: 1px solid rgba(78,54,9,.42); border-radius: 6px;
  background: linear-gradient(135deg,#f7df9d,#b88930);
}
.card-chip::before, .card-chip::after, .card-chip i::before { content: ""; position: absolute; background: rgba(85,59,13,.38); }
.card-chip::before { left: 9px; top: 0; width: 1px; height: 100%; }
.card-chip::after { left: 0; top: 10px; width: 100%; height: 1px; }
.card-chip i::before { right: 6px; top: 0; width: 1px; height: 100%; }
.contactless { width: 23px; height: 23px; fill: none; stroke: rgba(255,255,255,.72); stroke-width: 1.7; stroke-linecap: round; }
.card-balance { justify-content: flex-start; align-self: center; margin: 0; }
.card-balance strong {
  display: block; margin-top: 4px;
  font-family: "Space Grotesk", sans-serif; font-size: 30px; font-weight: 600; letter-spacing: -.035em;
  text-shadow: 0 3px 16px rgba(20,0,65,.24);
}
.card-bottom { align-items: end; margin: 0; }
.card-bottom h2 {
  margin: 4px 0 0; max-width: 265px;
  font-family: "Space Grotesk", sans-serif; font-size: 16px; font-weight: 600;
  line-height: 1.15; letter-spacing: .085em; text-transform: uppercase;
}
.card-caption { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; letter-spacing: .035em; color: rgba(255,255,255,.6); }
.card-caption svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card-balance .card-caption svg { fill: currentColor; stroke-width: 0; }
.bonus-sign { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; font-weight: 900; }
.code-button {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin-top: 13px; padding: 13px 16px; border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px; color: #ddd5ef; background: rgba(255,255,255,.055);
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.code-button:active { transform: scale(.985); background: rgba(255,255,255,.09); }
.code-button:disabled { opacity: .6; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
article {
  min-height: 140px; padding: 17px; border: 1px solid rgba(255,255,255,.08); border-radius: 20px;
  background: rgba(255,255,255,.045);
}
article span { display: block; margin-bottom: 20px; font-size: 25px; }
article b, article small { display: block; } article small { margin-top: 5px; color: #928ba5; line-height: 1.35; }
footer { margin-top: 30px; color: #686277; text-align: center; font-size: 11px; }
.maintenance { min-height: 100vh; display: grid; align-content: center; justify-items: start; gap: 14px; }
.maintenance h1 { max-width: 330px; font-size: 34px; line-height: 1.05; }
.maintenance p { max-width: 340px; font-size: 15px; line-height: 1.55; }
[hidden] { display: none !important; }

.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  bottom: -120px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: var(--opacity);
  background: radial-gradient(circle at 35% 35%, rgba(220, 205, 255, .8), rgba(121, 72, 255, .18) 48%, transparent 72%);
  filter: blur(var(--blur));
  animation: particle-float var(--duration) ease-in-out var(--delay) infinite;
  will-change: transform;
}

@keyframes particle-float {
  0% { transform: translate3d(0, 10vh, 0) scale(.85); }
  45% { transform: translate3d(var(--drift), -48vh, 0) scale(1.08); }
  100% { transform: translate3d(calc(var(--drift) * -.45), -118vh, 0) scale(.92); }
}

@keyframes card-arrive {
  from { opacity: 0; transform: perspective(900px) rotateX(8deg) translateY(22px) scale(.96); }
  to { opacity: 1; transform: perspective(900px) rotateX(0) translateY(0) scale(1); }
}
@keyframes card-breathe {
  0%, 100% { filter: saturate(1) brightness(1); }
  50% { filter: saturate(1.08) brightness(1.04); }
}
@keyframes card-shine {
  0%, 62% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  70% { opacity: .8; }
  88%, 100% { transform: translateX(470%) skewX(-18deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .particle { animation: none; bottom: auto; }
  .client-card, .client-card::before { animation: none; transition: none; }
}
