/* ============================================
   India UPI Checkout — payment page
   ============================================ */

.main {
    background: var(--bg);
    position: relative;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 2.2rem;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.35s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(0.08rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* Brand accent strip */
.tricolor {
    height: 0.08rem;
    width: 100%;
    background: linear-gradient(
        90deg,
        var(--forest) 0%,
        var(--india-green) 50%,
        var(--saffron) 100%
    );
    flex-shrink: 0;
}

/* Top bar */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.22rem 0.32rem;
    background: linear-gradient(160deg, var(--forest) 0%, var(--forest-mid) 100%);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.16rem;
}

.upi-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0.72rem;
    height: 0.44rem;
    padding: 0 0.12rem;
    border-radius: 0.08rem;
    background: #fff;
    color: var(--india-green);
    font-size: 0.22rem;
    font-weight: 800;
    letter-spacing: 0.02rem;
    box-shadow: 0 0.04rem 0.1rem rgba(0, 0, 0, 0.18);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-title {
    font-size: 0.28rem;
    font-weight: 700;
    letter-spacing: 0.005rem;
}

.secure-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.08rem;
    padding: 0.08rem 0.16rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.18rem;
    font-weight: 600;
    white-space: nowrap;
}

.secure-pill svg {
    width: 0.2rem;
    height: 0.2rem;
    flex-shrink: 0;
}

