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

:root {
  --color-bg: #180c27;
  --color-primary: #9928ef;
  --color-secondary: #2fe1ea;
  --color-text: #ffffff;
  font-family: "Geologica", "Inter", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(160deg, #0c0520 0%, #180c27 35%, #260b40 70%, #0a0414 100%);
  color: var(--color-text);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 110px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.user-name {
  font-weight: 600;
  margin: 0;
  font-size: 1rem;
}

.user-status {
  margin: 2px 0 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.balance-card {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  margin-bottom: 18px;
}

.balance-card .label {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  opacity: 0.8;
}

.balance-card .value {
  margin: 4px 0 0;
  font-size: 1.4rem;
  font-weight: 700;
  position: relative;
}

.balance-card .value-usd {
  font-size: 1.8rem;
  letter-spacing: 0.02em;
}

.balance-card .value.loading {
  color: transparent;
}

.balance-card .value.loading::after {
  content: "";
  display: block;
  width: 90px;
  height: 1.6em;
  margin: 0 auto;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.08));
  background-size: 200px 100%;
  animation: shimmer 1.2s linear infinite;
}

.cta-btn {
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  width: 100%;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(120deg, var(--color-secondary), var(--color-primary));
  cursor: pointer;
  transition: transform 0.15s ease;
  margin-bottom: 20px;
}

.cta-btn:active {
  transform: scale(0.98);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: linear-gradient(180deg,
      rgba(16, 12, 28, 0.35) 0%,
      rgba(16, 12, 28, 0.5) 40%,
      rgba(16, 12, 28, 0.65) 70%,
      rgba(16, 12, 28, 0.8) 100%),
    rgba(4, 6, 12, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(22, 16, 36, 0.95);
  border-radius: 24px;
  width: min(380px, 100%);
  padding: 18px 20px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
}

.modal-content h2 {
  margin: 0 0 8px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  cursor: pointer;
}

.topup-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.topup-input-row label {
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
  display: block;
}

.topup-input-row input,
.topup-form textarea {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  resize: none;
}

.topup-input-row input:focus,
.topup-form textarea:focus {
  outline: none;
  border-color: rgba(47, 225, 234, 0.8);
}

.topup-form input[type="number"]::-webkit-outer-spin-button,
.topup-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.topup-form input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.topup-input-row.hidden {
  display: none;
}

.submit-btn {
  margin: 10px 0 0;
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(120deg, var(--color-secondary), var(--color-primary));
  cursor: pointer;
  transition: transform 0.15s ease;
}

.submit-btn:active {
  transform: scale(0.98);
}

.submit-btn.loading {
  opacity: 0.7;
  cursor: wait;
  position: relative;
}

.submit-btn.loading::after {
  content: "";
  position: absolute;
  inset: 50% 28px auto auto;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-left-color: rgba(255, 255, 255, 0.2);
  border-right-color: rgba(255, 255, 255, 0.75);
  border-top-color: rgba(255, 255, 255, 0.2);
  border-bottom-color: rgba(255, 255, 255, 0.75);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shimmer {
  0% {
    background-position: -100px 0;
  }

  100% {
    background-position: 200px 0;
  }
}

.modal-status {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.modal-status p {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-status p strong {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.modal-status p a {
  color: var(--color-secondary);
  text-decoration: none;
  font-weight: 600;
}

.qr-block {
  margin-top: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.qr-block img {
  width: 200px;
  height: 200px;
  object-fit: contain;
  margin-top: 8px;
}

.qr-scan-subtitle {
  margin: 0;
  opacity: 0.75;
  font-size: 0.95rem;
}

.qr-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.qr-amount-row {
  margin-top: 12px;
}

.qr-kv {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.qr-kv-label {
  opacity: 0.7;
  font-size: 0.9rem;
}

.qr-kv-value {
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  max-width: 60%;
}

.qr-raw-block {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.qr-raw-title {
  font-size: 0.85rem;
  opacity: 0.7;
  margin-bottom: 8px;
}

.qr-raw {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: auto;
  max-height: 140px;
  white-space: pre-wrap;
  word-break: break-all;
}

.qr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.qr-action-btn {
  border: none;
  border-radius: 18px;
  padding: 14px 14px;
  width: 100%;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.qr-action-btn:active {
  transform: scale(0.98);
}

.qr-action-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.qr-action-btn--pay {
  background: linear-gradient(120deg, rgba(46, 230, 174, 0.9), rgba(10, 160, 108, 0.95));
}

.qr-action-btn--cancel {
  background: linear-gradient(120deg, rgba(255, 120, 140, 0.9), rgba(200, 52, 84, 0.95));
}

.qr-transfer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qr-transfer-item {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.qr-transfer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.qr-transfer-chain {
  font-weight: 700;
}

.qr-copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}

.qr-copy-btn:active {
  transform: scale(0.98);
}

.qr-transfer-address {
  margin: 0;
  font-size: 0.8rem;
  opacity: 0.9;
  word-break: break-all;
}

.hidden {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .bottom-nav {
  pointer-events: none;
  opacity: 0.35;
  filter: blur(0.5px);
}

.history-view {
  padding: 8px 0 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.history-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  width: 100%;
}

.history-header-row h2 {
  margin: 0;
  width: 100%;
  text-align: center;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 65vh;
  overflow-y: auto;
  width: 100%;
  align-items: center;
}

.history-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 360px;
}

.history-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.history-date {
  display: block;
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 2px;
  text-align: left;
}

.history-amount {
  font-size: 1rem;
  font-weight: 700;
  align-self: center;
}

.history-amount.positive {
  color: #3dd598;
}

.history-amount.negative {
  color: #f05252;
}

.history-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;
  opacity: 0.75;
}

.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(440px, calc(100% - 32px));
  background: rgba(24, 12, 39, 0.95);
  border-radius: 30px;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  backdrop-filter: blur(16px);
  gap: 8px;
}

.nav-btn {
  flex: 1 1 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 18px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
  min-width: 0;
}

.nav-btn.active {
  color: #fff;
  background: transparent;
  border-radius: 22px;
  z-index: 1;
}

.nav-btn.active::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  background: rgba(153, 40, 239, 0.22);
  z-index: -1;
  pointer-events: none;
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.nav-btn.loading::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: rgba(255, 255, 255, 0.9);
  animation: spin 0.9s linear infinite;
}

.qr-btn.loading::after {
  top: 14px;
  right: 14px;
}

.nav-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.qr-btn {
  flex: 1 1 0;
  margin-top: 0;
  padding: 14px 10px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: #ffffff;
  background: linear-gradient(130deg, var(--color-secondary), var(--color-primary));
}

.qr-icon {
  width: 28px;
  height: 28px;
}

.profile-view {
  padding: 8px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.meta-label {
  opacity: 0.75;
  font-size: 0.9rem;
}

.meta-value {
  font-weight: 600;
}

.verification-card {
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(47, 225, 234, 0.18), rgba(153, 40, 239, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.verification-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.verification-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.verification-label {
  margin: 0;
  line-height: 1.15;
}

.verification-subtitle {
  margin: 0;
  opacity: 0.75;
  font-size: 0.9rem;
}

.verification-right {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 22px;
}

.verification-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.8rem;
  font-weight: 600;
}

.icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.icon-btn:hover {
  opacity: 0.95;
}

.icon-btn:active {
  transform: scale(0.98);
}

.icon-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.verification-text {
  margin: 0;
  opacity: 0.85;
}

.kyc-tier {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kyc-carousel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kyc-carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.kyc-carousel-track::-webkit-scrollbar {
  display: none;
}

.kyc-carousel-track .kyc-tier {
  scroll-snap-align: start;
}

.kyc-tier--standard {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
}

.kyc-tier--plus {
  background: linear-gradient(140deg, rgba(47, 225, 234, 0.16), rgba(255, 255, 255, 0.04));
  border-color: rgba(47, 225, 234, 0.18);
}

.kyc-tier--maxi {
  background: linear-gradient(140deg, rgba(153, 40, 239, 0.18), rgba(255, 255, 255, 0.04));
  border-color: rgba(153, 40, 239, 0.2);
}

.kyc-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 2px 0;
}

.kyc-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, width 0.12s ease;
}

.kyc-dot.is-active {
  width: 18px;
  background: rgba(255, 255, 255, 0.8);
}

.kyc-dot:active {
  transform: scale(0.95);
}

.kyc-tier-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kyc-tier-top h4 {
  margin: 0;
  font-size: 1rem;
}

.kyc-tier-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.kyc-tier-text {
  margin: 0;
  opacity: 0.82;
  font-size: 0.92rem;
}

.kyc-note {
  margin: 0;
  opacity: 0.7;
  font-size: 0.85rem;
}

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

.verification-btn {
  border: none;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.verification-btn.secondary {
  background: rgba(0, 0, 0, 0.22);
}

.verification-btn:hover {
  opacity: 0.95;
}

.verification-btn:active {
  transform: scale(0.98);
}

.qr-btn .nav-icon {
  font-size: 1.3rem;
}

.history-empty {
  text-align: center;
  opacity: 0.7;
  padding: 40px 0;
}

.consent-view {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  background: radial-gradient(900px 520px at 20% 10%, rgba(47, 225, 234, 0.12), rgba(0, 0, 0, 0)),
    radial-gradient(900px 520px at 80% 40%, rgba(153, 40, 239, 0.16), rgba(0, 0, 0, 0)),
    linear-gradient(180deg, rgba(5, 7, 14, 1), rgba(5, 7, 14, 0.92));
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}

.consent-hero {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 22px 0 12px;
}

.consent-brand {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 3.1rem);
  letter-spacing: -0.03em;
  line-height: 1.02;
  text-align: center;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
}

.consent-bottom {
  flex: 0 0 auto;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 0 2px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.consent-bottom-subtitle {
  margin: 0;
  opacity: 0.72;
  line-height: 1.35;
  font-size: 0.92rem;
}

.consent-legal {
  margin: 0;
  text-align: center;
  opacity: 0.72;
  font-size: 0.85rem;
  line-height: 1.35;
}

.consent-legal--main {
  font-size: 0.62rem;
  opacity: 0.75;
  line-height: 1.35;
  max-width: 44ch;
}

.consent-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.consent-btn--wide {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
}

.consent-hint {
  margin: 0;
  opacity: 0.7;
  font-size: 0.85rem;
  text-align: center;
}
