<?php $lang=stb_lang(); $B='/NewSite'; $fa=$lang==='fa'; 
$login_label_url = $lang==='fa' ? 'https://crm.stbbrokers.com/fa':'https://crm.stbbrokers.com/';
$register_label_url = $lang==='fa' ? 'https://crm.stbbrokers.com/fa/register':'https://crm.stbbrokers.com/register/';
?>
<article class="ip-page">
<div class="ip-hero">
  <div class="ip-hero-glow"></div>
  <div class="ip-container">
    <nav class="ip-breadcrumb">
      <a href="<?php echo stb_url($B.'/'); ?>"><?php echo $fa?'خانه':'Home';?></a>
      <span class="ip-breadcrumb-sep">›</span>
      <span><?php echo $fa?'پلتفرم‌ها':'Platforms';?></span>
    </nav>
    <div class="ip-kicker"><span class="ip-kicker-dot"></span><?php echo $fa?'پلتفرم معاملاتی':'TRADING PLATFORM';?></div>
    <h1 class="ip-h1"><?php echo $fa?'MetaTrader 5 — انتخاب <em>حرفه‌ای‌ها</em>':'MetaTrader 5 — The <em>Professional Choice</em>';?></h1>
    <p class="ip-hero-desc"><?php echo $fa?'پیشرفته‌ترین پلتفرم معاملاتی جهان — کاملاً یکپارچه با زیرساخت سازمانی STB. در دسترس روی Windows، macOS، iOS، Android و وب.':'The world\'s most advanced trading platform — fully integrated with STB\'s institutional infrastructure. Available on Windows, macOS, iOS, Android and Web.';?></p>
    <div class="ip-hero-stats">
      <div><div class="ip-stat-val">21</div><div class="ip-stat-lbl"><?php echo $fa?'تایم‌فریم':'Timeframes';?></div></div>
      <div><div class="ip-stat-val">80<em>+</em></div><div class="ip-stat-lbl"><?php echo $fa?'اندیکاتور':'Indicators';?></div></div>
      <div><div class="ip-stat-val">MQL5</div><div class="ip-stat-lbl"><?php echo $fa?'معاملات الگوریتمی':'Algo Trading';?></div></div>
      <div><div class="ip-stat-val">DOM</div><div class="ip-stat-lbl"><?php echo $fa?'عمق بازار':'Market Depth';?></div></div>
    </div>
    <div class="ip-hero-ctas">
      <a href="<?php echo esc_html($register_label_url);?>" class="ip-btn-red"><?php echo $fa?'شروع با MT5':'Start on MT5';?> <svg viewBox="0 0 24 24"><path d="M5 12h14M12 5l7 7-7 7" stroke-width="2" stroke-linecap="round"/></svg></a>
      <a href="<?php echo esc_html($register_label_url);?>" class="ip-btn-ghost"><?php echo $fa?'شبیه‌ساز رایگان':'Try Free Demo';?></a>
    </div>
  </div>
</div>

