:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #020617;
  color: #e2f8f0;
  --panel: rgba(7, 19, 18, 0.76);
  --line: rgba(67, 255, 204, 0.18);
  --grid: rgba(34, 197, 94, 0.07);
  --glow: #33ffc2;
  --pink: #f472b6;
  --cyan: #22d3ee;
  --lime: #9fff6b;
  --red: #ff4d6d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 30%),
    radial-gradient(circle at top left, rgba(244, 114, 182, 0.12), transparent 25%),
    #020617;
}

button,
input,
select,
textarea {
  font: inherit;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), transparent);
  pointer-events: none;
  animation: grid-drift 16s linear infinite;
}

.bg-orb {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 999px;
  filter: blur(26px);
  opacity: 0.18;
  pointer-events: none;
}

.orb-a {
  left: -120px;
  top: 18vh;
  background: var(--glow);
  animation: orb-float 8s ease-in-out infinite;
}

.orb-b {
  right: -140px;
  top: 42vh;
  background: var(--pink);
  animation: orb-float 10s ease-in-out infinite reverse;
}

.app-shell {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px calc(118px + env(safe-area-inset-bottom));
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.eyebrow,
.call-label,
.nano-copy,
.field-label,
.inline-status,
.nav-btn,
.history-meta,
.rate-pill span {
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.eyebrow,
.call-label {
  margin: 0 0 8px;
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--glow);
}

h1,
h2,
p,
pre {
  margin: 0;
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.06em;
  text-shadow: 0 0 24px rgba(51, 255, 194, 0.18);
}

h2 {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.balance-chip {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(5, 15, 23, 0.72), rgba(3, 10, 16, 0.42));
  border: 1px solid rgba(51, 255, 194, 0.14);
  box-shadow:
    inset 0 0 18px rgba(51, 255, 194, 0.05),
    0 0 28px rgba(51, 255, 194, 0.08);
}

.balance-chip-value {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}

.balance-chip-copy {
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: rgba(188, 255, 232, 0.72);
  text-transform: uppercase;
}

.app-screen {
  display: none;
}

.app-screen.active {
  display: block;
  animation: screen-rise 700ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.lift-panel {
  animation: panel-rise 800ms cubic-bezier(0.18, 0.9, 0.2, 1) both;
}

.delay-1 {
  animation-delay: 90ms;
}

.delay-2 {
  animation-delay: 160ms;
}

.hero-card,
.glass-card,
.metric-card,
.wallet-card,
.incoming-banner,
.call-hud {
  position: relative;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 19, 18, 0.88), rgba(7, 14, 22, 0.76));
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(51, 255, 194, 0.05);
  overflow: hidden;
}

.hero-card::before,
.glass-card::before,
.metric-card::before,
.wallet-card::before,
.incoming-banner::before,
.call-hud::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(51, 255, 194, 0.08), transparent);
  transform: translateX(-100%);
  animation: scanline 4.5s linear infinite;
}

.hero-card,
.glass-card,
.wallet-card {
  padding: 22px;
}

.glass-card,
.wallet-card,
.incoming-banner {
  margin-top: 16px;
}

