@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@500;600&display=swap");

:root {
  --canvas: #f6f8fc;
  --brand: #1e3aff;
  --cyan: #2ee6c0;
  --text: #0b1220;
  --muted: #5c6578;
  --faint: #8a93a6;
  --on-brand: #ffffff;
  --success: #17b26b;
  --warn: #f5a624;
  --danger: #f04538;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --stroke: rgba(255, 255, 255, 0.8);
  --shadow: 0 10px 28px -4px rgba(31, 46, 102, 0.08);
  --inset: inset 0 1px 0 0 rgba(255, 255, 255, 0.85);
  --content-w: 560px;
}

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

html,
body {
  height: 100%;
  height: var(--tg-viewport-stable-height, 100dvh);
  background: var(--canvas);
  font-family: Geist, "Segoe UI", sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#root,
.phone,
#view {
  width: 100%;
  height: 100%;
  min-height: 100%;
  min-height: var(--tg-viewport-stable-height, 100dvh);
}

.phone {
  position: relative;
  background: var(--canvas);
  overflow: hidden;
}

.blobs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.blob {
  position: absolute;
}

.blob img {
  position: absolute;
  inset: -21.18%;
  width: 142.36%;
  height: 142.36%;
  max-width: none;
  display: block;
}

.blob-a {
  left: -110px;
  top: -80px;
  width: 340px;
  height: 340px;
  animation: drift-a 16s ease-in-out infinite;
}

.blob-b {
  left: 210px;
  top: 210px;
  width: 280px;
  height: 280px;
  animation: drift-b 20s ease-in-out infinite;
}

.blob-b img {
  inset: -25.71%;
  width: 151.42%;
  height: 151.42%;
}

.blob-c {
  left: -70px;
  top: 640px;
  width: 260px;
  height: 260px;
  animation: drift-c 18s ease-in-out infinite;
}

.blob-c img {
  inset: -27.69%;
  width: 155.38%;
  height: 155.38%;
}

@media (min-width: 768px) {
  .body {
    padding: calc(40px + var(--tg-content-safe-area-inset-top, var(--tg-safe-area-inset-top, 0px))) 28px 32px;
  }

  .tab-wrap {
    padding: 8px 28px calc(28px + var(--tg-safe-area-inset-bottom, 0px));
  }

  .blob-a {
    left: -80px;
    top: -120px;
    width: 520px;
    height: 520px;
  }

  .blob-b {
    left: auto;
    right: -80px;
    top: 16%;
    width: 460px;
    height: 460px;
  }

  .blob-c {
    left: 12%;
    top: auto;
    bottom: -100px;
    width: 420px;
    height: 420px;
  }
}

.content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
}

.body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: calc(32px + var(--tg-content-safe-area-inset-top, var(--tg-safe-area-inset-top, 0px))) 22px 28px;
  overflow: auto;
}

.body.tight {
  gap: 8px;
  padding-bottom: 8px;
}

.body.gap10 {
  gap: 10px;
  padding-bottom: 8px;
}

.body.center {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
}

.grow {
  flex: 1;
  min-height: 8px;
}

.title {
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
  letter-spacing: -0.48px;
  color: var(--text);
}

.title-lg {
  font-size: 28px;
  font-weight: 600;
  line-height: 34px;
}

.heading {
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: -0.18px;
}

.body-text {
  font-size: 15px;
  font-weight: 400;
  line-height: 22px;
  color: var(--muted);
}

.body-med {
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
}

.caption {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.12px;
  color: var(--faint);
}

.overline {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  color: var(--faint);
  text-transform: uppercase;
}

