.topup-shell {
    --topup-bg: #0f1720;
    --topup-surface: #151f29;
    --topup-surface-soft: #192631;
    --topup-border: #283743;
    --topup-border-strong: #344957;
    --topup-blue: #0b8fff;
    --topup-blue-hover: #2aa0ff;
    --topup-blue-soft: rgba(11, 143, 255, .12);
    --topup-green: #2ed38a;
    --topup-green-soft: rgba(46, 211, 138, .12);
    --topup-amber: #f1b94b;
    --topup-amber-soft: rgba(241, 185, 75, .12);
    --topup-text: #f3f7fa;
    --topup-muted: #91a3b1;
    --topup-faint: #657783;
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 4px 0 56px;
    color: var(--topup-text);
}

.topup-shell button,
.topup-shell input {
    font-family: inherit;
}

.topup-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.topup-eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    color: #6dbbfb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.topup-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--topup-green);
    box-shadow: 0 0 0 5px rgba(46, 211, 138, .1);
}

.topup-heading h1 {
    margin: 0;
    font-size: clamp(27px, 3vw, 36px);
    line-height: 1.18;
    font-weight: 900;
    letter-spacing: -.035em;
}

.topup-heading p {
    margin: 8px 0 0;
    color: var(--topup-muted);
    font-size: 13px;
    line-height: 1.65;
}

.topup-current-balance {
    min-width: 190px;
    padding: 13px 16px;
    border: 1px solid var(--topup-border);
    border-radius: 13px;
    background: linear-gradient(145deg, rgba(25, 38, 49, .95), rgba(17, 27, 35, .95));
    text-align: right;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
}

.topup-current-balance span {
    display: block;
    margin-bottom: 3px;
    color: var(--topup-faint);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.topup-current-balance strong {
    color: var(--topup-green);
    font-family: 'JetBrains Mono', monospace;
    font-size: 19px;
    font-weight: 800;
}

.topup-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, .92fr);
    gap: 18px;
    align-items: stretch;
}

.topup-card {
    border: 1px solid var(--topup-border);
    border-radius: 20px;
    background:
        radial-gradient(420px 180px at 0 0, rgba(11, 143, 255, .055), transparent 65%),
        linear-gradient(145deg, rgba(22, 33, 43, .98), rgba(16, 25, 33, .98));
    box-shadow: 0 22px 50px rgba(0, 0, 0, .2);
}

.topup-form-card,
.topup-payment-card {
    padding: 24px;
}

.topup-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.topup-card-heading > div:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.topup-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(11, 143, 255, .28);
    border-radius: 10px;
    background: var(--topup-blue-soft);
    color: #67bcff;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 800;
}

.topup-card-heading h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 850;
    letter-spacing: -.015em;
}

.topup-card-heading p {
    margin: 4px 0 0;
    color: var(--topup-muted);
    font-size: 11px;
    line-height: 1.55;
}

.topup-amount-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin-top: 23px;
}

.topup-amount-option {
    min-height: 65px;
    padding: 9px 8px;
    border: 1px solid var(--topup-border);
    border-radius: 12px;
    outline: none;
    background: rgba(10, 18, 24, .48);
    color: var(--topup-text);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.topup-amount-option:hover {
    border-color: #3d6077;
    background: rgba(21, 37, 49, .86);
    transform: translateY(-1px);
}

.topup-amount-option:focus-visible {
    box-shadow: 0 0 0 3px rgba(11, 143, 255, .22);
}

.topup-amount-option strong,
.topup-amount-option span {
    display: block;
}

.topup-amount-option strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 800;
}

.topup-amount-option span {
    margin-top: 3px;
    color: var(--topup-faint);
    font-size: 9px;
}

.topup-amount-option.active {
    border-color: var(--topup-blue);
    background: linear-gradient(145deg, rgba(11, 143, 255, .2), rgba(11, 143, 255, .08));
    color: #83c8ff;
    box-shadow: inset 0 0 0 1px rgba(11, 143, 255, .12), 0 9px 24px rgba(11, 143, 255, .09);
}

.topup-amount-option.active span {
    color: #8ab9dc;
}

.topup-field {
    margin-top: 20px;
}

