/* ============================================
   Checkout-style Payment Page
   ============================================ */

body {
    background: #EEEEF4;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: 0;
}

.main {
    width: 100%;
    max-width: 500px;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
    animation: pageIn 0.4s ease-out;
    position: relative;
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Amount Card — compact top bar
   ============================================ */
.amount-card {
    padding: 0.44rem 0.4rem 0.36rem;
    text-align: center;
    background: #fff;
    border-bottom: 1px solid #F0F0F5;
    position: relative;
}

.amount-label {
    font-size: 0.22rem;
    color: #8B8BA3;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.02rem;
    margin-bottom: 0.12rem;
}

.amount-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.06rem;
}

.currency {
    font-size: 0.4rem;
    font-weight: 700;
    color: #1A1A2E;
}

.amount-number {
    font-size: 0.72rem;
    font-weight: 800;
    color: #1A1A2E;
    letter-spacing: -0.02rem;
    line-height: 1.1;
}

.amount-desc {
    display: none;
}

/* ============================================
   Payment Methods — vertical list
   ============================================ */
.payment-section {
    flex: 1;
    padding: 0.36rem 0.36rem 0.2rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.28rem;
}

.section-title {
    font-size: 0.28rem;
    font-weight: 700;
    color: #1A1A2E;
    margin: 0;
}

.wait2 {
    font-size: 0.22rem;
    color: #10B981;
    font-weight: 600;
}

/* List layout instead of grid */
.payment-grid {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.payment-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.24rem;
    padding: 0.28rem 0.3rem;
    border-radius: 0.2rem;
    border: 2px solid #ECECF1;
    background: #FAFAFE;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    touch-action: manipulation;
    min-height: auto;
}

.payment-item:active {
    transform: scale(0.985);
}

.payment-icon {
    width: 0.72rem;
    height: 0.72rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 0.14rem;
    padding: 0.08rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
}

.payment-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.payment-name {
    flex: 1;
    font-size: 0.28rem;
    font-weight: 600;
    color: #1A1A2E;
    text-align: left;
    transition: color 0.2s ease;
}

/* Radio-style indicator */
.payment-check {
    width: 0.38rem;
    height: 0.38rem;
    border-radius: 50%;
    border: 2px solid #D0D0DD;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background: #fff;
    position: static;
}

.payment-check svg {
    width: 0.18rem;
    height: 0.18rem;
    color: #fff;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* ---- Selected state ---- */
.payment-item.check {
    border-color: #635BFF;
    background: #F8F7FF;
    box-shadow: 0 0 0 1px rgba(99, 91, 255, 0.1);
}

.payment-item.check .payment-icon {
    box-shadow: 0 2px 8px rgba(99, 91, 255, 0.12);
}

.payment-item.check .payment-name {
    color: #1A1A2E;
}

.payment-item.check .payment-check {
    border-color: #635BFF;
    background: #635BFF;
    box-shadow: 0 2px 6px rgba(99, 91, 255, 0.35);
    animation: radioIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.payment-item.check .payment-check svg {
    opacity: 1;
}

@keyframes radioIn {
    0% { transform: scale(0.6); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* ============================================
   Pay Button — inline, not fixed
   ============================================ */
.pay-button-container {
    padding: 0.2rem 0.36rem 0.36rem;
    padding-bottom: calc(0.36rem + env(safe-area-inset-bottom, 0));
    background: #fff;
}

.pay-button {
    width: 100%;
    height: 0.92rem;
    background: #635BFF;
    border: none;
    border-radius: 0.18rem;
    font-size: 0.3rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(99, 91, 255, 0.3), 0 1px 3px rgba(99, 91, 255, 0.15);
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
}

.pay-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(99, 91, 255, 0.3);
}

.pay-button-text {
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.pay-button-amount {
    display: flex;
    align-items: baseline;
    gap: 0.03rem;
    font-weight: 800;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.pay-button .currency {
    font-size: 0.26rem;
    color: #fff;
    opacity: 0.9;
}

.pay-button .amount {
    font-size: 0.32rem;
}

/* Disabled state */
.pay-button-display {
    background: #C4C4D0;
    cursor: not-allowed;
    box-shadow: none;
}

.pay-button-display:active {
    transform: none;
}

/* ============================================
   Security footer
   ============================================ */
.secure-footer {
    padding: 0 0.36rem 0.4rem;
    text-align: center;
    background: #fff;
}

.secure-footer span {
    font-size: 0.2rem;
    color: #B0B0C0;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.08rem;
}

.secure-footer svg {
    width: 0.22rem;
    height: 0.22rem;
    stroke: #B0B0C0;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.spinner {
    width: 0.48rem;
    height: 0.48rem;
    border: 0.04rem solid #ECECF1;
    border-top: 0.04rem solid #635BFF;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Responsive
   ============================================ */
@media screen and (max-width: 360px) {
    .amount-number { font-size: 0.64rem; }
    .payment-item { padding: 0.24rem; gap: 0.2rem; }
    .payment-icon { width: 0.64rem; height: 0.64rem; }
    .payment-name { font-size: 0.26rem; }
    .pay-button { height: 0.86rem; font-size: 0.28rem; }
}

@media screen and (min-width: 768px) {
    body {
        padding: 0.4rem 0.2rem;
        align-items: center;
    }
    .main {
        min-height: auto;
        border-radius: 0.24rem;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 12px 48px rgba(0,0,0,0.06);
        overflow: hidden;
    }
}