.mono {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.amount {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 28px;
  font-weight: 600;
  line-height: 34px;
  letter-spacing: -0.56px;
}

.glass {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  box-shadow: var(--shadow), var(--inset);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.glass.r18 {
  border-radius: 18px;
}

.glass.r20 {
  border-radius: 20px;
}

.glass.selected {
  background: var(--glass-strong);
  border: 1.5px solid rgba(31, 59, 255, 0.55);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.row-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.kv-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.kv-line .l {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.12px;
  color: var(--faint);
}

.kv-line .r {
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  text-align: right;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: var(--on-brand);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-glass {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow), var(--inset);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-mini {
  height: auto;
  padding: 8px 12px;
  width: auto;
  font-size: 12px;
  letter-spacing: 0.12px;
}

.actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.actions .glass {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}

.tab-wrap {
  display: flex;
  justify-content: center;
  padding: 8px 22px calc(20px + var(--tg-safe-area-inset-bottom, 0px));
  flex-shrink: 0;
}

.tabs {
  display: flex;
  width: 100%;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow), var(--inset);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0 4px;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12px;
}

.tab.active {
  color: var(--brand);
}

.tab svg {
  width: 22px;
  height: 22px;
  display: block;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}

.tab.active svg {
  transform: translateY(-1px) scale(1.06);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  letter-spacing: 0.88px;
}

.pill-ok {
  background: rgba(23, 178, 107, 0.12);
  color: var(--success);
}

.pill-warn {
  background: rgba(245, 166, 36, 0.12);
  color: var(--warn);
}

.pill-danger {
  background: rgba(240, 69, 56, 0.12);
  color: var(--danger);
}

.pill-brand {
  background: rgba(31, 59, 255, 0.12);
  color: #1f3bff;
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  background: #e8edf6;
}

.avatar.lg {
  width: 44px;
  height: 44px;
}

.filters {
  display: flex;
  gap: 8px;
}

.chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12px;
  cursor: pointer;
  box-shadow: var(--shadow), var(--inset);
}

.chip.on {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.field-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.field {
  padding: 14px 16px;
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow), var(--inset);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  outline: none;
}

.textarea {
  min-height: 96px;
  resize: none;
  line-height: 22px;
  font-weight: 400;
}

.steps {
  display: flex;
  align-items: flex-start;
  width: 100%;
  padding: 16px 6px 12px;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04px;
  color: var(--text);
  text-align: center;
  min-width: 0;
}

.step-name {
  line-height: 14px;
}

.step.off {
  color: var(--faint);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step.off .dot {
  background: #c5cad6;
}

.step.now .dot {
  box-shadow: 0 0 0 3px rgba(30, 58, 255, 0.18);
}

.step.has-line::after {
  content: "";
  position: absolute;
  top: 4px;
  left: calc(50% + 8px);
  width: calc(100% - 16px);
  height: 2px;
  background: #d5dae6;
  border-radius: 99px;
}

.step.line-on::after {
  background: var(--brand);
}

.empty {
  color: var(--faint);
  font-size: 14px;
  line-height: 20px;
  padding: 18px 8px;
  text-align: center;
}

.err {
  color: var(--danger);
  font-size: 13px;
  line-height: 18px;
}

.warn {
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(255, 235, 199, 0.95);
  border: 1.5px solid rgba(235, 158, 31, 0.55);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo-wordmark {
  width: 248px;
  height: 68px;
  object-fit: contain;
  display: block;
}

.logo-mark {
  width: 36px;
  height: 43px;
  object-fit: contain;
  display: block;
}

.center-mark {
  width: 56px;
  height: 67px;
  object-fit: contain;
}

.status-dot {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.ok {
  background: var(--success);
}

.status-dot.bad {
  background: var(--danger);
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(15, 20, 41, 0.42);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px 22px 28px;
}

.sheet {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow), var(--inset);
  backdrop-filter: blur(16px);
}

.badge {
  align-self: flex-start;
  background: var(--warn);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 99px;
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.action-pill {
  border: 0;
  border-radius: 99px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
}

.action-pill.danger {
  background: var(--danger);
}

.action-pill.ok {
  background: var(--success);
}

.seg {
  display: flex;
  gap: 8px;
  width: 100%;
}

.seg button {
  flex: 1;
}

.fee {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12px;
}

.hidden {
  display: none;
}

.card-btn {
  cursor: pointer;
}

button.card-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.actions .glass {
  display: flex;
  align-items: center;
  justify-content: center;
}

#view {
  position: relative;
  z-index: 1;
  height: 100%;
}

#view.enter .body > *:not(.grow) {
  animation: rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#view.enter .body > *:not(.grow):nth-child(1) { animation-delay: 0.04s; }
#view.enter .body > *:not(.grow):nth-child(2) { animation-delay: 0.12s; }
#view.enter .body > *:not(.grow):nth-child(3) { animation-delay: 0.2s; }
#view.enter .body > *:not(.grow):nth-child(4) { animation-delay: 0.28s; }
#view.enter .body > *:not(.grow):nth-child(5) { animation-delay: 0.36s; }
#view.enter .body > *:not(.grow):nth-child(6) { animation-delay: 0.44s; }
#view.enter .body > *:not(.grow):nth-child(7) { animation-delay: 0.52s; }
#view.enter .body > *:not(.grow):nth-child(8) { animation-delay: 0.6s; }
#view.enter .body > *:not(.grow):nth-child(9) { animation-delay: 0.68s; }
#view.enter .body > *:not(.grow):nth-child(n + 10) { animation-delay: 0.76s; }

#view.enter .tab-wrap {
  animation: tab-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#view.enter .body.center > .logo-wordmark {
  animation: splash-logo 1.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#view.enter .body.center > .body-text {
  animation: splash-sub 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}

#view.enter .btn,
#view.enter .btn-glass,
#view.enter .glass,
#view.enter .chip,
#view.enter .field,
#view.enter .warn,
#view.enter .card-btn,
#view.enter .tab {
  transition: none;
}

.btn,
.btn-glass {
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn:active,
.btn-glass:active,
.chip:active,
.action-pill:active,
.card-btn:active,
.actions .glass:active {
  transform: scale(0.975);
}

.btn-glass:hover,
.card-btn:hover,
.actions .glass:hover {
  filter: brightness(1.03);
}

.glass,
.chip,
.field,
.warn {
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.tab {
  transition: color 0.2s ease, transform 0.2s ease;
}

.chip.on {
  transition: background 0.2s ease, color 0.2s ease, transform 0.16s ease;
}

.dot {
  transition: background 0.3s ease, transform 0.3s ease;
}

.modal {
  animation: fade-in 0.4s ease both;
}

.sheet {
  animation: sheet-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

#view.enter .body > .status-dot,
#view.enter .body > .center-mark {
  animation: pop 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes tab-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes splash-logo {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes splash-sub {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sheet-up {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes drift-a {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(18px, 12px);
  }
}

@keyframes drift-b {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-16px, 10px);
  }
}

@keyframes drift-c {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(12px, -14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