/* Amount card */
.amount-card {
    margin: 0.28rem 0.28rem 0;
    padding: 0.36rem 0.32rem 0.32rem;
    background:
        radial-gradient(circle at 100% 0%, rgba(0, 163, 201, 0.2), transparent 42%),
        linear-gradient(160deg, var(--forest) 0%, #005cad 55%, var(--forest-mid) 100%);
    color: #fff;
    border-radius: 0.24rem;
    text-align: left;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.amount-card::after {
    content: '';
    position: absolute;
    right: -0.4rem;
    bottom: -0.5rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 0.08rem solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.amount-kicker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.amount-label {
    font-size: 0.22rem;
    font-weight: 500;
    opacity: 0.82;
}

.amount-chip {
    font-size: 0.18rem;
    font-weight: 700;
    padding: 0.06rem 0.14rem;
    border-radius: 999px;
    background: rgba(247, 148, 30, 0.22);
    color: #ffd7a8;
    letter-spacing: 0.02rem;
}

.amount-value {
    display: flex;
    align-items: baseline;
    gap: 0.08rem;
    margin: 0.18rem 0 0.12rem;
    position: relative;
    z-index: 1;
}

.currency {
    font-size: 0.4rem;
    font-weight: 700;
    line-height: 1;
}

.amount-number {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: -0.02rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.amount-desc {
    font-size: 0.22rem;
    opacity: 0.78;
    position: relative;
    z-index: 1;
}

/* Payment list */
.payment-section {
    flex: 1;
    padding: 0.32rem 0.28rem 0.16rem;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 0.22rem;
    gap: 0.16rem;
}

.section-title {
    font-size: 0.3rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
}

.wait2 {
    font-size: 0.2rem;
    color: var(--india-green);
    font-weight: 700;
    background: var(--soft);
    border-radius: 999px;
    padding: 0.06rem 0.14rem;
    white-space: nowrap;
}

.payment-grid {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
}

.payment-item {
    background: var(--card);
    border-radius: 0.2rem;
    padding: 0.22rem 0.22rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.18rem;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 0.02rem solid var(--line);
    min-height: 1.16rem;
    touch-action: manipulation;
    box-shadow: 0 0.04rem 0.12rem rgba(0, 71, 145, 0.06);
}

.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.16rem;
    padding: 0.08rem;
    border: 0.01rem solid var(--line);
}

.payment-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.payment-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.04rem;
}

.payment-name {
    font-size: 0.28rem;
    color: var(--ink);
    font-weight: 700;
    text-align: left;
}

.payment-check {
    width: 0.36rem;
    height: 0.36rem;
    flex-shrink: 0;
    border-radius: 50%;
    border: 0.03rem solid #cfc6ba;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-check svg {
    width: 0.18rem;
    height: 0.18rem;
    color: transparent;
}

.payment-item.check {
    background: linear-gradient(180deg, #fffdf9 0%, var(--soft) 100%);
    border-color: var(--saffron);
    box-shadow: 0 0.08rem 0.22rem rgba(242, 107, 33, 0.16);
}

.payment-item.check .payment-name {
    color: var(--forest);
}

.payment-item.check .payment-check {
    background: var(--saffron);
    border-color: var(--saffron);
}

.payment-item.check .payment-check svg {
    color: #fff;
    animation: checkIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkIn {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Trust note */
.trust-note {
    display: flex;
    align-items: flex-start;
    gap: 0.12rem;
    margin: 0.28rem 0.28rem 0;
    padding: 0.2rem 0.2rem;
    background: var(--card);
    border-radius: 0.16rem;
    border: 0.01rem solid var(--line);
    color: var(--muted);
    font-size: 0.2rem;
    line-height: 1.5;
}

.trust-note svg {
    width: 0.28rem;
    height: 0.28rem;
    flex-shrink: 0;
    color: var(--india-green);
    margin-top: 0.02rem;
}

.trust-note strong {
    color: var(--ink);
    font-weight: 700;
}

/* Sticky pay bar */
.pay-button-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.18rem 0.28rem calc(0.22rem + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(240, 244, 248, 0) 0%, var(--bg) 18%, var(--bg) 100%);
    z-index: 100;
}

.pay-button-wrap {
    background: var(--card);
    border: 0.01rem solid var(--line);
    border-radius: 0.22rem;
    padding: 0.16rem 0.16rem 0.18rem;
    box-shadow: 0 -0.08rem 0.32rem rgba(0, 71, 145, 0.08);
}

.pay-safe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    font-size: 0.18rem;
    color: var(--muted);
    margin-bottom: 0.12rem;
}

.pay-safe svg {
    width: 0.18rem;
    height: 0.18rem;
}

.pay-button {
    width: 100%;
    height: 1.04rem;
    background: linear-gradient(180deg, #ff8a3d 0%, var(--saffron) 48%, var(--saffron-deep) 100%);
    border: none;
    border-radius: 0.18rem;
    font-size: 0.32rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.16rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0.1rem 0.24rem rgba(247, 148, 30, 0.32);
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
}

.pay-button:active {
    transform: scale(0.985);
}

.pay-button-text,
.pay-button-amount {
    position: relative;
    z-index: 1;
}

.pay-button-amount {
    display: flex;
    align-items: baseline;
    gap: 0.04rem;
    font-weight: 800;
}

.pay-button .currency {
    font-size: 0.28rem;
}

.pay-button .amount {
    font-size: 0.34rem;
}

.pay-button-display {
    background: linear-gradient(180deg, #c8c0b6 0%, #a89f94 100%);
    cursor: not-allowed;
    box-shadow: none;
}

.pay-button-display:active {
    transform: none;
}

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, var(--forest) 0%, #005cad 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-overlay .loading-text {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.24rem;
    font-weight: 600;
}

.spinner {
    width: 0.52rem;
    height: 0.52rem;
    border: 0.05rem solid rgba(255, 255, 255, 0.22);
    border-top-color: var(--saffron);
    border-right-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media screen and (max-width: 375px) {
    .amount-number { font-size: 0.64rem; }
    .payment-item { min-height: 1.08rem; }
    .pay-button { height: 0.96rem; font-size: 0.3rem; }
}

@media screen and (min-width: 414px) {
    .amount-number { font-size: 0.8rem; }
    .payment-icon { width: 0.8rem; height: 0.8rem; }
}

@media screen and (orientation: landscape) and (max-height: 500px) {
    .amount-card { padding: 0.24rem; }
    .amount-number { font-size: 0.52rem; }
    .payment-section { padding-top: 0.2rem; }
    .pay-button { height: 0.88rem; }
}

@media screen and (min-width: 768px) {
    body {
        background:
            radial-gradient(circle at 10% 0%, rgba(0, 163, 201, 0.14), transparent 28%),
            radial-gradient(circle at 90% 100%, rgba(247, 148, 30, 0.08), transparent 30%),
            var(--bg);
    }

    .main {
        max-width: 7.2rem;
        margin: 0.28rem auto;
        min-height: calc(100vh - 0.56rem);
        border-radius: 0.28rem;
        overflow: hidden;
        box-shadow: 0 0.2rem 0.64rem rgba(0, 71, 145, 0.12);
        background: var(--bg);
    }

    .pay-button-container {
        position: sticky;
        bottom: 0;
        background: var(--bg);
    }
}
