/* Steam top-up card: login, amount presets, email, live total, pay button, "payment soon" state. */
.topup {
  position: relative;
  display: flex; flex-direction: column;
  padding: 20px 20px 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #1A1E28 0%, var(--s1) 46%, #101218 100%);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-2);
  isolation: isolate;
}
.topup::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(160deg, rgba(198, 242, 78, 0.55), rgba(198, 242, 78, 0) 34%, rgba(107, 149, 255, 0) 70%, rgba(107, 149, 255, 0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.topup__glow {
  position: absolute; left: 0; right: 0; top: 0; height: 160px; z-index: -1; pointer-events: none;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: radial-gradient(70% 100% at 18% 0%, rgba(198, 242, 78, 0.13), transparent 70%);
}
.topup__head { display: flex; align-items: center; gap: 12px; }
.topup__steam {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #2a475e, #1b2838);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset, 0 10px 20px -10px rgba(0, 0, 0, 0.9);
}
.topup__titles { min-width: 0; }
.topup h1 { font-family: var(--font-display); font-size: 18px; white-space: nowrap; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.topup__titles .nw { white-space: nowrap; }
.topup__titles p { margin-top: 3px; font-size: 12.5px; color: var(--text-2); line-height: 1.35; }
.topup__region {
  margin-left: auto; align-self: flex-start; flex: none;
  padding: 3px 7px; border-radius: 7px;
  font-size: 11px; font-weight: 700; color: var(--text-2);
  background: var(--s3); border: 1px solid var(--line-2);
}
.topup__form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.field { position: relative; }
.field__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; min-height: 22px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field__aside { font-size: 12px; color: var(--text-3); }
.link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 28px; padding: 0 2px;
  font-size: 12.5px; font-weight: 600; color: var(--lime);
  border-bottom: 1px dashed transparent;
  transition: color var(--dur-fast);
}
.link-btn svg { width: 15px; height: 15px; }
.link-btn:hover { color: var(--lime-hi); }
.link-btn span { border-bottom: 1px dashed rgba(198, 242, 78, 0.45); }

.input {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 50px; padding: 0 14px;
  border-radius: var(--r-s);
  background: var(--field);
  border: 1px solid var(--line-2);
  transition: border-color var(--dur-fast), box-shadow var(--dur), background var(--dur-fast);
}
.input:hover { border-color: var(--line-3); }
.input:focus-within { border-color: var(--lime-a40); box-shadow: 0 0 0 4px var(--lime-a10); }
.input__ico { width: 19px; height: 19px; color: var(--text-3); flex: none; transition: color var(--dur-fast); }
.input:focus-within .input__ico { color: var(--lime); }
.input input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  font-size: 16px; color: var(--text);
}
.input input::placeholder { color: #5E6475; }
.input__ok { width: 18px; height: 18px; color: var(--ok); stroke-width: 2.6; flex: none; opacity: 0; transform: scale(0.6); transition: opacity var(--dur), transform var(--dur) var(--ease-expo); }
.field.is-valid .input__ok { opacity: 1; transform: none; }
.field.is-invalid .input { border-color: rgba(255, 97, 112, 0.7); background: linear-gradient(0deg, var(--danger-a), var(--danger-a)), var(--field); }
.field.is-invalid .input:focus-within { box-shadow: 0 0 0 4px rgba(255, 97, 112, 0.14); }
.field.is-invalid .input__ico { color: var(--danger); }
.field__msg { margin-top: 6px; font-size: 12.5px; line-height: 1.35; color: var(--text-3); }
.field.is-invalid .field__msg { color: #FF8C97; }

.input--amount input { font-weight: 700; font-size: 20px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.input__suffix { font-weight: 700; font-size: 18px; color: var(--text-3); }

.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.preset {
  height: 44px; border-radius: 10px;
  background: var(--s2); border: 1px solid var(--line-2);
  font-weight: 700; font-size: 14px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
.preset:hover { color: var(--text); border-color: var(--line-3); background: var(--s3); }
.preset:active { transform: scale(0.96); }
.preset[aria-pressed="true"] { color: var(--lime); border-color: var(--lime-a40); background: var(--lime-a10); box-shadow: 0 0 0 1px var(--lime-a20) inset; }

.help {
  position: absolute; left: -6px; right: -6px; top: 32px; z-index: 20;
  padding: 16px;
  border-radius: var(--r-m);
  background: #232836;
  border: 1px solid var(--line-3);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.95);
  animation: pop var(--dur) var(--ease-expo);
}
.help__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.help__head strong { font-size: 15px; }
.help__close { width: 36px; height: 36px; margin: -6px -6px 0 0; display: grid; place-items: center; border-radius: 10px; color: var(--text-2); }
.help__close:hover { background: var(--s4); color: var(--text); }
.help__close svg { width: 18px; height: 18px; }
.help__steps { margin-top: 10px; display: grid; gap: 8px; counter-reset: s; }
.help__steps li { position: relative; padding-left: 32px; font-size: 13.5px; line-height: 1.45; color: var(--text); counter-increment: s; }
.help__steps li::before {
  content: counter(s); position: absolute; left: 0; top: -1px;
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--lime-ink); background: var(--lime);
}
.help__note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.help__warn { margin-top: 8px; font-size: 12.5px; line-height: 1.45; color: var(--code); }

.pay-sum {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 2px; padding: 12px 14px;
  border-radius: var(--r-s);
  background: repeating-linear-gradient(90deg, var(--line-3) 0 6px, transparent 6px 11px) top / 100% 1px no-repeat, rgba(255, 255, 255, 0.025);
}
.pay-sum__left { display: grid; gap: 1px; min-width: 0; }
.pay-sum__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.pay-sum__break { font-size: 12px; color: var(--text-3); }
.pay-sum__total {
  font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.pay-sum__total.is-bump { animation: bump 380ms var(--ease-expo); }
@keyframes bump { 40% { color: var(--lime); transform: translateY(-2px); } }

.btn-pay {
  position: relative; overflow: hidden;
  height: 56px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: var(--r-m);
  background: var(--lime); color: var(--lime-ink);
  font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
  box-shadow: 0 16px 34px -16px rgba(198, 242, 78, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  transition: background var(--dur-fast), box-shadow var(--dur), transform var(--dur-fast) var(--ease);
}
.btn-pay::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 30%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg); transition: left 700ms var(--ease);
}
.btn-pay:hover { background: var(--lime-hi); box-shadow: 0 20px 44px -16px rgba(198, 242, 78, 1), 0 0 0 1px rgba(255, 255, 255, 0.3) inset; }
.btn-pay:hover::after { left: 120%; }
.btn-pay:active { transform: scale(0.985); }
.btn-pay__arrow { width: 20px; height: 20px; stroke-width: 2.6; transition: transform var(--dur) var(--ease); }
.btn-pay:hover .btn-pay__arrow { transform: translateX(4px); }
.btn-pay.is-busy { pointer-events: none; }
.btn-pay.is-busy .btn-pay__text, .btn-pay.is-busy .btn-pay__arrow { opacity: 0; }
.btn-pay.is-busy::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; border: 2.5px solid rgba(11, 14, 5, 0.25); border-top-color: var(--lime-ink);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.topup__foot { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; color: var(--text-3); text-align: center; }
.topup__foot svg { width: 14px; height: 14px; flex: none; }

/* "payment soon" state */
.topup__done { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; flex: 1; animation: pop var(--dur-slow) var(--ease-expo); }
.done__icon {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  background: var(--lime-a10); color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime-a20) inset, 0 0 40px -6px rgba(198, 242, 78, 0.35);
}
.done__icon svg { width: 28px; height: 28px; stroke-width: 2; }
.done__title { font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.done__text { font-size: 14px; line-height: 1.5; color: var(--text-2); }
.done__list { display: grid; gap: 0; border-radius: var(--r-s); background: var(--field); border: 1px solid var(--line-2); }
.done__list div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; font-size: 14px; }
.done__list div + div { border-top: 1px solid var(--line); }
.done__list dt { color: var(--text-3); }
.done__list dd { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.done__list .is-total dd { color: var(--lime); font-family: var(--font-display); font-weight: 700; }
.topup__done .btn-ghost { margin-top: auto; }

@media (max-width: 1023px) {
  .topup { padding: 16px 16px 14px; border-radius: var(--r-l); }
  .topup__head { gap: 10px; }
  .topup__steam { width: 42px; height: 42px; border-radius: 13px; }
  .topup h1 { font-size: 18px; white-space: normal; }
  .topup__region { display: none; }
  .topup__form { margin-top: 12px; gap: 10px; }
  .field__top { margin-bottom: 5px; }
  #field-login:not(.is-invalid) .field__msg { display: none; }
  .input { height: 48px; }
  .pay-sum { padding: 9px 12px; }
  .btn-pay { height: 52px; }
  .pay-sum__total { font-size: 24px; }
}

@media (max-width: 1279px) {
  .topup__region { display: none; }
}