.hero-header,
.section-head,
.wallet-row,
.incoming-banner,
.history-item,
.bottom-nav,
.stats-grid {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero-header {
  margin-bottom: 18px;
}

.hero-state {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.wallet-value,
.metric-card h2 {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.08em;
}

.dialer-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(51, 255, 194, 0.1);
}

.dialer-status-light {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 14px rgba(255, 77, 109, 0.5);
}

.dialer-status-light.connecting {
  background: #fbbf24;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.5);
}

.dialer-status-light.online {
  background: var(--lime);
  box-shadow: 0 0 14px rgba(159, 255, 107, 0.55);
}

.dialer-status-copy {
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: rgba(188, 255, 232, 0.74);
  text-transform: uppercase;
}

.field-label {
  display: grid;
  gap: 12px;
  font-size: 0.66rem;
  font-weight: 800;
  color: #8df5d1;
}

.terminal-input {
  width: 100%;
  border: 1px solid rgba(51, 255, 194, 0.18);
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.42);
  color: #ecfdf5;
  padding: 16px 18px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.terminal-input:focus {
  border-color: rgba(51, 255, 194, 0.8);
  box-shadow: 0 0 0 4px rgba(51, 255, 194, 0.09), 0 0 26px rgba(51, 255, 194, 0.12);
}

.destination-input {
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.08em;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0 18px;
}

.keypad button {
  height: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: rgba(6, 78, 59, 0.12);
  border: 1px solid rgba(51, 255, 194, 0.14);
  color: #f8fffc;
  font-size: 1.6rem;
  font-weight: 800;
  box-shadow: inset 0 0 14px rgba(51, 255, 194, 0.08);
}

.keypad button:hover,
.nav-btn:hover,
.ghost-btn:hover,
.primary-btn:hover,
.call-btn:hover,
.danger-btn:hover {
  transform: translateY(-2px);
}

.keypad button:active,
.nav-btn:active,
.ghost-btn:active,
.primary-btn:active,
.call-btn:active,
.danger-btn:active {
  transform: translateY(1px) scale(0.98);
}

.keypad span {
  margin-top: 4px;
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  color: rgba(141, 245, 209, 0.72);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

button {
  border: 0;
  border-radius: 20px;
  padding: 16px 20px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.primary-btn,
.call-btn,
.danger-btn,
.ghost-btn {
  color: #03150f;
  border: 1px solid transparent;
}

.primary-btn,
.call-btn {
  background: linear-gradient(135deg, #33ffc2, #8bff5d);
  box-shadow: 0 12px 38px rgba(51, 255, 194, 0.2);
}

.danger-btn {
  color: #fff7fa;
  background: linear-gradient(135deg, #fb7185, #dc2626);
  box-shadow: 0 12px 38px rgba(255, 77, 109, 0.2);
}

.ghost-btn {
  color: #d6fff2;
  background: rgba(6, 78, 59, 0.08);
  border-color: rgba(51, 255, 194, 0.16);
}

.wide {
  grid-column: 1 / -1;
}

.mini,
.compact {
  padding: 12px 16px;
  font-size: 0.72rem;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.section-head {
  margin-bottom: 18px;
  gap: 14px;
}

.nano-copy,
.inline-status,
.history-meta {
  color: rgba(188, 255, 232, 0.58);
  font-size: 0.64rem;
  font-weight: 700;
}

.inline-status {
  margin-top: 14px;
  line-height: 1.6;
}

.incoming-banner {
  padding: 18px 20px;
  gap: 16px;
}

.incoming-banner.hidden,
.payment-panel.hidden,
.call-hud.hidden,
.sms-result-panel.hidden {
  display: none;
}

.dialer-hidden {
  display: none;
}

.call-hud {
  padding: 28px 24px 24px;
  text-align: center;
  animation: panel-rise 800ms cubic-bezier(0.18, 0.9, 0.2, 1) both;
}

.call-hud.hud-final .signal-ring {
  animation-duration: 1.4s, 4.8s;
}

.signal-ring {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 8px auto 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(7, 19, 18, 0.92) 0 44%, transparent 45% 100%),
    conic-gradient(
      from 140deg,
      transparent 0 18%,
      rgba(51, 255, 194, 0.8) 18% 24%,
      transparent 24% 40%,
      rgba(34, 211, 238, 0.72) 40% 46%,
      transparent 46% 66%,
      rgba(244, 114, 182, 0.58) 66% 72%,
      transparent 72% 100%
    );
  animation:
    hud-ring-roll 1.4s linear infinite,
    hud-signal-glitch 4.8s ease-in-out infinite;
  box-shadow:
    0 0 34px rgba(51, 255, 194, 0.18),
    0 0 70px rgba(34, 211, 238, 0.08),
    inset 0 0 30px rgba(0, 0, 0, 0.55);
  isolation: isolate;
}

.signal-ring::before,
.signal-ring::after {
  content: "";
  position: absolute;
  border-radius: inherit;
}

.signal-ring::before {
  inset: -10px;
  border: 1px solid rgba(51, 255, 194, 0.24);
  background:
    linear-gradient(transparent 0 38%, rgba(51, 255, 194, 0.2) 38% 42%, transparent 42% 100%),
    linear-gradient(90deg, rgba(244, 114, 182, 0.0), rgba(244, 114, 182, 0.18), rgba(34, 211, 238, 0.0));
  mix-blend-mode: screen;
  animation:
    hud-pulse 1.6s ease-in-out infinite,
    hud-scan-slice 1.2s ease-in-out infinite;
}

.signal-ring::after {
  inset: 18px;
  border: 10px solid transparent;
  border-top-color: rgba(51, 255, 194, 0.7);
  border-right-color: rgba(34, 211, 238, 0.32);
  filter: drop-shadow(0 0 14px rgba(51, 255, 194, 0.35));
  animation:
    hud-ring-counter 1.35s linear infinite,
    hud-flicker 1.6s ease-in-out infinite;
}

.signal-core {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(3, 21, 15, 0.98), rgba(3, 11, 18, 0.88));
  border: 1px solid rgba(51, 255, 194, 0.2);
  box-shadow:
    inset 0 0 22px rgba(51, 255, 194, 0.08),
    0 0 30px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.signal-core::before,
.signal-core::after {
  content: "";
  position: absolute;
  inset: 0;
}

.signal-core::before {
  background: repeating-linear-gradient(
    180deg,
    transparent 0 7px,
    rgba(51, 255, 194, 0.08) 7px 9px,
    transparent 9px 13px
  );
  opacity: 0.45;
  animation: hud-core-scan 1.8s linear infinite;
}

.signal-core::after {
  background:
    linear-gradient(90deg, transparent, rgba(244, 114, 182, 0.22), transparent),
    linear-gradient(180deg, rgba(34, 211, 238, 0.08), transparent, rgba(51, 255, 194, 0.08));
  mix-blend-mode: screen;
  opacity: 0.45;
  animation: hud-core-tear 2.8s ease-in-out infinite;
}

.signal-core span {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.28em;
  color: var(--glow);
  text-shadow:
    -1px 0 rgba(244, 114, 182, 0.45),
    1px 0 rgba(34, 211, 238, 0.45),
    0 0 18px rgba(51, 255, 194, 0.4);
  animation: hud-text-glitch 2.2s ease-in-out infinite;
}

.hud-destination,
.hud-metrics,
.hud-cid,
.hud-controls,
.call-hud .inline-status {
  position: relative;
  z-index: 1;
}

.hud-destination {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: #f8fffc;
  overflow-wrap: anywhere;
}

.hud-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.hud-stat,
.hud-cid {
  padding: 18px;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(51, 255, 194, 0.1);
}

.hud-stat span,
.hud-cid span {
  display: block;
  margin-bottom: 10px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: rgba(141, 245, 209, 0.74);
}

.hud-stat strong,
.hud-cid strong {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--lime);
}

.hud-cid {
  margin-top: 12px;
}

.hud-cid strong {
  display: block;
  font-size: 1.35rem;
  color: #ecfdf5;
  overflow-wrap: anywhere;
}

.hud-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.incoming-from {
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -0.04em;
}

.incoming-actions {
  display: flex;
  gap: 10px;
}

.stats-grid {
  gap: 12px;
  align-items: stretch;
}

.metric-card {
  flex: 1;
  padding: 18px;
}

.metric-card h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  gap: 14px;
  padding: 15px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(51, 255, 194, 0.08);
}

.history-number {
  font-weight: 800;
  color: #f8fffc;
  letter-spacing: -0.04em;
}

.history-redial {
  flex: 0 0 auto;
  padding-inline: 16px;
}

.wallet-row {
  margin-bottom: 20px;
}

.wallet-value {
  font-size: 3rem;
  color: var(--lime);
}

.vip-value {
  font-size: 2rem;
  letter-spacing: 0.08em;
}

.vip-buy-btn {
  width: 100%;
}

.rate-pill {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 20px;
  background: rgba(51, 255, 194, 0.08);
  border: 1px solid rgba(51, 255, 194, 0.12);
}

.rate-pill span {
  font-size: 0.6rem;
  font-weight: 800;
  color: rgba(141, 245, 209, 0.74);
}

.rate-pill strong {
  font-size: 1rem;
  color: #ecfdf5;
}

.topup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 14px;
}

.topup-form button {
  grid-column: 1 / -1;
}

.payment-panel {
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(51, 255, 194, 0.1);
}

.sms-message-box {
  min-height: 160px;
  resize: vertical;
  line-height: 1.6;
}

.sms-result-panel {
  margin-top: 18px;
}

.sms-result-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.sms-result-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(51, 255, 194, 0.08);
  font-size: 0.72rem;
  font-weight: 800;
  color: #d6fff2;
}

.sms-result-row span {
  overflow-wrap: anywhere;
}

.sms-result-row strong {
  color: var(--lime);
}

.payment-link {
  margin-top: 14px;
  display: inline-flex;
  text-decoration: none;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.66rem;
  font-weight: 800;
  color: #8df5d1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.checkbox-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--glow);
}

.event-log {
  min-height: 190px;
  max-height: 260px;
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background: #020c0a;
  border: 1px solid rgba(51, 255, 194, 0.08);
  color: #b9ffe9;
  font: 700 0.72rem/1.7 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: pre-wrap;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 28px;
  background: rgba(2, 12, 10, 0.84);
  border: 1px solid rgba(51, 255, 194, 0.14);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 30px rgba(51, 255, 194, 0.06);
  gap: 10px;
  z-index: 40;
}

.hidden-config {
  display: none;
}

.terminal-panel.locked {
  display: none;
}

.nav-btn {
  flex: 1;
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 14px 10px;
  border-radius: 20px;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(188, 255, 232, 0.6);
  font-size: 0.62rem;
  font-weight: 900;
}

.nav-btn.active {
  color: var(--glow);
  background: rgba(51, 255, 194, 0.08);
  border-color: rgba(51, 255, 194, 0.14);
  box-shadow: inset 0 0 18px rgba(51, 255, 194, 0.06);
}

.nav-icon {
  font-size: 1.2rem;
}

@keyframes screen-rise {
  from {
    opacity: 0;
    transform: translateY(36px) scale(0.98);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(48px) rotateX(16deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

@keyframes scanline {
  0% {
    transform: translateX(-100%);
  }
  45%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes grid-drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(38px);
  }
}

@keyframes orb-float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-24px) scale(1.08);
  }
}