.topup-field > label {
    display: block;
    margin-bottom: 8px;
    color: var(--topup-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.topup-money-input {
    display: flex;
    align-items: center;
    height: 50px;
    border: 1px solid var(--topup-border);
    border-radius: 12px;
    background: rgba(8, 15, 20, .65);
    transition: border-color .16s ease, box-shadow .16s ease;
}

.topup-money-input:focus-within {
    border-color: var(--topup-blue);
    box-shadow: 0 0 0 3px rgba(11, 143, 255, .11);
}

.topup-money-input.invalid {
    border-color: #eb6871;
    box-shadow: 0 0 0 3px rgba(235, 104, 113, .09);
}

.topup-money-input > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    color: #71bfff;
    font-size: 16px;
    font-weight: 800;
}

.topup-money-input input {
    min-width: 0;
    height: 100%;
    flex: 1;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--topup-text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
}

.topup-money-input input::placeholder {
    color: #52636f;
    font-family: 'Be Vietnam Pro', sans-serif;
    font-size: 12px;
    font-weight: 500;
}

.topup-money-input b {
    padding: 0 14px;
    color: var(--topup-faint);
    font-size: 9px;
    letter-spacing: .08em;
}

.topup-field-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 18px;
    padding: 5px 2px 0;
}

.topup-field-meta small {
    color: var(--topup-faint);
    font-size: 9px;
    line-height: 1.45;
}

.topup-field-meta .topup-field-error {
    color: #ff8c94;
    text-align: right;
}

.topup-bank-panel {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 13px;
    border: 1px solid var(--topup-border);
    border-radius: 13px;
    background: rgba(25, 38, 49, .56);
}

.topup-bank-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(145deg, #158be9, #0868bd);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(11, 143, 255, .18);
}

.topup-bank-main span,
.topup-bank-account span {
    display: block;
    margin-bottom: 3px;
    color: var(--topup-faint);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.topup-bank-main strong {
    display: block;
    font-size: 12px;
}

.topup-bank-main small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--topup-muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topup-bank-account {
    text-align: right;
}

.topup-bank-account strong {
    display: block;
    font-size: 12px;
    letter-spacing: .04em;
}

.topup-copy-link {
    margin-top: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #62b8fb;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
}

.topup-copy-link:hover {
    color: #9bd3ff;
}

.topup-primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 50px;
    margin-top: 17px;
    border: 1px solid #229eff;
    border-radius: 12px;
    outline: none;
    background: linear-gradient(135deg, #0b8fff, #0875db);
    color: #fff;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(11, 143, 255, .2);
    transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}

.topup-primary-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 15px 34px rgba(11, 143, 255, .26);
}

.topup-primary-button:focus-visible {
    box-shadow: 0 0 0 4px rgba(11, 143, 255, .25);
}

.topup-primary-button svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.topup-safety-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 13px;
    color: var(--topup-faint);
    font-size: 9px;
    line-height: 1.5;
    text-align: center;
}

.topup-safety-note svg {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    fill: none;
    stroke: #56ba8b;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.topup-payment-card {
    display: flex;
    flex-direction: column;
}

.topup-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 6px 9px;
    border: 1px solid var(--topup-border);
    border-radius: 999px;
    color: var(--topup-muted);
    white-space: nowrap;
}

.topup-status span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--topup-faint);
}

.topup-status b {
    font-size: 8px;
    font-weight: 800;
}

.topup-status-waiting {
    border-color: rgba(241, 185, 75, .2);
    background: var(--topup-amber-soft);
    color: #f5cd7e;
}

.topup-status-waiting span {
    background: var(--topup-amber);
    box-shadow: 0 0 0 4px rgba(241, 185, 75, .1);
    animation: topupPulse 1.7s ease-in-out infinite;
}

.topup-status-success {
    border-color: rgba(46, 211, 138, .24);
    background: var(--topup-green-soft);
    color: #7be5b3;
}

.topup-status-success span {
    background: var(--topup-green);
    box-shadow: 0 0 0 4px rgba(46, 211, 138, .1);
}

@keyframes topupPulse {
    50% {
        opacity: .5;
        transform: scale(.8);
    }
}

.topup-qr-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 390px;
    flex: 1;
    margin-top: 18px;
    border: 1px dashed #304552;
    border-radius: 16px;
    background:
        radial-gradient(circle at center, rgba(11, 143, 255, .055), transparent 58%),
        rgba(8, 15, 20, .36);
}

.topup-qr-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 30px;
    color: var(--topup-muted);
    text-align: center;
}

