*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #e8f0ec;
  --bg-deep: #d4e5db;
  --surface: #ffffff;
  --ink: #0f1f17;
  --ink-soft: #4a6356;
  --ink-muted: #7a9184;
  --accent: #0d7a4f;
  --accent-dark: #095c3b;
  --accent-soft: #e6f5ee;
  --accent-ring: rgba(13, 122, 79, 0.28);
  --line: #d5e3db;
  --shadow: 0 8px 28px rgba(15, 61, 40, 0.08);
  --radius: 18px;
  --font: "Plus Jakarta Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

html,
body {
  width: 100%;
  min-height: 100%;
  font-family: var(--font);
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, #b8dcc8 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--ink);
}

body {
  padding-bottom: 110px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 28, 20, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #3ecf8e;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(13, 122, 79, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(13, 122, 79, 0);
  }
}

.page {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 16px 0;
  animation: fadeUp 0.45s ease both;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #12a868 0%, #0d7a4f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 4px 12px rgba(13, 122, 79, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
}

.brand-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 650;
  color: var(--accent-dark);
}

.secure-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.amount-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.amount-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #0d7a4f, #2bb673, #0d7a4f);
}

.amount-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.amount {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--ink);
}

.amount .currency {
  font-size: 28px;
  font-weight: 700;
  margin-right: 4px;
  vertical-align: 4px;
  color: var(--accent);
}

.amount-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 18px 14px 14px;
  animation: fadeUp 0.5s ease 0.08s both;
}

.card-head {
  padding: 0 4px 14px;
}

.card .title {
  font-size: 16px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.card .subtitle {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
  line-height: 1.4;
}

.pay-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pay-list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fafcfb;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
  user-select: none;
}

.pay-list li:active {
  transform: scale(0.985);
}

.pay-list li.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-ring);
  animation: softPulse 1.8s ease 1;
}

.pay-list li img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
  background: #fff;
}

.pay-list li .name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.pay-list li .radio {
  width: 22px;
  height: 22px;
  border: 2px solid #b7c9bf;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}

.pay-list li.selected .radio {
  border-color: var(--accent);
  background: var(--accent);
}

.pay-list li.selected .radio::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 3px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 16px;
  font-weight: 500;
  line-height: 1.45;
  padding: 0 8px;
}

.pay-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(213, 227, 219, 0.9);
  z-index: 100;
}

.pay-btn {
  display: block;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  height: 54px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #12965f 0%, #0d7a4f 100%);
  color: #fff;
  font-size: 17px;
  font-weight: 750;
  font-family: inherit;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(13, 122, 79, 0.32);
  transition: transform 0.12s, filter 0.15s, opacity 0.15s;
}

.pay-btn:active {
  transform: scale(0.985);
  filter: brightness(0.95);
}

.pay-btn:disabled {
  background: #9bb5a8;
  box-shadow: none;
  cursor: not-allowed;
}
