:root {
  --bg-0: #0a0e1a;
  --bg-1: #121829;
  --bg-2: #1a2139;
  --gold: #f5c518;
  --gold-2: #e0a800;
  --gold-bright: #ffd070;
  --text: #eef1f8;
  --muted: #8a93a8;
  --border: #253057;
  --border-gold: rgba(212, 160, 23, 0.35);
  --err: #f85149;
  --panel-grad: linear-gradient(180deg, rgba(40, 20, 70, 0.45), rgba(15, 5, 30, 0.75));
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg-0);
  background-image:
    radial-gradient(ellipse at 30% 12%, rgba(255, 192, 96, 0.14) 0%, transparent 28%),
    radial-gradient(ellipse at 80% 20%, rgba(157, 78, 221, 0.12) 0%, transparent 32%),
    linear-gradient(180deg, #3a1a4a 0%, #1a0a2a 38%, #000510 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.45) 100%);
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 28px 18px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(245, 197, 24, 0.25);
}

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

.brand-name {
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
  line-height: 1.15;
}

.brand-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(240, 224, 176, 0.55);
}

.back-link {
  font-size: 0.82rem;
  color: rgba(240, 224, 176, 0.72);
  text-decoration: none;
  white-space: nowrap;
}
.back-link:hover {
  color: var(--gold-bright);
}

.card {
  background: var(--panel-grad);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 24px 20px 22px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card-head {
  margin-bottom: 18px;
}

.card-head h1 {
  margin: 0 0 8px;
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
  font-size: 1.45rem;
  color: var(--gold-bright);
  letter-spacing: 0.03em;
}

.card-head .sub {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(240, 224, 176, 0.68);
}

.methods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.method-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  background: rgba(0, 0, 0, 0.25);
}

.account-badge {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-gold);
  font-size: 0.88rem;
}
.account-badge.visible {
  display: flex;
}
.account-badge strong {
  color: var(--gold-bright);
  font-weight: 700;
}
.account-badge span {
  color: var(--muted);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(10, 14, 26, 0.85);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 197, 24, 0.15);
}
.field input:read-only {
  opacity: 0.85;
  cursor: default;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.quick-amounts button {
  padding: 9px 4px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.quick-amounts button:hover,
.quick-amounts button.active {
  background: var(--gold);
  color: #1a1a1a;
}

.field-hint {
  margin: -6px 0 14px;
  font-size: 0.76rem;
  color: rgba(240, 224, 176, 0.5);
  line-height: 1.4;
}

#ref-wrap.hidden {
  display: none;
}

.msg-err {
  color: var(--err);
  font-size: 0.875rem;
  margin: 0 0 10px;
  min-height: 1.2em;
}

.msg-warn {
  display: none;
  font-size: 0.875rem;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.35);
  color: #ffb4af;
  line-height: 1.45;
}

.btn-submit {
  width: 100%;
  margin-top: 6px;
  padding: 15px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: Cinzel, Georgia, serif;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1a1a;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  box-shadow: 0 8px 28px rgba(245, 197, 24, 0.28);
  transition: filter 0.15s, transform 0.1s;
}
.btn-submit:hover:not(:disabled) {
  filter: brightness(1.08);
}
.btn-submit:active:not(:disabled) {
  transform: scale(0.99);
}
.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.trust {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(37, 48, 87, 0.8);
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
  color: rgba(240, 224, 176, 0.42);
  letter-spacing: 0.02em;
}

.trust .lock {
  color: var(--gold);
  margin-right: 4px;
}

.page-footer {
  margin-top: auto;
  padding-top: 20px;
  text-align: center;
  font-size: 0.7rem;
  color: rgba(138, 147, 168, 0.7);
}

.page.checkout-mode .page-footer {
  padding-top: 12px;
}

.page.checkout-mode {
  max-width: 520px;
}

.checkout-panel {
  padding: 0;
  overflow: hidden;
}

.checkout-panel .card-head.compact {
  padding: 18px 20px 12px;
  margin: 0;
  border-bottom: 1px solid rgba(37, 48, 87, 0.6);
}

.checkout-panel .card-head.compact h1 {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.checkout-panel .card-head.compact .sub {
  font-size: 0.82rem;
  margin: 0;
}

.pay-frame-wrap {
  background: #0d1117;
  min-height: min(72vh, 640px);
}

.pay-frame-wrap iframe {
  display: block;
  width: 100%;
  height: min(72vh, 640px);
  border: 0;
}

.btn-back-form {
  display: inline-block;
  margin: 12px 20px 16px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(240, 224, 176, 0.72);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}
.btn-back-form:hover {
  color: var(--gold-bright);
}

#depositCard[hidden],
#checkoutPanel[hidden] {
  display: none !important;
}

@media (max-width: 380px) {
  .quick-amounts {
    grid-template-columns: repeat(2, 1fr);
  }
  .brand-name {
    font-size: 0.92rem;
  }
  .pay-frame-wrap iframe {
    height: min(68vh, 560px);
  }
}
