html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: #fff;
}

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  position: relative;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: #fff;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
}

.screen.on {
  display: flex;
  animation: enter 0.28s ease both;
}

.screen.on.from-left {
  animation-name: enter-left;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}

@keyframes enter-left {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
}

.bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 8px;
  flex-shrink: 0;
}

.bar-title {
  font-weight: 600;
  font-size: 17px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: var(--ink);
}

.icon-btn:active {
  background: var(--bg);
}

.content {
  flex: 1;
  padding: 8px 24px 0;
  overflow-y: auto;
}

.content.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 24px;
}

h2 {
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin: 8px 0 10px;
}

.lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  margin: 0 0 28px;
}

.label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.hint {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.hint .wa {
  width: 18px;
  height: 18px;
  color: #25a244;
}

.foot {
  padding: 12px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* Welcome */
.welcome {
  background: radial-gradient(120% 70% at 85% 0%, #ff3b3b 0%, #b01a19 45%, #6d0f0f 100%);
}

.welcome-top {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 28px 24px;
  color: #fff;
}

.welcome-logo {
  width: 132px;
}

.welcome-copy h1 {
  font-size: 38px;
  line-height: 1.1;
  letter-spacing: -0.8px;
  margin: 0 0 14px;
}

.welcome-copy p {
  font-size: 17px;
  line-height: 1.5;
  opacity: 0.85;
  margin: 0;
}

.welcome-bottom {
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 28px 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Code */
.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.otp input {
  width: 100%;
  aspect-ratio: 0.85;
  max-height: 64px;
  text-align: center;
  font-size: 26px;
  font-weight: 600;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  caret-color: var(--brand);
}

.otp input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(176, 26, 25, 0.08);
}

.otp.bad input {
  border-color: #e53935;
}

.delivery {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

.delivery .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4c8d0;
}

.delivery.sent .dot {
  background: #25a244;
  box-shadow: 0 0 0 4px rgba(37, 162, 68, 0.15);
}

.resend {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: 8px;
}

.resend .btn {
  width: auto;
  padding: 0;
  font-size: 15px;
}

/* Trust */
.halo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 20px;
  box-shadow: 0 0 0 14px rgba(176, 26, 25, 0.05);
}

.halo .fp {
  width: 60px;
  height: 60px;
  stroke-width: 1.4;
}

.points {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
  width: 100%;
}

.points li {
  position: relative;
  padding: 12px 0 12px 32px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-2);
}

.points li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 16px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(-45deg);
}

.btn-icon {
  width: 22px;
  height: 22px;
}

.foot-note {
  margin: 4px 8px 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* Done */
.success svg {
  width: 96px;
  height: 96px;
  margin-bottom: 16px;
}

.success circle {
  stroke: var(--ok);
  stroke-width: 2.5;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
  animation: draw 0.6s ease forwards;
}

.success path {
  stroke: var(--ok);
  stroke-width: 3.5;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 0.35s 0.45s ease forwards;
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* Returning */
.back-top {
  padding: 28px 24px 0;
}

.back-logo {
  width: 112px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.avatar.big {
  width: 76px;
  height: 76px;
  font-size: 26px;
  margin-bottom: 10px;
}

.fp-button {
  margin-top: 10px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 0;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(176, 26, 25, 0.35);
  transition: transform 0.1s ease;
  animation: pulse 2.4s ease-in-out infinite;
}

.fp-button:active {
  transform: scale(0.96);
}

.fp-button svg {
  width: 54px;
  height: 54px;
  stroke-width: 1.4;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 10px 30px rgba(176, 26, 25, 0.35), 0 0 0 0 rgba(176, 26, 25, 0.25);
  }
  50% {
    box-shadow: 0 10px 30px rgba(176, 26, 25, 0.35), 0 0 0 16px rgba(176, 26, 25, 0);
  }
}

.fp-caption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 16px;
}

.btn.link.muted {
  color: var(--muted);
  font-weight: 500;
}

/* Home */
.home {
  background: var(--bg);
}

.home-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px 20px;
  flex-shrink: 0;
}

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

.hello {
  font-weight: 700;
  font-size: 18px;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.home-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 24px;
}

.balance {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 22px 22px 20px;
  color: #fff;
  background: linear-gradient(135deg, #d42a26 0%, #b01a19 50%, #7a1010 100%);
  box-shadow: 0 14px 30px rgba(176, 26, 25, 0.3);
}

.balance-label {
  font-size: 14px;
  opacity: 0.85;
}

.balance-amount {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 6px 0 16px;
}

.balance-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

.balance-meta .pill {
  background: rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 99px;
  letter-spacing: 0;
}

.balance-mark {
  position: absolute;
  right: -14px;
  top: -10px;
  width: 110px;
  opacity: 0.12;
  filter: brightness(10);
}

.savings {
  display: flex;
  justify-content: space-between;
  background: #fff;
  border-radius: 16px;
  padding: 16px 18px;
  margin-top: 12px;
  font-size: 15px;
  color: var(--ink-2);
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0 6px;
}

.actions button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink-2);
}

.actions span {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--brand);
  box-shadow: var(--shadow);
}

.section-title {
  font-weight: 700;
  font-size: 16px;
  margin: 20px 0 10px;
}

.tx {
  background: #fff;
  border-radius: 18px;
  padding: 4px 16px;
}

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.tx-row:last-child {
  border-bottom: 0;
}

.tx-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink-2);
  font-size: 14px;
}

.tx-main {
  flex: 1;
  min-width: 0;
}

.tx-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-amount {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}

.tx-amount.in {
  color: var(--ok);
}

.tabs {
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  padding: 6px 0;
}

.tabs button.on {
  color: var(--brand);
  font-weight: 600;
}

/* Profile */
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 8px;
}

.profile-card .avatar.big {
  margin: 0;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
}

.list {
  border: 1px solid var(--line);
  border-radius: 16px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 0;
}

.row-title {
  font-weight: 600;
}

.chip {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--bg);
  color: var(--muted);
}

.chip.on {
  background: var(--ok-soft);
  color: var(--ok);
}

/* Sign-in request */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 16, 0.45);
  display: flex;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 20;
}

.sheet-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  width: 100%;
  background: #fff;
  border-radius: 26px 26px 0 0;
  padding: 10px 24px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-backdrop.show .sheet {
  transform: none;
}

.grabber {
  width: 40px;
  height: 5px;
  border-radius: 9px;
  background: var(--line);
  margin: 0 auto 8px;
}

.sheet-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin: 6px auto 0;
}

.sheet h3 {
  font-size: 22px;
  margin: 8px 0 0;
}

.sheet-where {
  color: var(--muted);
  margin: 0;
}

.match {
  background: var(--bg);
  border-radius: 16px;
  padding: 14px;
  margin: 6px 0 8px;
}

.match-number {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--ink);
}