.topup-qr-empty[hidden] {
    display: none;
}

.topup-qr-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 86px;
    height: 86px;
    margin-bottom: 16px;
    border: 1px solid var(--topup-border);
    border-radius: 22px;
    background: rgba(25, 38, 49, .7);
    color: #56717f;
}

.topup-qr-placeholder svg {
    width: 44px;
    height: 44px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.35;
}

.topup-qr-empty strong {
    color: #b9c5cc;
    font-size: 12px;
}

.topup-qr-empty > span {
    margin-top: 5px;
    color: var(--topup-faint);
    font-size: 10px;
}

.topup-qr-result {
    width: 100%;
    padding: 18px;
    text-align: center;
}

.topup-qr-result[hidden] {
    display: none;
}

.topup-qr-frame {
    position: relative;
    width: 208px;
    height: 208px;
    margin: 0 auto;
    padding: 8px;
    overflow: hidden;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 15px 34px rgba(0, 0, 0, .25);
}

.topup-qr-frame img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 9px;
    object-fit: contain;
}

.topup-qr-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 9px;
    background: rgba(255, 255, 255, .96);
    color: #52606b;
    font-size: 9px;
    font-weight: 700;
}

.topup-qr-loading.is-hidden {
    display: none;
}

.topup-qr-loading span {
    width: 23px;
    height: 23px;
    border: 3px solid #dceaf4;
    border-top-color: var(--topup-blue);
    border-radius: 50%;
    animation: topupSpin .75s linear infinite;
}

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

.topup-qr-instruction {
    margin: 12px 0;
    color: var(--topup-muted);
    font-size: 9px;
}

.topup-payment-summary {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    gap: 9px;
    text-align: left;
}

.topup-payment-summary > div {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--topup-border);
    border-radius: 10px;
    background: rgba(25, 38, 49, .62);
}

.topup-payment-summary span {
    display: block;
    margin-bottom: 4px;
    color: var(--topup-faint);
    font-size: 8px;
    font-weight: 750;
    text-transform: uppercase;
}

.topup-payment-summary strong {
    overflow: hidden;
    color: var(--topup-text);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#topupQrAmount {
    color: var(--topup-green);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.topup-code-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
}

.topup-copy-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    padding: 0;
    border: 1px solid #365163;
    border-radius: 7px;
    background: rgba(11, 143, 255, .08);
    color: #74c2ff;
    cursor: pointer;
}

.topup-copy-button:hover {
    border-color: var(--topup-blue);
    background: var(--topup-blue-soft);
}

.topup-copy-button svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.topup-important-note {
    margin-top: 9px;
    padding: 9px 11px;
    border: 1px solid rgba(241, 185, 75, .17);
    border-radius: 9px;
    background: var(--topup-amber-soft);
    color: #bea66f;
    font-size: 8.5px;
    line-height: 1.55;
    text-align: left;
}

.topup-important-note b {
    color: #f2ca7c;
}

.topup-poll-message {
    margin-top: 8px;
    padding: 9px 11px;
    border: 1px solid var(--topup-border);
    border-radius: 9px;
    background: rgba(25, 38, 49, .65);
    color: var(--topup-muted);
    font-size: 8.5px;
    line-height: 1.55;
    text-align: left;
}

.topup-poll-message[hidden] {
    display: none;
}

.topup-poll-message.success {
    border-color: rgba(46, 211, 138, .22);
    background: var(--topup-green-soft);
    color: #83e8b8;
}

.topup-poll-message.warning {
    border-color: rgba(241, 185, 75, .2);
    background: var(--topup-amber-soft);
    color: #d7bd82;
}

.topup-poll-message.error {
    border-color: rgba(235, 104, 113, .22);
    background: rgba(235, 104, 113, .09);
    color: #ff9ca3;
}

.topup-history-section {
    margin-top: 18px;
    padding: 21px 22px;
    border: 1px solid var(--topup-border);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(22, 33, 43, .95), rgba(16, 25, 33, .95));
}

.topup-history-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.topup-history-heading h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 850;
}

.topup-history-heading p {
    margin: 4px 0 0;
    color: var(--topup-faint);
    font-size: 9px;
}

.topup-history-heading > span {
    padding: 6px 9px;
    border: 1px solid var(--topup-border);
    border-radius: 999px;
    color: var(--topup-muted);
    font-size: 8px;
}