<!-- Why MT5 -->
<section class="ip-section">
  <div class="ip-container">
    <h2 class="ip-section-title"><?php echo $fa?'چرا <em>MT5</em>؟':'Why <em>MT5</em>?';?></h2>
    <p class="ip-section-desc"><?php echo $fa?'MetaTrader 5 استاندارد صنعت است. در هر معیار قابل اندازه‌گیری از MT4 پیشی می‌گیرد.':'MetaTrader 5 is the industry standard for a reason. It outperforms MT4 in every measurable way.';?></p>
    <div class="ip-cards">
      <?php $cards = $fa ? [
        ['<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5"/>','۲۱ تایم‌فریم و تحلیل پیشرفته نمودار','بیش از ۸۰ اندیکاتور، انواع مختلف نمودار و الگوهای کاملاً قابل تنظیم برای تحلیل فنی دقیق'],
        ['<path d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" stroke-width="1.5" stroke-linecap="round"/>','معاملات الگوریتمی (MQL5)','ساخت یا وارد کردن استراتژی‌های خودکار، بک‌تست با تستر داخلی و اجرای فوری.'],
        ['<path d="M22 12h-4l-3 9L9 3l-3 9H2" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>','عمق کامل بازار (DOM)','قیمت‌های سطح ۲ با نقدینگی لحظه‌ای از تأمین‌کنندگان سازمانی و شفافیت کامل دفتر سفارش.'],
        ['<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" stroke-width="1.5" stroke-linecap="round"/>','اجرای فوق‌العاده سریع','یکپارچه با نقدینگی عمیق STB برای انجام معاملات با سرعت نور، لغزش حداقلی و اجرای NDD.'],
        ['<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke-width="1.5"/>','هجینگ و نتینگ','پشتیبانی کامل از هر دو حالت حسابداری پوزیشن هجینگ و نتینگ.'],
        ['<rect x="2" y="3" width="20" height="14" rx="2" stroke-width="1.5"/><path d="M8 21h8M12 17v4" stroke-width="1.5" stroke-linecap="round"/>','چند پلتفرمی','دسکتاپ Windows، macOS، iOS، Android و WebTrader — همگام‌سازی کامل.'],
      ] : [
        ['<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5"/>','21 Timeframes & Advanced Charting','80+ indicators, multiple chart types, and fully configurable templates for precision technical analysis.'],
        ['<path d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" stroke-width="1.5" stroke-linecap="round"/>','Algorithmic Trading (MQL5)','Build or import automated strategies, backtest with the built-in strategy tester, and deploy instantly.'],
        ['<path d="M22 12h-4l-3 9L9 3l-3 9H2" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>','Full Market Depth (DOM)','Level II quotes show real-time liquidity from institutional providers with full order book transparency.'],
        ['<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" stroke-width="1.5" stroke-linecap="round"/>','Ultra-Fast Execution','Integrated with STB deep liquidity pool for lightning-fast trades, minimal slippage, and NDD execution.'],
        ['<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke-width="1.5"/>','Hedging & Netting','Full support for both hedging and netting position accounting modes.'],
        ['<rect x="2" y="3" width="20" height="14" rx="2" stroke-width="1.5"/><path d="M8 21h8M12 17v4" stroke-width="1.5" stroke-linecap="round"/>','Cross-Platform','Windows desktop, macOS, iOS, Android, and WebTrader — seamlessly synced.'],
      ];
      foreach($cards as $c): ?>
      <div class="ip-card ip-animate">
        <div class="ip-card-icon"><svg viewBox="0 0 24 24" stroke="currentColor" fill="none"><?php echo $c[0]; ?></svg></div>
        <div class="ip-card-title"><?php echo $c[1]; ?></div>
        <div class="ip-card-desc"><?php echo $c[2]; ?></div>
      </div>
      <?php endforeach; ?>
    </div>

    <!-- Download -->
    <h2 class="ip-section-title" style="margin-bottom:24px"><?php echo $fa?'دانلود <em>MT5</em>':'Download <em>MT5</em>';?></h2>
    <div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:48px">
      <?php foreach([['Windows','https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe'],['macOS','https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/MetaTrader5.dmg'],['iOS','https://apps.apple.com/app/metatrader-5/id413251709'],['Android','https://play.google.com/store/apps/details?id=net.metaquotes.metatrader5'],['WebTrader','https://trade.mql5.com/trade?servers=STBProvider-Demo,STBProvider-Live&lang=en']] as $d): ?>
      <a href="<?php echo $d[1]; ?>" target="_blank" rel="noopener" style="display:flex;align-items:center;justify-content:center;gap:8px;padding:14px 20px;border-radius:10px;background:#0a0c10;border:1px solid rgba(255,255,255,.1);color:rgba(255,255,255,.7);text-decoration:none;font-size:13.5px;font-weight:600;transition:all .15s" onmouseover="this.style.borderColor='rgba(200,16,46,.3)';this.style.color='#fff'" onmouseout="this.style.borderColor='rgba(255,255,255,.1)';this.style.color='rgba(255,255,255,.7)'"><?php echo $d[0]; ?></a>
      <?php endforeach; ?>
    </div>

    <div class="ip-cta-strip">
      <div class="ip-cta-strip-text"><h3><?php echo $fa?'آماده معامله روی MT5 هستید؟':'Ready to trade on MT5?';?></h3><p><?php echo $fa?'حساب خود را باز کنید و از قدرت کامل MetaTrader 5 با زیرساخت سازمانی STB بهره ببرید.':'Open your account and access the full power of MetaTrader 5 with STB\'s institutional infrastructure.';?></p></div>
      <div class="ip-cta-strip-btns"><a href="<?php echo esc_html($register_label_url);?>" class="ip-btn-red"><?php echo $fa?'افتتاح حساب واقعی':'Open Live Account';?></a><a href="<?php echo esc_html($register_label_url);?>" class="ip-btn-ghost"><?php echo $fa?'دمو رایگان':'Free Demo';?></a></div>
    </div>
  </div>
</section>

