:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #ec4899;
    --bg-dark: #0f172a;
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);

    --success-color: #10b981;
    --success-glow: rgba(16, 185, 129, 0.4);

    --error-color: #ef4444;
    --error-glow: rgba(239, 68, 68, 0.4);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #020617;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Stunning Animated Background */
.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #0B1120 0%, #000000 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 25s infinite ease-in-out alternate;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -150px;
    left: -150px;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #8b5cf6;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -12s;
}

/* Floating Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: move-bg 60s linear infinite;
    opacity: 0.3;
}

@keyframes move-bg {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 400px 400px;
    }
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    50% {
        transform: translate(40px, -60px) scale(1.1) rotate(10deg);
    }

    100% {
        transform: translate(-30px, 30px) scale(0.9) rotate(-10deg);
    }
}

/* Main Container & Glass Cards */
.container {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    z-index: 10;
    perspective: 1000px;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    animation: scaleUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.stunning-glow::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--primary), var(--secondary), transparent 30%);
    animation: rotateGlow 8s linear infinite;
    opacity: 0.15;
    z-index: -1;
}

@keyframes rotateGlow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes scaleUp {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.hidden {
    display: none !important;
}

/* Headers & Status Texts */
header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-placeholder {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
    color: white;
}

header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Icon Buttons */
.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: scale(1.05);
}

.back-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 10;
}

/* Common Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #cbd5e1;
}

.preset-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.preset-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 14px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.05rem;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.preset-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.preset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.preset-btn:hover::after {
    opacity: 1;
}

.preset-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3), inset 0 0 10px rgba(99, 102, 241, 0.2);
    color: white;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-symbol {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.2rem;
    z-index: 2;
}

input[type="number"],
input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 18px 20px 18px 45px;
    border-radius: var(--radius-md);
    font-size: 1.25rem;
    font-weight: 700;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.input-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 2px var(--primary);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
    z-index: 2;
}

input:focus+.input-glow {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--primary), 0 0 20px rgba(99, 102, 241, 0.4);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Primary Buttons */
.primary-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.5);
    position: relative;
    overflow: hidden;
}

.primary-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: skewX(-20deg);
    transition: none;
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -5px rgba(236, 72, 153, 0.5);
}

.primary-btn:hover:not(:disabled)::before {
    animation: shine 0.7s ease-out;
}

@keyframes shine {
    to {
        left: 200%;
    }
}

.primary-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pulse-glow {
    animation: pulseSoftly 2s infinite;
}

@keyframes pulseSoftly {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.secondary-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 14px;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.neon-border {
    position: relative;
}

.neon-border:hover {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

/* Result Box */
.result-box {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.copy-input-group {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.copy-input-group input {
    padding-left: 20px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #60a5fa;
    text-overflow: ellipsis;
    padding-top: 14px;
    padding-bottom: 14px;
}

#copy-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: white;
    width: 56px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

#copy-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #60a5fa;
}

.success-toast {
    color: var(--success-color);
    font-size: 0.9rem;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 0 10px var(--success-glow);
}

/* Payment View Styles */
.merchant-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 16px;
    border-radius: 30px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.glow-badge {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.merchant-avatar {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 800;
}

.amount-display {
    text-align: center;
    margin: 40px 0;
    position: relative;
}

.amount-glow-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    z-index: -1;
    border-radius: 50%;
}

.amount-display .currency {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-muted);
    vertical-align: top;
    line-height: 1.2;
}

#checkout-amount {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: white;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
    line-height: 1;
}

.glass-panel {
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row span:first-child {
    color: var(--text-muted);
}

.detail-row span:last-child {
    font-weight: 600;
}

.mono {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.05em;
}

.green-glow {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.4);
}

.green-glow:hover:not(:disabled) {
    box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.6);
}

.red-btn {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.4);
}

.red-btn:hover {
    box-shadow: 0 15px 30px -5px rgba(239, 68, 68, 0.6);
}

.pulse-red {
    animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.secure-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Demo Controls for Testing */
.flex-center {
    display: flex;
    justify-content: center;
}

.gap-2 {
    gap: 10px;
}

.text-center {
    text-align: center;
}

.text-xs {
    font-size: 0.75rem;
}

.mb-2 {
    margin-bottom: 8px;
}

.mt-3 {
    margin-top: 16px;
}

.mt-4 {
    margin-top: 24px;
}

.w-full {
    width: 100%;
}

.demo-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.demo-btn.success:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: #10b981;
}

.demo-btn.fail:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: #ef4444;
}

/* Status Views (Success & Failure) */
.status-content {
    text-align: center;
    margin-top: 20px;
}

.status-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}

.text-white {
    color: white;
}

.text-gray {
    color: #94a3b8;
}

.text-red {
    color: #f87171;
}

.text-sm {
    font-size: 0.85rem;
}

.status-icon-container {
    width: 90px;
    height: 90px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.success-glow {
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.success-text {
    color: var(--success-color);
    text-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.success-card {
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.failure-glow {
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.failure-text {
    color: var(--error-color);
    text-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.failure-card {
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.text-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.text-link:hover {
    color: white;
    text-decoration: underline;
}

.receipt-panel,
.error-panel {
    text-align: left;
}

/* SVG Animations */
.checkmark-svg {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #10b981;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10b981;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

.cross-svg {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: #ef4444;
    stroke-miterlimit: 10;
}

.cross-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 3;
    stroke-miterlimit: 10;
    stroke: #ef4444;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.cross-path {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}