* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --accent: #00e5a0;
    --accent2: #00b4ff;
    --dark: #070b14;
}

body {
    font-family: Arial, sans-serif;
    background: var(--dark);
    color: #222;
    overflow-x: hidden;
}

/* ============ ANIMATED BACKGROUND ============ */
.bg-anim {
    position: fixed; inset: 0; z-index: 0; overflow: hidden;
    background: radial-gradient(circle at 20% 20%, #0d1b3a, transparent 50%),
                radial-gradient(circle at 80% 80%, #06342f, transparent 50%),
                var(--dark);
}
.bg-anim::before {
    content: ""; position: absolute; inset: -50%;
    background-image:
        linear-gradient(rgba(0,229,160,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,229,160,.07) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg);
    animation: gridMove 6s linear infinite;
}
@keyframes gridMove { to { background-position: 0 50px; } }

.orb {
    position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45;
    animation: float 9s ease-in-out infinite;
}
.orb.o1 { width: 300px; height: 300px; background: var(--accent2); top: 8%; left: 5%; }
.orb.o2 { width: 260px; height: 260px; background: var(--accent); bottom: 5%; right: 8%; animation-delay: -4s; }
@keyframes float { 50% { transform: translate(40px, -50px) scale(1.15); } }

/* ============ NAVBAR ============ */
.payment-navbar {
    position: relative; z-index: 2;
    width: 100%; height: 70px;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,229,160,.3);
    display: flex; align-items: center;
    padding: 0 30px; gap: 12px; color: white;
    animation: slideDown .7s ease both;
}
.payment-navbar img { width: 50px; height: 50px; object-fit: contain; }
.payment-navbar h2 { font-size: 20px; letter-spacing: .5px; }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } }

/* ============ CONTAINER ============ */
.payment-container {
    position: relative; z-index: 1;
    min-height: calc(100vh - 70px);
    display: flex; justify-content: center; align-items: center;
    padding: 30px 15px;
}

/* ============ BOX ============ */
.payment-box {
    position: relative;
    width: 430px; max-width: 100%;
    background: #fff;
    padding: 35px; border-radius: 22px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 40px rgba(0,229,160,.25);
    animation: boxIn .9s cubic-bezier(.2,.9,.3,1.2) both;
}
.payment-box::before {              /* rotating neon border */
    content: ""; position: absolute; inset: -3px; z-index: -1;
    border-radius: 25px;
    background: conic-gradient(from var(--ang, 0deg), var(--accent), var(--accent2), transparent 40%, var(--accent));
    animation: spin 4s linear infinite;
}
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
@keyframes boxIn { from { opacity: 0; transform: translateY(60px) scale(.9); } }

.payment-box > * { animation: fadeUp .6s ease both; }
.payment-box > *:nth-child(1) { animation-delay: .3s; }
.payment-box > *:nth-child(2) { animation-delay: .4s; }
.payment-box > *:nth-child(3) { animation-delay: .5s; }
.payment-box > *:nth-child(4) { animation-delay: .6s; }
.payment-box > *:nth-child(5) { animation-delay: .7s; }
.payment-box > *:nth-child(6) { animation-delay: .8s; }
.payment-box > *:nth-child(7) { animation-delay: .9s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } }

/* ICON */
.payment-icon {
    width: 58px; height: 58px; margin: auto;
    display: flex; align-items: center; justify-content: center;
    background: #e8fff6; border-radius: 50%; font-size: 26px;
    position: relative;
}
.payment-icon::after {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--accent);
    animation: ripple 1.8s ease-out infinite;
}
@keyframes ripple { to { transform: scale(1.9); opacity: 0; } }