<!-- Platform Options Tabs -->
<section class="ip-section">
  <style>
  .a2-tab-nav{display:flex;gap:4px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.07);border-radius:12px;padding:4px;flex-wrap:wrap;margin-bottom:32px}
  .a2-tab-btn{flex:1;min-width:100px;padding:10px 18px;border-radius:9px;font-size:13.5px;font-weight:600;color:rgba(255,255,255,.4);background:none;border:none;cursor:pointer;transition:all .2s;white-space:nowrap}
  .a2-tab-btn.active{background:#C8102E;color:#fff;box-shadow:0 2px 16px #C8102E44}
  .a2-tab-btn:hover:not(.active){color:#fff;background:rgba(255,255,255,.06)}
  .a2-tab-panel{animation:a2-tab-in .25s ease-out}
  @keyframes a2-tab-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
  .a2-feat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px;margin-bottom:40px}
  .a2-feat-card{background:#0a0c10;border:1px solid rgba(255,255,255,.06);border-radius:14px;padding:22px;position:relative;overflow:hidden;transition:border-color .2s,transform .2s;cursor:default}
  .a2-feat-card::before{content:'';position:absolute;top:0;left:0;right:0;height:2px;background:#C8102E;transform:scaleX(0);transform-origin:left;transition:transform .3s cubic-bezier(.16,1,.3,1)}
  .a2-feat-card:hover{border-color:rgba(200,16,46,.25);transform:translateY(-3px)}
  .a2-feat-card:hover::before{transform:scaleX(1)}
  .a2-feat-icon{width:44px;height:44px;border-radius:10px;background:rgba(200,16,46,.08);border:1px solid rgba(200,16,46,.15);display:flex;align-items:center;justify-content:center;margin-bottom:14px}
  .a2-feat-title{font-size:15px;font-weight:700;color:#fff;margin-bottom:7px}
  .a2-feat-desc{font-size:13px;color:rgba(255,255,255,.45);line-height:1.6}
  </style>
  <div class="ip-container">
    <h2 class="ip-section-title" style="margin-bottom:24px"><?php echo $fa?'گزینه‌های <em>پلتفرم</em>':'Platform <em>Options</em>';?></h2>
    <div class="a2-tab-nav" id="a2-tab-nav">
      <button class="a2-tab-btn active" data-tab="0"><?php echo $fa?'دسکتاپ (Windows)':'Desktop (Windows)';?></button>
      <button class="a2-tab-btn" data-tab="1">WebTrader</button>
      <button class="a2-tab-btn" data-tab="2"><?php echo $fa?'موبایل (iOS/Android)':'Mobile (iOS/Android)';?></button>
    </div>
    <?php
    $panels = $fa ? [
      [['<rect x="2" y="3" width="20" height="14" rx="2" stroke-width="1.5"/><path d="M8 21h8M12 17v4" stroke-width="1.5" stroke-linecap="round"/>','MT5 دسکتاپ کامل','ترمینال معاملاتی کامل با ۲۱ تایم‌فریم، DOM، تستر استراتژی و معاملات الگوریتمی.'],
       ['<path d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" stroke-width="1.5" stroke-linecap="round"/>','تستر استراتژی MQL5','بک‌تست اکسپرت‌های خود با داده‌های تاریخی با دقت تیک به تیک.'],
       ['<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5"/>','چیدمان چند نمودار','تا ۱۰۰ نمودار باز همزمان. ذخیره و بارگذاری الگوهای سفارشی.']],
      [['<circle cx="12" cy="12" r="10" stroke-width="1.5"/><path d="M2 12h20" stroke-width="1.5"/>','بدون نیاز به نصب','مستقیماً از مرورگر خود معامله کنید. سازگار با کروم، فایرفاکس، سافاری و اج'],
       ['<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke-width="1.5"/>','معامله امن','رمزنگاری SSL 128 بیتی. هیچ داده‌ای در مرورگر ذخیره نمی‌شود.'],
       ['<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" stroke-width="1.5" stroke-linecap="round"/>','عملکرد کامل','نمودار، اندیکاتورها، ثبت سفارش و مدیریت حساب — همه از  طریق وب.']],
      [['<rect x="5" y="2" width="14" height="20" rx="2" stroke-width="1.5"/><path d="M12 18h.01" stroke-width="2"/>','اپ بومی iOS و Android','دانلود رایگان از App Store و Google Play. تجربه بومی کامل.'],
       ['<path d="M22 12h-4l-3 9L9 3l-3 9H2" stroke-width="1.5" stroke-linecap="round"/>','نمودار و معامله در حرکت','نمودار تعاملی، اندیکاتورها و اعلان‌های قیمتی در گوشی شما.'],
       ['<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5"/>','همگام‌سازی کامل','تمامی معاملات و تنظیمات در دسکتاپ، وب و موبایل همگام‌سازی می‌شوند']],
    ] : [
      [['<rect x="2" y="3" width="20" height="14" rx="2" stroke-width="1.5"/><path d="M8 21h8M12 17v4" stroke-width="1.5" stroke-linecap="round"/>','Full MT5 Desktop','Complete trading terminal with all 21 timeframes, DOM, strategy tester and algo trading.'],
       ['<path d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" stroke-width="1.5" stroke-linecap="round"/>','MQL5 Strategy Tester','Backtest your EAs against historical data with tick-by-tick precision.'],
       ['<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5"/>','Multi-Chart Layouts','Up to 100 open charts simultaneously. Save and load custom chart templates.']],
      [['<circle cx="12" cy="12" r="10" stroke-width="1.5"/><path d="M2 12h20" stroke-width="1.5"/>','No Installation Required','Trade directly from your browser. Compatible with Chrome, Firefox, Safari and Edge.'],
       ['<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" stroke-width="1.5"/>','Secure Trading','128-bit SSL encryption. No data stored in browser.'],
       ['<path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z" stroke-width="1.5" stroke-linecap="round"/>','Full Functionality','Charts, indicators, order placement and account management — all from the web.']],
      [['<rect x="5" y="2" width="14" height="20" rx="2" stroke-width="1.5"/><path d="M12 18h.01" stroke-width="2"/>','Native iOS & Android App','Free download from App Store and Google Play. Full native experience.'],
       ['<path d="M22 12h-4l-3 9L9 3l-3 9H2" stroke-width="1.5" stroke-linecap="round"/>','Chart & Trade on the Go','Interactive charts, indicators and price alerts on your phone.'],
       ['<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5"/>','Full Sync','All trades and settings stay synchronized across desktop, web and mobile.']],
    ];
    $panel_titles = $fa
      ? ['ویژگی‌های دسکتاپ Windows','ویژگی‌های WebTrader','ویژگی‌های اپ موبایل']
      : ['Windows Desktop Features','WebTrader Features','Mobile App Features'];
    foreach($panels as $pi=>$panel): ?>
    <div class="a2-tab-panel" data-panel="<?php echo $pi; ?>" style="display:<?php echo $pi===0?'block':'none'; ?>">
      <h3 class="ip-section-title" style="margin-bottom:8px;font-size:20px"><?php echo $panel_titles[$pi]; ?></h3>
      <div class="a2-feat-grid">
        <?php foreach($panel as $fi=>$feat): ?>
        <div class="a2-feat-card ip-animate" style="animation-delay:<?php echo $fi*0.08; ?>s">
          <div class="a2-feat-icon"><svg viewBox="0 0 24 24" stroke="#C8102E" fill="none" stroke-width="1.5" width="22" height="22"><?php echo $feat[0]; ?></svg></div>
          <div class="a2-feat-title"><?php echo $feat[1]; ?></div>
          <div class="a2-feat-desc"><?php echo $feat[2]; ?></div>
        </div>
        <?php endforeach; ?>
      </div>
    </div>
    <?php endforeach; ?>
  </div>
  <script>
  (function(){
    document.querySelectorAll('#a2-tab-nav .a2-tab-btn').forEach(function(btn){
      btn.addEventListener('click',function(){
        document.querySelectorAll('#a2-tab-nav .a2-tab-btn').forEach(function(b){b.classList.remove('active')});
        btn.classList.add('active');
        var idx=btn.dataset.tab;
        document.querySelectorAll('.a2-tab-panel').forEach(function(p){p.style.display=p.dataset.panel===idx?'block':'none'});
      });
    });
  })();
  </script>
</section>

<!-- ═══ MT5 vs MT4 — Animated Comparison ═══ -->
<section class="ip-section alt">
  <style>
  .pt-vs{border-radius:20px;overflow:hidden;background:linear-gradient(160deg,#080a0f,#0c0e14);
    border:1px solid rgba(255,255,255,.07);position:relative;margin-bottom:56px}
  .pt-vs::before{content:'';position:absolute;inset:0;
    background:radial-gradient(ellipse 50% 40% at 30% 0%,rgba(200,16,46,.05),transparent),
    radial-gradient(ellipse 40% 40% at 70% 100%,rgba(20,224,163,.04),transparent);pointer-events:none}
  .pt-vs::after{content:'';position:absolute;top:0;left:0;right:0;height:1px;
    background:linear-gradient(90deg,transparent,rgba(200,16,46,.4),rgba(20,224,163,.4),transparent);
    animation:pt-sweep 4s linear infinite}
  @keyframes pt-sweep{0%,100%{opacity:.3}50%{opacity:1}}
  .pt-vs-head{padding:28px 36px 0;position:relative;z-index:1;text-align:center}
  @media(max-width:600px){.pt-vs-head{padding:20px 18px 0}}
  .pt-vs-kicker{font-size:10px;font-weight:700;letter-spacing:.15em;text-transform:uppercase;
    color:rgba(200,16,46,.7);margin-bottom:10px;display:flex;align-items:center;justify-content:center;gap:8px}
  .pt-vs-kicker::before{content:'';width:6px;height:6px;border-radius:50%;background:#C8102E;
    box-shadow:0 0 8px rgba(200,16,46,.5);animation:pt-dot 2s infinite}
  @keyframes pt-dot{0%,100%{box-shadow:0 0 4px rgba(200,16,46,.3)}50%{box-shadow:0 0 14px rgba(200,16,46,.7)}}
  .pt-vs-title{font-size:24px;font-weight:800;color:#fff;margin-bottom:6px}
  .pt-vs-title em{font-style:normal;color:#14e0a3}
  .pt-vs-sub{font-size:13px;color:rgba(255,255,255,.35);margin-bottom:24px}
  .pt-vs-grid{display:grid;grid-template-columns:1fr auto 1fr;gap:0;padding:0 36px 28px;position:relative;z-index:1}
  @media(max-width:700px){.pt-vs-grid{grid-template-columns:1fr;padding:0 18px 20px}}
  .pt-vs-col{display:flex;flex-direction:column;gap:8px}
  .pt-vs-col-head{font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
    padding:10px 0;margin-bottom:4px}
  .pt-vs-col-head.old{color:rgba(255,255,255,.3)}
  .pt-vs-col-head.new{color:#14e0a3}
  .pt-vs-divider{width:1px;background:rgba(255,255,255,.06);margin:0 20px;position:relative}
  @media(max-width:700px){.pt-vs-divider{display:none}}
  .pt-vs-divider::after{content:'VS';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
    font-size:10px;font-weight:800;color:rgba(200,16,46,.5);background:#0a0c10;padding:8px 6px;
    border:1px solid rgba(200,16,46,.2);border-radius:6px;letter-spacing:.05em}
  .pt-vs-row{display:flex;align-items:center;justify-content:space-between;
    padding:10px 14px;border-radius:8px;font-size:13px;transition:background .15s}
  .pt-vs-row:hover{background:rgba(255,255,255,.03)}
  .pt-vs-row-label{color:rgba(255,255,255,.5);font-weight:500}
  .pt-vs-row-val{font-weight:700}
  .pt-vs-row-val.dim{color:rgba(255,255,255,.3)}
  .pt-vs-row-val.win{color:#14e0a3}
  .pt-vs-row-val.lose{color:rgba(255,255,255,.25)}
  /* Animated badge */
  .pt-vs-badge{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:4px;
    font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
    background:rgba(20,224,163,.08);border:1px solid rgba(20,224,163,.2);color:#14e0a3;
    animation:pt-badge 3s ease-in-out infinite}
  @keyframes pt-badge{0%,100%{box-shadow:none}50%{box-shadow:0 0 8px rgba(20,224,163,.15)}}
  /* Reveal animation */
  .pt-vs-row{opacity:0;transform:translateX(-10px);animation:pt-row-in .4s ease-out forwards}
  @keyframes pt-row-in{to{opacity:1;transform:none}}
  body.rtl .pt-vs-row{transform:translateX(10px)}
  </style>
  <div class="ip-container">
    <div class="pt-vs" id="pt-vs">
      <div class="pt-vs-head">
        <div class="pt-vs-kicker"><?php echo $fa?'مقایسه پلتفرم':'PLATFORM COMPARISON';?></div>
        <div class="pt-vs-title"><?php echo $fa?'MT4 در برابر <em>MT5</em>':'MT4 vs <em>MT5</em>';?></div>
        <div class="pt-vs-sub"><?php echo $fa?'چرا MT5 انتخاب بهتری برای معامله‌گران حرفه‌ای است':'Why MT5 is the superior choice for professional traders';?></div>
      </div>
      <div class="pt-vs-grid">
        <!-- MT4 column -->
        <div class="pt-vs-col">
          <div class="pt-vs-col-head old">MetaTrader 4</div>
          <?php $mt4 = $fa ? [
            ['تایم‌فریم','۹'],['اندیکاتور','۳۰'],['انواع سفارش','۴'],['زبان برنامه‌نویسی','MQL4'],
            ['عمق بازار','—'],['حالت پوزیشن','فقط هجینگ'],['تستر استراتژی','تک‌رشته‌ای'],
            ['بازارها','فقط فارکس و CFD'],['معماری','۳۲ بیتی'],
          ] : [
            ['Timeframes','9'],['Indicators','30'],['Order Types','4'],['Language','MQL4'],
            ['Market Depth','—'],['Position Mode','Hedging only'],['Strategy Tester','Single-threaded'],
            ['Markets','Forex & CFD only'],['Architecture','32-bit'],
          ];
          foreach($mt4 as $i=>$r): ?>
          <div class="pt-vs-row" style="animation-delay:<?php echo $i*0.06; ?>s">
            <span class="pt-vs-row-label"><?php echo $r[0]; ?></span>
            <span class="pt-vs-row-val lose"><?php echo $r[1]; ?></span>
          </div>
          <?php endforeach; ?>
        </div>
        <div class="pt-vs-divider"></div>
        <!-- MT5 column -->
        <div class="pt-vs-col">
          <div class="pt-vs-col-head new">MetaTrader 5 <span class="pt-vs-badge"><?php echo $fa?'برنده':'WINNER';?></span></div>
          <?php $mt5 = $fa ? [
            ['تایم‌فریم','۲۱'],['اندیکاتور','۸۰+'],['انواع سفارش','۶'],['زبان برنامه‌نویسی','MQL5'],
            ['عمق بازار','DOM کامل'],['حالت پوزیشن','هجینگ + نتینگ'],['تستر استراتژی','چندرشته‌ای'],
            ['بازارها','فارکس، سهام، کالا، کریپتو'],['معماری','۶۴ بیتی'],
          ] : [
            ['Timeframes','21'],['Indicators','80+'],['Order Types','6'],['Language','MQL5'],
            ['Market Depth','Full DOM'],['Position Mode','Hedging + Netting'],['Strategy Tester','Multi-threaded'],
            ['Markets','Forex, Stocks, Commodities, Crypto'],['Architecture','64-bit'],
          ];
          foreach($mt5 as $i=>$r): ?>
          <div class="pt-vs-row" style="animation-delay:<?php echo $i*0.06+0.1; ?>s">
            <span class="pt-vs-row-label"><?php echo $r[0]; ?></span>
            <span class="pt-vs-row-val win"><?php echo $r[1]; ?></span>
          </div>
          <?php endforeach; ?>
        </div>
      </div>
    </div>
  </div>
</section>

<!-- ═══ Platform Performance Dashboard ═══ -->
<section class="ip-section">
  <style>
  .pt-dash{display:grid;grid-template-columns:1fr 1fr;gap:0;border-radius:20px;overflow:hidden;
    background:linear-gradient(135deg,#06080c,#0c0e14);border:1px solid rgba(255,255,255,.07);
    margin-bottom:56px;position:relative}
  @media(max-width:800px){.pt-dash{grid-template-columns:1fr}}
  .pt-dash::before{content:'';position:absolute;inset:0;
    background:radial-gradient(ellipse 60% 50% at 80% 20%,rgba(20,224,163,.04),transparent);pointer-events:none}
  .pt-dash-left{padding:44px 36px;position:relative;z-index:1}
  @media(max-width:800px){.pt-dash-left{padding:28px 20px}}
  .pt-dash-kicker{font-size:10px;font-weight:700;letter-spacing:.15em;text-transform:uppercase;
    color:rgba(20,224,163,.7);margin-bottom:12px;display:flex;align-items:center;gap:8px}
  .pt-dash-kicker::before{content:'';width:6px;height:6px;border-radius:50%;background:#14e0a3;
    box-shadow:0 0 8px #14e0a3;animation:pt-dot-g 2s infinite}
  @keyframes pt-dot-g{0%,100%{box-shadow:0 0 4px #14e0a3}50%{box-shadow:0 0 14px rgba(20,224,163,.6)}}
  .pt-dash-title{font-size:26px;font-weight:800;color:#fff;margin-bottom:10px;line-height:1.2}
  @media(max-width:560px){.pt-dash-title{font-size:20px}}
  .pt-dash-title em{font-style:normal;color:#14e0a3}
  .pt-dash-desc{font-size:13.5px;color:rgba(255,255,255,.4);line-height:1.7;margin-bottom:28px}
  /* Stats grid */
  .pt-dash-stats{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}
  .pt-dash-stat{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.06);
    border-radius:12px;padding:18px;text-align:center;transition:all .25s;position:relative;overflow:hidden}
  .pt-dash-stat:hover{border-color:rgba(20,224,163,.2);transform:translateY(-2px)}
  .pt-dash-stat::before{content:'';position:absolute;top:0;left:0;right:0;height:2px;
    background:var(--sc,#14e0a3);transform:scaleX(0);transform-origin:center;transition:transform .3s}
  .pt-dash-stat:hover::before{transform:scaleX(1)}
  .pt-dash-stat-val{font-size:28px;font-weight:800;color:#fff;margin-bottom:4px;line-height:1;
    font-variant-numeric:tabular-nums}
  .pt-dash-stat-val em{font-style:normal;font-size:.5em;color:var(--sc,#14e0a3)}
  .pt-dash-stat-lbl{font-size:10.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;
    color:rgba(255,255,255,.3)}
  /* Right: animated execution visualization */
  .pt-dash-right{position:relative;min-height:380px;border-left:1px solid rgba(255,255,255,.06);
    display:flex;align-items:center;justify-content:center;overflow:hidden}
  @media(max-width:800px){.pt-dash-right{min-height:260px;border-left:none;border-top:1px solid rgba(255,255,255,.06)}}
  #pt-exec-canvas{width:100%;height:100%;display:block}
  </style>
  <div class="ip-container">
    <h2 class="ip-section-title pt-rev"><?php echo $fa?'عملکرد <em>پلتفرم</em>':'Platform <em>Performance</em>';?></h2>
    <p class="ip-section-desc pt-rev"><?php echo $fa?'متوسط عملکرد اجرای سفارش روی زیرساخت STB.':'Average order execution performance on STB infrastructure.';?></p>
    <div class="pt-dash pt-rev">
      <div class="pt-dash-left">
        <div class="pt-dash-kicker"><?php echo $fa?'آمار زنده':'LIVE METRICS';?></div>
        <h3 class="pt-dash-title"><?php echo $fa?'اجرا با <em>سرعت نور</em>':'Execution at <em>Light Speed</em>';?></h3>
        <p class="pt-dash-desc"><?php echo $fa?'زیرساخت STB برای حداقل تأخیر و حداکثر قابلیت اطمینان بهینه سازی شده است. هر سفارش از طریق پل نقدینگی NDD ما مسیریابی می‌شود.':'STB infrastructure is optimized for minimum latency and maximum reliability. Every order is routed through our NDD liquidity bridge.';?></p>
        <div class="pt-dash-stats">
          <?php $stats = $fa ? [
            ['0.125<em>s</em>','میانگین اجرا','#14e0a3'],
            ['99.9<em>%</em>','آپ‌تایم سرور','#14e0a3'],
            ['0<em>%</em>','ریکوت','#C8102E'],
            ['<1<em>ms</em>','تأخیر شبکه','#C8102E'],
          ] : [
            ['0.125<em>s</em>','Avg Execution','#14e0a3'],
            ['99.9<em>%</em>','Server Uptime','#14e0a3'],
            ['0<em>%</em>','Requotes','#C8102E'],
            ['<1<em>ms</em>','Network Latency','#C8102E'],
          ];
          foreach($stats as $s): ?>
          <div class="pt-dash-stat" style="--sc:<?php echo $s[2]; ?>">
            <div class="pt-dash-stat-val"><?php echo $s[0]; ?></div>
            <div class="pt-dash-stat-lbl"><?php echo $s[1]; ?></div>
          </div>
          <?php endforeach; ?>
        </div>
      </div>
      <div class="pt-dash-right">
        <canvas id="pt-exec-canvas"></canvas>
      </div>
    </div>
  </div>
  <script>
  (function(){
    /* Scroll reveal */
    var obs=new IntersectionObserver(function(e){e.forEach(function(en){if(en.isIntersecting){en.target.classList.add('vis');obs.unobserve(en.target)}})},{threshold:.1});
    document.querySelectorAll('.pt-rev').forEach(function(el){obs.observe(el)});

    /* Execution speed visualization — animated sine waves */
    var c=document.getElementById('pt-exec-canvas');
    if(!c)return;
    var ctx=c.getContext('2d'),dpr=window.devicePixelRatio||1,t=0;
    var animId=null, isVisible=false;
    var observer = new IntersectionObserver(function(entries){
      entries.forEach(function(entry){
        isVisible = entry.isIntersecting;
        if(isVisible){
          if(!animId) animId = requestAnimationFrame(draw);
        } else {
          if(animId) {
            cancelAnimationFrame(animId);
            animId = null;
          }
        }
      });
    }, {threshold:0.01});
    function resize(){var r=c.parentElement.getBoundingClientRect();c.width=r.width*dpr;c.height=r.height*dpr;c.style.width=r.width+'px';c.style.height=r.height+'px';ctx.setTransform(dpr,0,0,dpr,0,0)}
    resize();window.addEventListener('resize',resize);
    observer.observe(c);

    var orders=[];
    function spawnOrder(){
      orders.push({x:0,y:Math.random(),speed:.003+Math.random()*.004,size:2+Math.random()*2,
        color:Math.random()>.5?'rgba(200,16,46,':'rgba(20,224,163,',alpha:0,state:'in'});
    }
    for(var i=0;i<8;i++)spawnOrder();

    function draw(){
      var w=c.width/dpr,h=c.height/dpr;
      ctx.clearRect(0,0,w,h);

      // Background grid
      ctx.strokeStyle='rgba(255,255,255,.02)';ctx.lineWidth=.5;
      for(var gy=0;gy<h;gy+=30){ctx.beginPath();ctx.moveTo(0,gy);ctx.lineTo(w,gy);ctx.stroke()}
      for(var gx=0;gx<w;gx+=30){ctx.beginPath();ctx.moveTo(gx,0);ctx.lineTo(gx,h);ctx.stroke()}

      // Execution waves
      [['rgba(200,16,46,',.3,1.5],['rgba(20,224,163,',.2,2]].forEach(function(wave){
        ctx.beginPath();
        for(var x=0;x<w;x++){
          var y=h/2+Math.sin(x*0.02+t*0.03*wave[2])*h*wave[1]+Math.sin(x*0.005+t*0.01)*h*0.1;
          x===0?ctx.moveTo(x,y):ctx.lineTo(x,y);
        }
        ctx.strokeStyle=wave[0]+'0.15)';ctx.lineWidth=1.5;ctx.stroke();
        // Fill area
        ctx.lineTo(w,h);ctx.lineTo(0,h);ctx.closePath();
        ctx.fillStyle=wave[0]+'0.03)';ctx.fill();
      });

      // Order particles flowing left to right
      orders.forEach(function(o){
        o.x+=o.speed;
        if(o.state==='in'&&o.alpha<1)o.alpha=Math.min(1,o.alpha+0.05);
        if(o.x>0.85){o.state='out';o.alpha=Math.max(0,o.alpha-0.04)}
        var px=o.x*w,py=o.y*h*0.6+h*0.2+Math.sin(o.x*Math.PI*3+t*0.02)*15;
        // Trail
        var grad=ctx.createLinearGradient(px-30,py,px,py);
        grad.addColorStop(0,o.color+'0)');grad.addColorStop(1,o.color+(o.alpha*0.4)+')');
        ctx.beginPath();ctx.moveTo(px-30,py);ctx.lineTo(px,py);ctx.strokeStyle=grad;ctx.lineWidth=1;ctx.stroke();
        // Dot
        ctx.beginPath();ctx.arc(px,py,o.size,0,Math.PI*2);
        ctx.fillStyle=o.color+(o.alpha*0.7)+')';ctx.fill();
        // Glow
        var g=ctx.createRadialGradient(px,py,0,px,py,o.size*4);
        g.addColorStop(0,o.color+(o.alpha*0.2)+')');g.addColorStop(1,'transparent');
        ctx.fillStyle=g;ctx.fillRect(px-o.size*4,py-o.size*4,o.size*8,o.size*8);
      });
      // Recycle dead orders
      orders=orders.filter(function(o){return o.alpha>0||o.state==='in'});
      if(orders.length<8&&Math.random()<0.05)spawnOrder();

      // Center processing node
      var cx=w*0.5,cy=h*0.5;
      ctx.beginPath();ctx.arc(cx,cy,6+Math.sin(t*0.05)*2,0,Math.PI*2);
      ctx.fillStyle='rgba(20,224,163,.15)';ctx.fill();
      ctx.beginPath();ctx.arc(cx,cy,3,0,Math.PI*2);ctx.fillStyle='rgba(20,224,163,.5)';ctx.fill();

      t++;
      if(!isVisible){
        animId = null;
        return;
      }
      animId = requestAnimationFrame(draw);
    }
  })();
  </script>
</section>

<!-- CTA Bottom -->
<section class="ip-section alt">
  <div class="ip-container">
    <div class="ip-cta-strip">
      <div class="ip-cta-strip-text"><h3><?php echo $fa?'آماده شروع معامله هستید؟':'Ready to start trading?';?></h3><p><?php echo $fa?'حساب خود را باز کنید و از MetaTrader 5 با شرایط حرفه‌ای STB استفاده کنید.':'Open your account and trade on MetaTrader 5 with STB professional conditions.';?></p></div>
      <div class="ip-cta-strip-btns"><a href="<?php echo esc_html($register_label_url);?>" class="ip-btn-red"><?php echo $fa?'افتتاح حساب':'Open Account';?></a><a href="<?php echo stb_url($B.'/contact/'); ?>" class="ip-btn-ghost"><?php echo $fa?'تماس با ما':'Contact Us';?></a></div>
    </div>
  </div>
</section>
</article>