@keyframes status-ping {
  0% {
    transform: scale(0.75);
    opacity: 0.5;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes hud-ring-roll {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes hud-ring-counter {
  100% {
    transform: rotate(-360deg);
  }
}

@keyframes hud-signal-glitch {
  0%,
  100% {
    opacity: 1;
    filter: hue-rotate(0deg);
    transform: translateX(0) skewX(0deg);
  }

  40% {
    opacity: 1;
    filter: hue-rotate(0deg);
    transform: translateX(0) skewX(0deg);
  }

  44% {
    opacity: 0.9;
    filter: hue-rotate(10deg) saturate(1.12);
    transform: translateX(-1px) skewX(-1.2deg);
  }

  48% {
    opacity: 1;
    filter: hue-rotate(0deg);
    transform: translateX(0) skewX(0deg);
  }
}

@keyframes hud-scan-slice {
  0% {
    transform: translateY(-12px);
    opacity: 0.85;
  }

  100% {
    transform: translateY(12px);
    opacity: 0.55;
  }
}

@keyframes hud-flicker {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

@keyframes hud-core-scan {
  from {
    transform: translateY(-16px);
  }

  to {
    transform: translateY(16px);
  }
}

@keyframes hud-core-tear {
  0%,
  100% {
    transform: translateX(0);
    opacity: 0.35;
  }

  50% {
    transform: translateX(2px);
    opacity: 0.6;
  }
}

@keyframes hud-text-glitch {
  0%,
  100% {
    transform: translateX(0) skewX(0deg);
  }

  45% {
    transform: translateX(0) skewX(0deg);
  }

  50% {
    transform: translateX(-1px) skewX(-2deg);
  }

  55% {
    transform: translateX(1px) skewX(2deg);
  }
}


@keyframes hud-pulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.35;
  }

  50% {
    transform: scale(1.08);
    opacity: 0.8;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding-inline: 12px;
  }

  h1 {
    font-size: 1.65rem;
  }

  .hero-card,
  .glass-card,
  .wallet-card {
    padding: 18px;
    border-radius: 24px;
  }

  .keypad {
    gap: 10px;
  }

  .keypad button {
    height: 72px;
    border-radius: 20px;
  }

  .metric-card h2 {
    font-size: 1.45rem;
  }
}