.payment-box h1 { font-size: 25px; margin: 15px 0 8px; }
.subtitle { color: #777; font-size: 14px; }

.product-name { font-size: 20px; font-weight: bold; margin-top: 12px; color: #007bff; }

.payment-price {
    font-size: 34px; font-weight: bold; margin: 15px 0;
    background: linear-gradient(90deg, #111, var(--accent2), #111);
    background-size: 200% auto;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }

/* ============ QR ============ */
.qr-section { border-top: 1px solid #eee; padding-top: 20px; }
.qr-section h3 { font-size: 20px; margin-bottom: 5px; }
.qr-section p { color: #777; font-size: 13px; }

.qr-box {
    position: relative; overflow: hidden;
    width: 220px; height: 220px; margin: 22px auto;
    padding: 12px;
    border-radius: 16px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2px #eee, 0 0 25px rgba(0,229,160,.35);
    animation: qrGlow 2s ease-in-out infinite;
}
@keyframes qrGlow { 50% { box-shadow: 0 0 0 2px var(--accent), 0 0 45px rgba(0,229,160,.7); } }
.qr-box img { width: 100%; height: 100%; object-fit: contain; }

/* corner brackets */
.qr-box i {
    position: absolute; width: 28px; height: 28px;
    border: 4px solid var(--accent); z-index: 3;
    animation: bracket 1.6s ease-in-out infinite;
}
.qr-box i:nth-of-type(1) { top: 6px; left: 6px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.qr-box i:nth-of-type(2) { top: 6px; right: 6px; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.qr-box i:nth-of-type(3) { bottom: 6px; left: 6px; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.qr-box i:nth-of-type(4) { bottom: 6px; right: 6px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
@keyframes bracket { 50% { transform: scale(.85); opacity: .7; } }

/* scanning laser */
.scan-line {
    position: absolute; left: 0; width: 100%; height: 4px; z-index: 2;
    background: linear-gradient(90deg, transparent, var(--accent), #fff, var(--accent), transparent);
    box-shadow: 0 0 18px 6px rgba(0,229,160,.7);
    animation: scan 2.4s ease-in-out infinite;
}
.scan-glow {                         /* trailing light behind laser */
    position: absolute; left: 0; width: 100%; height: 70px; z-index: 1;
    background: linear-gradient(to top, rgba(0,229,160,.28), transparent);
    animation: scanGlow 2.4s ease-in-out infinite;
}
@keyframes scan { 0%,100% { top: 0; } 50% { top: calc(100% - 4px); } }
@keyframes scanGlow { 0%,100% { top: -70px; transform: scaleY(-1); } 50% { top: calc(100% - 0px); transform: scaleY(1); top: calc(100% - 70px); } }

/* ============ UPI ============ */
.upi-info {
    background: #f5f7fa; padding: 13px; border-radius: 10px; margin-bottom: 12px;
    cursor: pointer; transition: .25s; border: 1px dashed transparent;
}
.upi-info:hover { border-color: var(--accent); background: #eefff8; transform: scale(1.02); }
.upi-info strong { font-size: 13px; color: #555; }
.upi-info p { margin-top: 5px; font-size: 15px; font-weight: bold; }
.upi-info small { color: #999; font-size: 11px; }

/* ============ NOTE ============ */
.payment-note {
    background: #fff8e6; color: #765900; padding: 12px;
    border-radius: 10px; margin-bottom: 18px; font-size: 13px;
}

/* ============ BUTTON ============ */
.payment-btn {
    position: relative; overflow: hidden;
    width: 100%; height: 52px; border: none; border-radius: 12px;
    background: linear-gradient(135deg, #00a86b, #00e676);
    color: white; font-size: 16px; font-weight: bold; cursor: pointer;
    transition: .3s;
    animation: btnPulse 2s infinite;
}
.payment-btn::after {               /* shimmer sweep */
    content: ""; position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,.55), transparent);
    animation: sweep 2.5s infinite;
}
@keyframes sweep { to { left: 160%; } }
@keyframes btnPulse {
    0% { box-shadow: 0 0 0 0 rgba(0,230,118,.55); }
    70% { box-shadow: 0 0 0 16px rgba(0,230,118,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,230,118,0); }
}
.payment-btn:hover { transform: translateY(-3px); }
.payment-btn:active { transform: scale(.97); }
.payment-btn:disabled { opacity: .7; cursor: not-allowed; animation: none; }

.spinner {
    display: inline-block; width: 18px; height: 18px; vertical-align: middle;
    border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: rot .7s linear infinite; margin-right: 8px;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ============ MESSAGE ============ */
.payment-message {
    margin-top: 15px; color: #00a86b; font-size: 14px;
    font-weight: bold; line-height: 1.5; min-height: 20px;
}
.payment-message.show { animation: pop .5s cubic-bezier(.2,1.5,.4,1); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }

.check {
    width: 64px; height: 64px; margin: 10px auto 0; display: block;
}
.check circle { stroke: var(--accent); stroke-width: 4; fill: none; stroke-dasharray: 190; stroke-dashoffset: 190; animation: draw .7s ease forwards; }
.check path { stroke: var(--accent); stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .5s .6s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* confetti */
.confetti {
    position: fixed; top: -12px; width: 10px; height: 14px; z-index: 50;
    pointer-events: none; animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: .8; } }

/* ============ BACK ============ */
.back-btn {
    display: inline-block; margin-top: 20px; color: #007bff;
    text-decoration: none; font-size: 14px; transition: .25s;
}
.back-btn:hover { transform: translateX(-5px); text-decoration: underline; }

/* ============ MOBILE ============ */
@media (max-width: 500px) {
    .payment-navbar { padding: 0 15px; }
    .payment-navbar h2 { font-size: 17px; }
    .payment-box { padding: 25px 20px; }
    .qr-box { width: 190px; height: 190px; }
    .payment-box h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}