.topup-history-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    min-height: 130px;
    margin-top: 16px;
    border: 1px dashed #2c3e49;
    border-radius: 13px;
    background: rgba(8, 15, 20, .26);
    text-align: center;
}

.topup-history-empty > div {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 9px;
    border-radius: 10px;
    background: rgba(25, 38, 49, .8);
    color: #59717e;
}

.topup-history-empty svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
}

.topup-history-empty strong {
    color: #aab9c2;
    font-size: 10px;
}

.topup-history-empty span {
    margin-top: 4px;
    color: var(--topup-faint);
    font-size: 8.5px;
}

.topup-history-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
}

.topup-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.topup-history-table th {
    padding: 9px 11px;
    border-bottom: 1px solid var(--topup-border);
    color: var(--topup-faint);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
}

.topup-history-table td {
    padding: 12px 11px;
    border-bottom: 1px solid rgba(40, 55, 67, .65);
    color: var(--topup-muted);
}

.topup-history-table tbody tr:last-child td {
    border-bottom: 0;
}

.topup-history-table td strong,
.topup-history-table td small {
    display: block;
}

.topup-history-table td strong {
    color: #c8d3da;
    font-size: 9px;
}

.topup-history-table td small {
    margin-top: 3px;
    color: var(--topup-faint);
    font-size: 8px;
}

.topup-align-right {
    text-align: right !important;
}

.topup-history-money {
    color: var(--topup-green) !important;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
}

.topup-history-money.is-rejected {
    color: var(--topup-amber) !important;
}

.topup-history-status {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 750;
}

.topup-history-status.success {
    background: var(--topup-green-soft);
    color: #78e3af;
}

.topup-history-status.pending {
    background: var(--topup-blue-soft);
    color: #71bdff;
}

.topup-history-status.warning {
    background: var(--topup-amber-soft);
    color: #f2c971;
}

.topup-system-alert {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px;
    border: 1px solid rgba(235, 104, 113, .26);
    border-radius: 15px;
    background: rgba(235, 104, 113, .08);
}

.topup-system-alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 10px;
    background: rgba(235, 104, 113, .14);
    color: #ff8f97;
    font-weight: 900;
}

.topup-system-alert strong {
    font-size: 12px;
}

.topup-system-alert p {
    margin: 3px 0 0;
    color: var(--topup-muted);
    font-size: 10px;
}

.topup-copy-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    padding: 11px 15px;
    border: 1px solid rgba(46, 211, 138, .25);
    border-radius: 10px;
    background: #172a24;
    color: #8ce9bb;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px);
    transition: opacity .18s ease, transform .18s ease;
}

.topup-copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 930px) {
    .topup-layout {
        grid-template-columns: 1fr;
    }

    .topup-payment-card {
        min-height: 510px;
    }
}

@media (max-width: 640px) {
    .topup-shell {
        padding-top: 0;
    }

    .topup-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 15px;
    }

    .topup-heading h1 {
        font-size: 27px;
    }

    .topup-current-balance {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-width: 0;
        text-align: left;
    }

    .topup-current-balance span {
        margin: 0;
    }

    .topup-current-balance strong {
        font-size: 16px;
    }

    .topup-card,
    .topup-history-section {
        border-radius: 16px;
    }

    .topup-form-card,
    .topup-payment-card {
        padding: 18px;
    }

    .topup-amount-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .topup-bank-panel {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .topup-bank-account {
        grid-column: 1 / -1;
        padding-top: 10px;
        border-top: 1px solid var(--topup-border);
        text-align: left;
    }

    .topup-status {
        position: absolute;
        top: 16px;
        right: 16px;
    }

    .topup-payment-card {
        position: relative;
        min-height: 0;
    }

    .topup-payment-card .topup-card-heading {
        padding-right: 90px;
    }

    .topup-qr-stage {
        min-height: 340px;
    }

    .topup-payment-summary {
        grid-template-columns: 1fr;
    }

    .topup-history-section {
        padding: 18px;
    }
}

@media (max-width: 420px) {
    .topup-card-heading p {
        max-width: 210px;
    }

    .topup-qr-frame {
        width: 190px;
        height: 190px;
    }

    .topup-field-meta {
        display: block;
    }

    .topup-field-meta .topup-field-error {
        display: block;
        margin-top: 2px;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .topup-shell *,
    .topup-shell *::before,
    .topup-shell *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
