<?php
/**
 * STB ACADEMY — full live page
 * Visual language: futuristic, animated, dark, signal red + green accents
 * Bilingual EN/FA, RTL-safe
 */
$lang = stb_lang();
$B = '';
$fa = $lang === 'fa';
$login_url    = $fa ? 'https://crm.stbbrokers.com/fa' : 'https://crm.stbbrokers.com/';
$register_url = $fa ? 'https://crm.stbbrokers.com/fa/register' : 'https://crm.stbbrokers.com/register/';
$marketplace_url = $fa ? 'https://crm.stbbrokers.com/fa/marketplace' : 'https://crm.stbbrokers.com/marketplace';

// === Course catalogue ===========================================================
// Each: id, accent color, level pill, access pill, title, description, modules-summary
$courses_data = $fa ? [
  [
    'id'=>'c01','color'=>'#14e0a3','tone'=>'green',
    'level' => 'سطح ۱ · مقدماتی',
    'access'=> 'حساب فعال + شارژ حداقل $۵۰',
    'title' => 'آموزش تحلیل تکنیکال مقدماتی بروکر',
    'desc'  => 'مفاهیم پایه نمودار، الگوهای شمعی، حمایت و مقاومت و معرفی اندیکاتورهای کلیدی. شروع مناسب برای ورود به دنیای معامله‌گری.',
    'topics'=> ['الگوهای شمعی','حمایت و مقاومت','اندیکاتورهای کلیدی','تحلیل پرایس اکشن'],
    'icon'  => '<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5" fill="none"/>',
    'shape' => 'chart-up',
  ],
  [
    'id'=>'c02','color'=>'#f5a524','tone'=>'amber',
    'level' => 'سطح ۲ · میانی',
    'access'=> 'حساب فعال + شارژ حداقل $۲۰۰',
    'title' => 'دوره عرضه و تقاضا — S&D',
    'desc'  => 'شناسایی نواحی کلیدی عرضه و تقاضا، ورود و خروج از مناطق با ارزش بالا و خواندن رفتار قیمت در اطراف سطوح حساس بازار.',
    'topics'=> ['نواحی عرضه','نواحی تقاضا','تحلیل حجم سفارش','نقاط ورود و خروج'],
    'icon'  => '<path d="M3 12h4l3-8 4 16 3-8h4" stroke-width="1.5" fill="none"/>',
    'shape' => 'pulse',
  ],
  [
    'id'=>'c03','color'=>'#C8102E','tone'=>'red',
    'level' => 'سطح ۳ · پیشرفته',
    'access'=> 'حساب فعال + پرداخت $۲۰۰',
    'title' => 'دوره آموزشی پیشرفته RTM',
    'desc'  => 'متدولوژی Read The Market — تحلیل ساختار بازار، شناسایی Engulf و Compression و مدیریت معامله بر اساس ردپای پول هوشمند.',
    'topics'=> ['ساختار بازار','Engulf & Compression','پول هوشمند','مدیریت معامله'],
    'icon'  => '<polyline points="4 17 10 11 14 15 20 9" stroke-width="1.5" fill="none"/><polyline points="14 9 20 9 20 15" stroke-width="1.5" fill="none"/>',
    'shape' => 'breakout',
  ],
  [
    'id'=>'c04','color'=>'#C8102E','tone'=>'red',
    'level' => 'سطح ۴ · حرفه‌ای',
    'access'=> 'حساب فعال + پرداخت $۳۵۰',
    'title' => 'دوره آموزشی والیوم تریدینگ',
    'desc'  => 'خواندن حجم معاملات به‌عنوان معیار اصلی تصمیم‌گیری. تشخیص نقاط ورود مؤسسات و ساخت سیستم معاملاتی مبتنی بر Volume Profile.',
    'topics'=> ['Volume Profile','VWAP','ورود مؤسسات','تأیید حجم'],
    'icon'  => '<rect x="3" y="13" width="3" height="8" stroke-width="1.5"/><rect x="9" y="9" width="3" height="12" stroke-width="1.5"/><rect x="15" y="5" width="3" height="16" stroke-width="1.5"/>',
    'shape' => 'volume',
  ],
  [
    'id'=>'c05','color'=>'#14e0a3','tone'=>'green',
    'level' => 'رایگان · کاربردی',
    'access'=> 'حساب فعال + احراز هویت · رایگان',
    'title' => 'دیتاهای اقتصادی تأثیرگذار در فارکس',
    'desc'  => 'شناخت CPI، Non-Farm Payroll، نرخ بهره فدرال رزرو و بانک‌های مرکزی. خواندن تقویم اقتصادی و معامله‌گری در روزهای پرنوسان داده‌محور.',
    'topics'=> ['CPI و NFP','نرخ بهره','تقویم اقتصادی','معامله در اخبار'],
    'icon'  => '<rect x="3" y="4" width="18" height="18" rx="2" stroke-width="1.5"/><line x1="16" y1="2" x2="16" y2="6" stroke-width="1.5"/><line x1="8" y1="2" x2="8" y2="6" stroke-width="1.5"/><line x1="3" y1="10" x2="21" y2="10" stroke-width="1.5"/>',
    'shape' => 'calendar',
  ],
] : [
  [
    'id'=>'c01','color'=>'#14e0a3','tone'=>'green',
    'level' => 'Level 1 · Beginner',
    'access'=> 'Active account + $50 min deposit',
    'title' => 'Beginner Technical Analysis (Broker)',
    'desc'  => 'Chart basics, candlestick patterns, support and resistance, and key indicators. The right entry point for anyone serious about trading.',
    'topics'=> ['Candlestick patterns','Support & resistance','Key indicators','Price action basics'],
    'icon'  => '<path d="M3 3v18h18" stroke-width="1.5"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="1.5" fill="none"/>',
    'shape' => 'chart-up',
  ],
  [
    'id'=>'c02','color'=>'#f5a524','tone'=>'amber',
    'level' => 'Level 2 · Intermediate',
    'access'=> 'Active account + $200 min deposit',
    'title' => 'Supply & Demand — S&D',
    'desc'  => 'Identify high-value supply and demand zones, time entries and exits at price-sensitive levels, and read order flow around critical market thresholds.',
    'topics'=> ['Supply zones','Demand zones','Order-flow context','Entry & exit timing'],
    'icon'  => '<path d="M3 12h4l3-8 4 16 3-8h4" stroke-width="1.5" fill="none"/>',
    'shape' => 'pulse',
  ],
  [
    'id'=>'c03','color'=>'#C8102E','tone'=>'red',
    'level' => 'Level 3 · Advanced',
    'access'=> 'Active account + $200 payment',
    'title' => 'Advanced RTM',
    'desc'  => 'Read The Market methodology — market-structure analysis, Engulf and Compression patterns, and trade management built around smart-money footprints.',
    'topics'=> ['Market structure','Engulf & Compression','Smart-money flow','Trade management'],
    'icon'  => '<polyline points="4 17 10 11 14 15 20 9" stroke-width="1.5" fill="none"/><polyline points="14 9 20 9 20 15" stroke-width="1.5" fill="none"/>',
    'shape' => 'breakout',
  ],
  [
    'id'=>'c04','color'=>'#C8102E','tone'=>'red',
    'level' => 'Level 4 · Professional',
    'access'=> 'Active account + $350 payment',
    'title' => 'Volume Trading',
    'desc'  => 'Read volume as the primary decision metric. Spot institutional entries and build a trading system anchored on Volume Profile and VWAP.',
    'topics'=> ['Volume Profile','VWAP','Institutional entries','Volume confirmation'],
    'icon'  => '<rect x="3" y="13" width="3" height="8" stroke-width="1.5"/><rect x="9" y="9" width="3" height="12" stroke-width="1.5"/><rect x="15" y="5" width="3" height="16" stroke-width="1.5"/>',
    'shape' => 'volume',
  ],
  [
    'id'=>'c05','color'=>'#14e0a3','tone'=>'green',
    'level' => 'Free · Practical',
    'access'=> 'Active account + KYC · Free',
    'title' => 'Market-Moving Economic Data',
    'desc'  => 'CPI, Non-Farm Payroll, Fed and central-bank rates explained. Read the economic calendar and trade the high-volatility data sessions with intent.',
    'topics'=> ['CPI & NFP','Interest rates','Economic calendar','News trading'],
    'icon'  => '<rect x="3" y="4" width="18" height="18" rx="2" stroke-width="1.5"/><line x1="16" y1="2" x2="16" y2="6" stroke-width="1.5"/><line x1="8" y1="2" x2="8" y2="6" stroke-width="1.5"/><line x1="3" y1="10" x2="21" y2="10" stroke-width="1.5"/>',
    'shape' => 'calendar',
  ],
];
?>
<style>
/* ════════════════════════════════════════════════════════════════════════
   STB ACADEMY — Live page
   Design language: futuristic, animated, dark
   Palette: #04060a base · #14e0a3 green · #C8102E red · #f5a524 amber accent
   ════════════════════════════════════════════════════════════════════════ */

/* ──────────── HERO ──────────── */
.ac-hero{position:relative;min-height:100vh;display:flex;align-items:center;justify-content:center;
  padding:120px 24px 80px;overflow:hidden;background:#04060a}
.ac-grid-bg{position:absolute;inset:0;
  background-image:
    linear-gradient(rgba(20,224,163,.025) 1px,transparent 1px),
    linear-gradient(90deg,rgba(20,224,163,.025) 1px,transparent 1px);
  background-size:50px 50px;
  mask-image:radial-gradient(ellipse 65% 65% at 50% 50%,black 25%,transparent 75%);
  animation:ac-drift 25s linear infinite;pointer-events:none}
@keyframes ac-drift{0%{transform:translate(0,0) rotate(0)}100%{transform:translate(50px,50px) rotate(2deg)}}

.ac-helix{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.ac-helix-line{position:absolute;width:200%;height:1px;top:50%;left:-50%;
  background:linear-gradient(90deg,transparent 0%,rgba(20,224,163,.08) 25%,rgba(200,16,46,.06) 50%,rgba(20,224,163,.08) 75%,transparent 100%);
  animation:ac-helix-move 8s linear infinite}
@keyframes ac-helix-move{0%{transform:translateX(-25%)}100%{transform:translateX(0)}}
.ac-helix-line:nth-child(2){top:35%;animation-delay:-2s;opacity:.6}
.ac-helix-line:nth-child(3){top:65%;animation-delay:-4s;opacity:.4}
.ac-helix-line:nth-child(4){top:20%;animation-delay:-1s;opacity:.3}
.ac-helix-line:nth-child(5){top:80%;animation-delay:-5s;opacity:.3}

.ac-nodes{position:absolute;inset:0;pointer-events:none}
.ac-node{position:absolute;border-radius:50%;animation:ac-node-float ease-in-out infinite;
  display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:rgba(255,255,255,.1)}
@keyframes ac-node-float{0%,100%{transform:translate(0,0)}50%{transform:translate(var(--dx,10px),var(--dy,-15px))}}

.ac-orb{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:240px;height:240px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,rgba(20,224,163,.1),transparent 65%);
  animation:ac-orb-breathe 5s ease-in-out infinite;z-index:1}
@keyframes ac-orb-breathe{0%,100%{transform:translate(-50%,-50%) scale(1);opacity:.5}50%{transform:translate(-50%,-50%) scale(1.4);opacity:.9}}
.ac-orb-2{background:radial-gradient(circle,rgba(200,16,46,.07),transparent 65%);
  animation-delay:2.5s;width:180px;height:180px}

.ac-hero-inner{position:relative;z-index:10;max-width:880px;text-align:center}
.ac-icon-wrap{width:80px;height:80px;border-radius:50%;margin:0 auto 24px;
  background:rgba(20,224,163,.06);border:2px solid rgba(20,224,163,.2);
  display:flex;align-items:center;justify-content:center;
  animation:ac-icon-pulse 3s ease-in-out infinite;position:relative}
@keyframes ac-icon-pulse{0%,100%{box-shadow:0 0 0 0 rgba(20,224,163,.2)}50%{box-shadow:0 0 40px rgba(20,224,163,.15)}}
.ac-icon-wrap svg{stroke:#14e0a3;fill:none;width:36px;height:36px}
.ac-icon-wrap::before,.ac-icon-wrap::after{content:'';position:absolute;width:8px;height:8px;border-radius:50%;animation:ac-orbit 4s linear infinite}
.ac-icon-wrap::before{background:#C8102E;box-shadow:0 0 8px rgba(200,16,46,.6);top:-4px;left:50%;animation-delay:0s}
.ac-icon-wrap::after{background:#14e0a3;box-shadow:0 0 8px rgba(20,224,163,.6);bottom:-4px;right:50%;animation-delay:-2s}
@keyframes ac-orbit{0%{transform:rotate(0) translateX(48px) rotate(0)}100%{transform:rotate(360deg) translateX(48px) rotate(-360deg)}}

.ac-badge{display:inline-flex;align-items:center;gap:8px;padding:7px 18px;border-radius:30px;
  background:rgba(20,224,163,.06);border:1px solid rgba(20,224,163,.2);
  font-size:10.5px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:#14e0a3;
  margin-bottom:24px;animation:ac-badge-glow 3s ease-in-out infinite}
@keyframes ac-badge-glow{0%,100%{box-shadow:none}50%{box-shadow:0 0 24px rgba(20,224,163,.12)}}
.ac-badge::before{content:'';width:7px;height:7px;border-radius:50%;background:#14e0a3;
  animation:ac-bdot 2s infinite}
@keyframes ac-bdot{0%,100%{box-shadow:0 0 4px #14e0a3}50%{box-shadow:0 0 12px rgba(20,224,163,.8)}}

.ac-title{font-size:clamp(36px,6vw,68px);font-weight:900;color:#fff;line-height:1.05;
  margin-bottom:18px;letter-spacing:-.03em}
.ac-title em{font-style:normal;color:#14e0a3;
  background:linear-gradient(135deg,#14e0a3 0%,#0fb88a 50%,#14e0a3 100%);
  background-size:200% auto;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  animation:ac-text-shimmer 4s linear infinite}
@keyframes ac-text-shimmer{0%{background-position:0% center}100%{background-position:200% center}}
.ac-sub{font-size:clamp(15px,1.8vw,18px);color:rgba(255,255,255,.5);line-height:1.65;
  margin-bottom:36px;max-width:580px;margin-left:auto;margin-right:auto}

.ac-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;max-width:780px;margin:0 auto 36px}
@media(max-width:700px){.ac-stats{grid-template-columns:repeat(2,1fr)}}
.ac-stat{padding:18px 14px;border-radius:14px;background:rgba(255,255,255,.025);
  border:1px solid rgba(255,255,255,.06);transition:all .3s;position:relative;overflow:hidden}
.ac-stat::before{content:'';position:absolute;inset:0;background:linear-gradient(135deg,var(--sc,#14e0a3) 0%,transparent 50%);opacity:0;transition:opacity .3s}
.ac-stat:hover{transform:translateY(-3px);border-color:rgba(20,224,163,.2)}
.ac-stat:hover::before{opacity:.05}
.ac-stat-val{font-size:clamp(22px,3vw,30px);font-weight:900;color:#fff;line-height:1;margin-bottom:6px;font-feature-settings:"tnum"}
.ac-stat-val em{font-style:normal;color:var(--sc,#14e0a3);font-size:.7em;margin-left:2px}
.ac-stat-lbl{font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:rgba(255,255,255,.4)}

.ac-ctas{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-bottom:24px}
.ac-btn-primary{padding:14px 32px;border-radius:12px;font-size:14px;font-weight:700;
  background:linear-gradient(135deg,#14e0a3,#0fb88a);color:#04120e;text-decoration:none;
  box-shadow:0 4px 24px rgba(20,224,163,.25);transition:all .25s;position:relative;overflow:hidden;
  display:inline-flex;align-items:center;gap:8px}
.ac-btn-primary::before{content:'';position:absolute;inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.2),transparent);
  transform:translateX(-100%);transition:transform .6s}
.ac-btn-primary:hover::before{transform:translateX(100%)}
.ac-btn-primary:hover{transform:translateY(-2px);box-shadow:0 8px 32px rgba(20,224,163,.4);color:#04120e}
.ac-btn-primary svg{width:16px;height:16px;stroke:currentColor;fill:none}
.ac-btn-ghost{padding:14px 28px;border-radius:12px;font-size:14px;font-weight:600;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.75);text-decoration:none;transition:all .2s;
  display:inline-flex;align-items:center;gap:8px}
.ac-btn-ghost:hover{color:#fff;border-color:rgba(255,255,255,.3);background:rgba(255,255,255,.06)}
.ac-btn-ghost svg{width:16px;height:16px;stroke:currentColor;fill:none}

.ac-scroll-hint{position:absolute;bottom:32px;left:50%;transform:translateX(-50%);
  font-size:10.5px;font-weight:700;letter-spacing:.18em;text-transform:uppercase;
  color:rgba(255,255,255,.3);display:flex;flex-direction:column;align-items:center;gap:10px;z-index:5}
.ac-scroll-line{width:1px;height:36px;background:linear-gradient(to bottom,rgba(20,224,163,.6),transparent);
  position:relative;overflow:hidden}
.ac-scroll-line::after{content:'';position:absolute;top:0;left:0;right:0;height:50%;
  background:#14e0a3;animation:ac-scroll-fall 2s ease-in-out infinite}
@keyframes ac-scroll-fall{0%{transform:translateY(-100%)}100%{transform:translateY(200%)}}

/* ──────────── COURSES SECTION ──────────── */
.ac-courses-sec{background:#06080c;padding:90px 0 100px;position:relative;overflow:hidden}
.ac-courses-sec::before{content:'';position:absolute;top:0;left:0;right:0;height:1px;
  background:linear-gradient(90deg,transparent,rgba(20,224,163,.3),transparent)}
.ac-cs-inner{max-width:1200px;margin:0 auto;padding:0 40px;position:relative;z-index:2}
@media(max-width:768px){.ac-cs-inner{padding:0 20px}}

.ac-sec-head{text-align:center;margin-bottom:56px;max-width:680px;margin-left:auto;margin-right:auto}
.ac-sec-kicker{display:inline-block;font-size:11px;font-weight:800;letter-spacing:.18em;text-transform:uppercase;
  color:#14e0a3;margin-bottom:14px;padding:5px 14px;border-radius:30px;
  background:rgba(20,224,163,.06);border:1px solid rgba(20,224,163,.18)}
.ac-sec-title{font-size:clamp(28px,4.5vw,46px);font-weight:900;color:#fff;line-height:1.1;
  letter-spacing:-.025em;margin-bottom:14px}
.ac-sec-title em{font-style:normal;color:#14e0a3}
.ac-sec-desc{font-size:15px;color:rgba(255,255,255,.45);line-height:1.65}

/* Featured course (large) */
.ac-feat{position:relative;border-radius:24px;overflow:hidden;margin-bottom:24px;
  background:linear-gradient(135deg,rgba(20,224,163,.08) 0%,rgba(20,224,163,.02) 50%,transparent 100%);
  border:1px solid rgba(20,224,163,.18);padding:48px 48px;
  display:grid;grid-template-columns:1fr 1.4fr;gap:48px;align-items:center}
@media(max-width:900px){.ac-feat{grid-template-columns:1fr;padding:36px 28px;gap:32px}}
.ac-feat::before{content:'';position:absolute;top:-50%;right:-20%;width:600px;height:600px;
  background:radial-gradient(circle,rgba(20,224,163,.12),transparent 60%);pointer-events:none}
.ac-feat-visual{position:relative;aspect-ratio:1;display:flex;align-items:center;justify-content:center}
.ac-feat-shape{position:absolute;inset:10%;border:1px solid rgba(20,224,163,.15);border-radius:50%;animation:ac-spin 30s linear infinite}
.ac-feat-shape:nth-child(2){inset:20%;animation-duration:20s;animation-direction:reverse;border-color:rgba(200,16,46,.1)}
.ac-feat-shape:nth-child(3){inset:30%;animation-duration:15s;border-color:rgba(20,224,163,.1)}
@keyframes ac-spin{to{transform:rotate(360deg)}}
.ac-feat-icon{position:relative;z-index:2;width:120px;height:120px;border-radius:30px;
  background:linear-gradient(135deg,#14e0a3,#0fb88a);display:flex;align-items:center;justify-content:center;
  box-shadow:0 20px 60px rgba(20,224,163,.3);animation:ac-feat-float 5s ease-in-out infinite}
@keyframes ac-feat-float{0%,100%{transform:translateY(0) rotate(-4deg)}50%{transform:translateY(-10px) rotate(4deg)}}
.ac-feat-icon svg{width:56px;height:56px;stroke:#04120e}
.ac-feat-dots{position:absolute;inset:0;pointer-events:none}
.ac-feat-dot{position:absolute;width:6px;height:6px;border-radius:50%;background:#14e0a3;
  box-shadow:0 0 12px rgba(20,224,163,.8);animation:ac-fd-pulse 2s ease-in-out infinite}
.ac-feat-dot:nth-child(1){top:15%;left:20%;animation-delay:0s}
.ac-feat-dot:nth-child(2){top:25%;right:10%;animation-delay:.4s}
.ac-feat-dot:nth-child(3){bottom:20%;left:15%;animation-delay:.8s;background:#C8102E;box-shadow:0 0 12px rgba(200,16,46,.8)}
.ac-feat-dot:nth-child(4){bottom:30%;right:18%;animation-delay:1.2s}
.ac-feat-dot:nth-child(5){top:50%;left:8%;animation-delay:1.6s;background:#C8102E;box-shadow:0 0 12px rgba(200,16,46,.8)}
@keyframes ac-fd-pulse{0%,100%{opacity:.4;transform:scale(1)}50%{opacity:1;transform:scale(1.5)}}
.ac-feat-content{}
.ac-feat-tag{display:inline-flex;align-items:center;gap:6px;font-size:10.5px;font-weight:800;
  letter-spacing:.14em;text-transform:uppercase;color:#14e0a3;margin-bottom:14px;
  padding:5px 12px;border-radius:6px;background:rgba(20,224,163,.1);border:1px solid rgba(20,224,163,.25)}
.ac-feat-tag svg{width:12px;height:12px;stroke:currentColor;fill:none}
.ac-feat-title{font-size:clamp(24px,3.4vw,34px);font-weight:900;color:#fff;line-height:1.15;
  letter-spacing:-.02em;margin-bottom:14px}
.ac-feat-desc{font-size:15.5px;color:rgba(255,255,255,.62);line-height:1.7;margin-bottom:24px}
.ac-pills{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px}
.ac-pill{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:30px;
  font-size:12px;font-weight:700;background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.1);
  color:rgba(255,255,255,.78)}
.ac-pill svg{width:14px;height:14px;stroke:currentColor;fill:none}
.ac-pill.lvl{color:#14e0a3;border-color:rgba(20,224,163,.3);background:rgba(20,224,163,.06)}
.ac-feat-topics{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:28px}
.ac-topic{font-size:11.5px;font-weight:600;padding:5px 12px;border-radius:8px;
  background:rgba(255,255,255,.025);color:rgba(255,255,255,.5);border:1px solid rgba(255,255,255,.06)}

/* Course grid */
.ac-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:20px}
@media(max-width:780px){.ac-grid{grid-template-columns:1fr}}
.ac-card{position:relative;padding:28px;border-radius:20px;background:rgba(255,255,255,.025);
  border:1px solid rgba(255,255,255,.07);overflow:hidden;transition:all .35s cubic-bezier(.16,1,.3,1)}
.ac-card::before{content:'';position:absolute;top:0;left:0;right:0;height:2px;
  background:var(--cc,#14e0a3);transform:scaleX(.3);transform-origin:left;transition:transform .4s}
.ac-card::after{content:'';position:absolute;top:-50%;right:-30%;width:300px;height:300px;
  background:radial-gradient(circle,var(--cc,#14e0a3),transparent 60%);opacity:0;transition:opacity .4s}
.ac-card:hover{transform:translateY(-4px);border-color:rgba(255,255,255,.15);background:rgba(255,255,255,.035)}
.ac-card:hover::before{transform:scaleX(1)}
.ac-card:hover::after{opacity:.07}
.ac-card-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:18px;gap:18px;position:relative;z-index:2}
.ac-card-icon{width:54px;height:54px;border-radius:14px;flex-shrink:0;
  background:linear-gradient(135deg,var(--cc,#14e0a3),transparent);
  border:1px solid var(--cc,rgba(20,224,163,.3));display:flex;align-items:center;justify-content:center;
  transition:transform .35s;position:relative;overflow:hidden}
.ac-card-icon::before{content:'';position:absolute;inset:0;background:var(--cc,#14e0a3);opacity:.15}
.ac-card-icon svg{position:relative;z-index:1;width:26px;height:26px;stroke:var(--cc,#14e0a3);fill:none;transition:transform .35s}
.ac-card:hover .ac-card-icon{transform:rotate(-4deg) scale(1.05)}
.ac-card:hover .ac-card-icon svg{transform:scale(1.1)}
.ac-card-num{font-size:11px;font-weight:800;color:rgba(255,255,255,.18);letter-spacing:.1em;
  font-feature-settings:"tnum";padding-top:6px}
.ac-card-lvl{display:inline-flex;align-items:center;gap:6px;font-size:10.5px;font-weight:700;
  letter-spacing:.08em;text-transform:uppercase;color:var(--cc,#14e0a3);margin-bottom:8px;
  position:relative;z-index:2}
.ac-card-lvl::before{content:'';width:5px;height:5px;border-radius:50%;background:var(--cc,#14e0a3);
  box-shadow:0 0 6px var(--cc,#14e0a3)}
.ac-card-title{font-size:19px;font-weight:800;color:#fff;line-height:1.25;margin-bottom:10px;
  letter-spacing:-.015em;position:relative;z-index:2}
.ac-card-desc{font-size:13.5px;color:rgba(255,255,255,.5);line-height:1.65;margin-bottom:18px;
  position:relative;z-index:2}
.ac-card-topics{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:20px;position:relative;z-index:2}
.ac-card-topic{font-size:10.5px;font-weight:600;padding:4px 9px;border-radius:6px;
  background:rgba(255,255,255,.03);color:rgba(255,255,255,.45);border:1px solid rgba(255,255,255,.05)}
.ac-card-foot{display:flex;justify-content:space-between;align-items:center;gap:14px;padding-top:18px;
  border-top:1px dashed rgba(255,255,255,.07);position:relative;z-index:2}
.ac-card-access{font-size:11px;font-weight:600;color:rgba(255,255,255,.4);line-height:1.4}
.ac-card-cta{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;
  color:var(--cc,#14e0a3);text-decoration:none;padding:8px 14px;border-radius:8px;
  background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);transition:all .2s;flex-shrink:0}
.ac-card-cta svg{width:13px;height:13px;stroke:currentColor;fill:none;transition:transform .2s}
.ac-card-cta:hover{color:#fff;background:var(--cc,#14e0a3);border-color:var(--cc,#14e0a3)}
.ac-card-cta:hover svg{transform:translateX(3px)}

/* RTL flip the arrow */
body.rtl .ac-card-cta svg{transform:scaleX(-1)}
body.rtl .ac-card-cta:hover svg{transform:scaleX(-1) translateX(3px)}

/* ──────────── HOW IT WORKS ──────────── */
.ac-how{background:#04060a;padding:90px 0;position:relative;overflow:hidden}
.ac-how::before{content:'';position:absolute;inset:0;
  background-image:
    radial-gradient(circle at 20% 30%,rgba(20,224,163,.04),transparent 40%),
    radial-gradient(circle at 80% 70%,rgba(200,16,46,.04),transparent 40%);
  pointer-events:none}
.ac-how-inner{max-width:1100px;margin:0 auto;padding:0 40px;position:relative;z-index:2}
@media(max-width:768px){.ac-how-inner{padding:0 20px}}
.ac-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:24px;margin-top:48px;position:relative}
@media(max-width:780px){.ac-steps{grid-template-columns:1fr;gap:18px}}
.ac-steps::before{content:'';position:absolute;top:48px;left:14%;right:14%;height:1px;
  background:linear-gradient(90deg,transparent,rgba(20,224,163,.25) 20%,rgba(200,16,46,.2) 50%,rgba(20,224,163,.25) 80%,transparent);
  pointer-events:none}
@media(max-width:780px){.ac-steps::before{display:none}}
.ac-step{text-align:center;position:relative}
.ac-step-num{width:96px;height:96px;border-radius:50%;margin:0 auto 24px;
  background:#06080c;border:1px solid rgba(255,255,255,.1);
  display:flex;align-items:center;justify-content:center;font-size:38px;font-weight:900;
  color:rgba(255,255,255,.18);font-feature-settings:"tnum";position:relative;
  transition:all .35s;letter-spacing:-.02em}
.ac-step:hover .ac-step-num{border-color:rgba(20,224,163,.4);color:#14e0a3;
  box-shadow:0 0 0 6px rgba(20,224,163,.06)}
.ac-step-num::after{content:'';position:absolute;inset:-6px;border-radius:50%;
  border:1px dashed rgba(20,224,163,.15);animation:ac-spin 20s linear infinite;pointer-events:none}
.ac-step-icon{position:absolute;top:0;left:50%;transform:translate(-50%,-50%);
  width:36px;height:36px;border-radius:10px;background:#04060a;border:1px solid rgba(20,224,163,.3);
  display:flex;align-items:center;justify-content:center}
.ac-step-icon svg{width:18px;height:18px;stroke:#14e0a3;fill:none}
.ac-step-title{font-size:18px;font-weight:800;color:#fff;margin-bottom:8px}
.ac-step-desc{font-size:13.5px;color:rgba(255,255,255,.5);line-height:1.65;max-width:280px;margin:0 auto}

/* ──────────── ENCYCLOPEDIA STRIP ──────────── */
.ac-enc{background:#06080c;padding:80px 0;position:relative;overflow:hidden}
.ac-enc-inner{max-width:1200px;margin:0 auto;padding:0 40px;position:relative;z-index:2}
@media(max-width:768px){.ac-enc-inner{padding:0 20px}}
.ac-enc-grid{display:grid;grid-template-columns:1fr 1.3fr;gap:48px;align-items:center}
@media(max-width:900px){.ac-enc-grid{grid-template-columns:1fr;gap:32px}}
.ac-enc-left .ac-sec-kicker{margin-bottom:14px}
.ac-enc-counter{font-size:clamp(50px,9vw,90px);font-weight:900;color:#fff;line-height:1;
  letter-spacing:-.04em;font-feature-settings:"tnum";margin:14px 0 6px;
  background:linear-gradient(135deg,#fff 0%,#14e0a3 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.ac-enc-counter em{font-style:normal;font-size:.55em;color:#14e0a3;-webkit-text-fill-color:#14e0a3;margin-left:4px}
.ac-enc-lbl{font-size:13px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;
  color:rgba(255,255,255,.4);margin-bottom:18px}
.ac-enc-desc{font-size:15px;color:rgba(255,255,255,.55);line-height:1.7;margin-bottom:24px;max-width:380px}
.ac-enc-terms{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
@media(max-width:600px){.ac-enc-terms{grid-template-columns:repeat(2,1fr)}}
.ac-term{padding:14px 16px;border-radius:12px;background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);transition:all .25s;text-decoration:none;display:block;
  position:relative;overflow:hidden}
.ac-term::before{content:'';position:absolute;top:0;left:-100%;width:100%;height:100%;
  background:linear-gradient(90deg,transparent,rgba(20,224,163,.05),transparent);transition:left .5s}
.ac-term:hover{transform:translateY(-2px);border-color:rgba(20,224,163,.25);background:rgba(20,224,163,.03)}
.ac-term:hover::before{left:100%}
.ac-term-name{font-size:14.5px;font-weight:800;color:#fff;margin-bottom:3px;letter-spacing:-.01em}
.ac-term-cat{font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#14e0a3}

/* ──────────── FINAL CTA ──────────── */
.ac-cta-sec{background:#04060a;padding:90px 24px 100px;position:relative;overflow:hidden;text-align:center}
.ac-cta-sec::before{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:800px;height:800px;border-radius:50%;
  background:radial-gradient(circle,rgba(20,224,163,.06),transparent 50%);pointer-events:none}
.ac-cta-inner{max-width:680px;margin:0 auto;position:relative;z-index:2}
.ac-cta-title{font-size:clamp(28px,4.5vw,46px);font-weight:900;color:#fff;line-height:1.1;
  margin-bottom:18px;letter-spacing:-.025em}
.ac-cta-title em{font-style:normal;color:#14e0a3}
.ac-cta-desc{font-size:15.5px;color:rgba(255,255,255,.5);line-height:1.7;margin-bottom:32px}

/* RTL */
body.rtl .ac-icon-wrap::before{left:auto;right:50%}
body.rtl .ac-icon-wrap::after{right:auto;left:50%}
body.rtl .ac-stat-val em{margin-left:0;margin-right:2px}

/* Scroll reveal */
.ac-rev{opacity:0;transform:translateY(28px);transition:opacity .8s cubic-bezier(.16,1,.3,1),transform .8s cubic-bezier(.16,1,.3,1)}
.ac-rev.vis{opacity:1;transform:none}
.ac-rev.d1{transition-delay:.1s}.ac-rev.d2{transition-delay:.2s}.ac-rev.d3{transition-delay:.3s}.ac-rev.d4{transition-delay:.4s}

/* ──────────── BONUS / DEPOSIT-MATCH ──────────── */
.ac-bonus{position:relative;background:#06080c;padding:96px 24px 100px;overflow:hidden}
.ac-bonus::before{content:'';position:absolute;inset:0;
  background-image:
    radial-gradient(circle at 18% 20%,rgba(200,16,46,.07),transparent 42%),
    radial-gradient(circle at 85% 80%,rgba(20,224,163,.06),transparent 45%);
  pointer-events:none}
.ac-bonus-grid-bg{position:absolute;inset:0;pointer-events:none;
  background-image:
    linear-gradient(rgba(200,16,46,.03) 1px,transparent 1px),
    linear-gradient(90deg,rgba(200,16,46,.03) 1px,transparent 1px);
  background-size:46px 46px;
  mask-image:radial-gradient(ellipse 70% 60% at 50% 40%,black 20%,transparent 80%)}
.ac-bonus-inner{max-width:1080px;margin:0 auto;position:relative;z-index:2}
.ac-bonus-head{text-align:center;max-width:720px;margin:0 auto 14px}
.ac-bonus-badge{display:inline-flex;align-items:center;gap:8px;padding:8px 18px;border-radius:30px;
  font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;margin-bottom:22px;
  color:#C8102E;background:rgba(200,16,46,.08);border:1px solid rgba(200,16,46,.3)}
.ac-bonus-badge::before{content:'';width:7px;height:7px;border-radius:50%;background:#C8102E;
  box-shadow:0 0 8px #C8102E;animation:ac-pulse 2s infinite}
@keyframes ac-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(.8)}}
.ac-bonus-title{font-size:clamp(28px,4.5vw,48px);font-weight:900;color:#fff;line-height:1.1;
  letter-spacing:-.025em;margin-bottom:18px}
.ac-bonus-title em{font-style:normal;background:linear-gradient(135deg,#C8102E,#f5a524);
  -webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}
.ac-bonus-promise{font-size:16px;color:rgba(255,255,255,.62);line-height:1.75;max-width:640px;
  margin:0 auto 52px}
.ac-bonus-promise strong{color:#14e0a3;font-weight:700}

/* Tier cards */
.ac-tiers{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;margin-bottom:40px}
@media(max-width:820px){.ac-tiers{grid-template-columns:1fr;max-width:440px;margin-inline:auto}}
.ac-tier{position:relative;padding:34px 28px;border-radius:22px;background:rgba(255,255,255,.025);
  border:1px solid rgba(255,255,255,.08);overflow:hidden;transition:all .4s cubic-bezier(.16,1,.3,1)}
.ac-tier::before{content:'';position:absolute;top:0;left:0;right:0;height:3px;
  background:var(--tc);transform:scaleX(.25);transform-origin:left;transition:transform .45s}
.ac-tier::after{content:'';position:absolute;top:-40%;right:-30%;width:280px;height:280px;
  background:radial-gradient(circle,var(--tc),transparent 60%);opacity:0;transition:opacity .45s}
.ac-tier:hover{transform:translateY(-6px);border-color:rgba(255,255,255,.16)}
.ac-tier:hover::before{transform:scaleX(1)}
.ac-tier:hover::after{opacity:.08}
.ac-tier.feat{border-color:var(--tc);background:rgba(200,16,46,.04)}
.ac-tier.feat::before{transform:scaleX(1)}
.ac-tier-flag{position:absolute;top:16px;right:16px;font-size:9.5px;font-weight:800;
  letter-spacing:.1em;text-transform:uppercase;padding:5px 11px;border-radius:20px;
  color:var(--tc);background:rgba(255,255,255,.04);border:1px solid var(--tc);z-index:3}
body.rtl .ac-tier-flag{right:auto;left:16px}
.ac-tier-pct{font-size:clamp(48px,7vw,64px);font-weight:900;color:#fff;line-height:1;
  letter-spacing:-.04em;margin-bottom:6px;position:relative;z-index:2;
  background:linear-gradient(135deg,#fff 0%,var(--tc) 130%);-webkit-background-clip:text;
  background-clip:text;-webkit-text-fill-color:transparent}
.ac-tier-pct em{font-style:normal;font-size:.42em;-webkit-text-fill-color:var(--tc);color:var(--tc);
  margin-inline-start:4px;vertical-align:super}
.ac-tier-band{font-size:13px;font-weight:700;color:var(--tc);margin-bottom:18px;letter-spacing:.02em;
  position:relative;z-index:2}
.ac-tier-row{display:flex;justify-content:space-between;align-items:baseline;gap:10px;
  padding:11px 0;border-top:1px dashed rgba(255,255,255,.08);position:relative;z-index:2}
.ac-tier-row:first-of-type{border-top:none}
.ac-tier-k{font-size:12.5px;color:rgba(255,255,255,.5);font-weight:500}
.ac-tier-v{font-size:14px;color:#fff;font-weight:800;font-feature-settings:"tnum"}
.ac-tier-v.acc{color:var(--tc)}

/* Summary note */
.ac-bonus-note{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;
  text-align:center;font-size:13.5px;color:rgba(255,255,255,.45);line-height:1.7;
  max-width:760px;margin:0 auto 40px;padding:18px 24px;border-radius:14px;
  background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.06)}
.ac-bonus-note svg{width:18px;height:18px;stroke:#14e0a3;fill:none;flex-shrink:0}
.ac-bonus-cta{text-align:center}
body.rtl .ac-tier-pct em{margin-inline-start:0;margin-inline-end:4px}
</style>

<article class="ac-page">

<!-- ═════════════════════ HERO ═════════════════════ -->
<section class="ac-hero" id="academy-hero">
  <div class="ac-grid-bg"></div>
  <div class="ac-helix">
    <div class="ac-helix-line"></div>
    <div class="ac-helix-line"></div>
    <div class="ac-helix-line"></div>
    <div class="ac-helix-line"></div>
    <div class="ac-helix-line"></div>
  </div>
  <div class="ac-orb"></div>
  <div class="ac-orb ac-orb-2" style="top:30%;left:25%"></div>
  <div class="ac-orb ac-orb-2" style="top:70%;left:75%"></div>
  <div class="ac-nodes" id="ac-nodes"></div>

  <div class="ac-hero-inner">
    <div class="ac-icon-wrap">
      <svg viewBox="0 0 24 24"><path d="M22 10v6M2 10l10-5 10 5-10 5-10-5z" stroke-width="1.5"/><path d="M6 12v5c0 2.21 2.686 4 6 4s6-1.79 6-4v-5" stroke-width="1.5"/></svg>
    </div>
    <div class="ac-badge"><?php echo $fa?'آکادمی رسمی STB':'OFFICIAL STB ACADEMY';?></div>
    <h1 class="ac-title"><?php echo $fa?'یاد بگیرید. پیشرفت کنید.<br><em>با اطمینان معامله کنید.</em>':'Learn. Improve.<br><em>Trade With Confidence.</em>';?></h1>
    <p class="ac-sub"><?php echo $fa
      ?'پنج دوره ساختاریافته، از مبانی بروکر تا والیوم پیشرفته. مستقیماً در پنل کاربری STB، با گواهینامه، کوییز و آرشیو وبینار — و تا ۱۰۰٪ بونوس روی واریز شما.'
      :'Five structured courses, from broker fundamentals to advanced volume. Delivered inside your STB dashboard with quizzes, certificates and a webinar archive — backed by up to 100% deposit bonus.';?></p>

    <div class="ac-stats">
      <div class="ac-stat" style="--sc:#14e0a3"><div class="ac-stat-val">5</div><div class="ac-stat-lbl"><?php echo $fa?'دوره':'COURSES';?></div></div>
      <div class="ac-stat" style="--sc:#14e0a3"><div class="ac-stat-val">450<em>+</em></div><div class="ac-stat-lbl"><?php echo $fa?'اصطلاح':'TERMS';?></div></div>
      <div class="ac-stat" style="--sc:#C8102E"><div class="ac-stat-val">100<em>%</em></div><div class="ac-stat-lbl"><?php echo $fa?'بونوس واریز':'DEPOSIT BONUS';?></div></div>
      <div class="ac-stat" style="--sc:#14e0a3"><div class="ac-stat-val"><?php echo $fa?'رایگان':'FREE';?></div><div class="ac-stat-lbl"><?php echo $fa?'برای مشتریان':'FOR CLIENTS';?></div></div>
    </div>

    <div class="ac-ctas">
      <a href="#ac-courses" class="ac-btn-primary"><?php echo $fa?'مشاهده دوره‌ها':'Explore Courses';?>
        <svg viewBox="0 0 24 24"><path d="M19 14l-7 7m0 0l-7-7m7 7V3" stroke-width="2" stroke-linecap="round"/></svg></a>
      <a href="#ac-bonus" class="ac-btn-ghost"><?php echo $fa?'بونوس واریز':'Deposit Bonus';?>
        <svg viewBox="0 0 24 24"><path d="M9 5l7 7-7 7" stroke-width="2" stroke-linecap="round"/></svg></a>
    </div>
  </div>

  <a href="#ac-courses" class="ac-scroll-hint">
    <span><?php echo $fa?'پیمایش':'SCROLL';?></span>
    <span class="ac-scroll-line"></span>
  </a>
</section>

<!-- ═════════════════════ COURSE CATALOGUE ═════════════════════ -->
<section class="ac-courses-sec" id="ac-courses">
  <div class="ac-cs-inner">
    <div class="ac-sec-head ac-rev">
      <span class="ac-sec-kicker"><?php echo $fa?'دوره‌های آموزشی':'TRADING CURRICULUM';?></span>
      <h2 class="ac-sec-title"><?php echo $fa?'پنج دوره. <em>یک مسیر.</em>':'Five courses. <em>One path.</em>';?></h2>
      <p class="ac-sec-desc"><?php echo $fa
        ?'از پایه‌ای‌ترین مفاهیم تا متدولوژی‌های حرفه‌ای — هر دوره به‌صورت ویدیویی، با کوییز و گواهینامه در پنل کاربری شما در دسترس است.'
        :'Designed as a single progression from beginner to professional. Each course is delivered as HD video with quizzes and certificates, available inside your STB dashboard.';?></p>
    </div>

    <?php $featured = $courses_data[0]; ?>
    <!-- FEATURED CARD -->
    <div class="ac-feat ac-rev">
      <div class="ac-feat-visual">
        <div class="ac-feat-shape"></div>
        <div class="ac-feat-shape"></div>
        <div class="ac-feat-shape"></div>
        <div class="ac-feat-dots">
          <div class="ac-feat-dot"></div>
          <div class="ac-feat-dot"></div>
          <div class="ac-feat-dot"></div>
          <div class="ac-feat-dot"></div>
          <div class="ac-feat-dot"></div>
        </div>
        <div class="ac-feat-icon">
          <svg viewBox="0 0 24 24" fill="none"><?php echo $featured['icon']; ?></svg>
        </div>
      </div>
      <div class="ac-feat-content">
        <div class="ac-feat-tag">
          <svg viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" stroke-width="2"/></svg>
          <?php echo $fa?'دوره ویژه · شروع کنید':'FEATURED · START HERE';?>
        </div>
        <h3 class="ac-feat-title"><?php echo esc_html($featured['title']); ?></h3>
        <p class="ac-feat-desc"><?php echo esc_html($featured['desc']); ?></p>
        <div class="ac-pills">
          <span class="ac-pill lvl">
            <svg viewBox="0 0 24 24"><path d="M3 3v18h18" stroke-width="2"/><polyline points="7 16 11 10 15 14 19 7" stroke-width="2"/></svg>
            <?php echo esc_html($featured['level']); ?>
          </span>
          <span class="ac-pill">
            <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" stroke-width="2"/><path d="M12 6v6l4 2" stroke-width="2"/></svg>
            <?php echo esc_html($featured['access']); ?>
          </span>
        </div>
        <div class="ac-feat-topics">
          <?php foreach($featured['topics'] as $t): ?>
            <span class="ac-topic"><?php echo esc_html($t); ?></span>
          <?php endforeach; ?>
        </div>
        <a href="<?php echo esc_url($login_url);?>" class="ac-btn-primary"><?php echo $fa?'شروع در پنل':'Start in Dashboard';?>
          <svg viewBox="0 0 24 24"><path d="M5 12h14M12 5l7 7-7 7" stroke-width="2" stroke-linecap="round"/></svg></a>
      </div>
    </div>

    <!-- GRID OF 4 -->
    <div class="ac-grid">
      <?php for($i=1;$i<5;$i++): $c = $courses_data[$i]; $num = sprintf('%02d',$i+1); ?>
      <div class="ac-card ac-rev d<?php echo $i; ?>" style="--cc:<?php echo $c['color']; ?>">
        <div class="ac-card-head">
          <div class="ac-card-icon">
            <svg viewBox="0 0 24 24" fill="none"><?php echo $c['icon']; ?></svg>
          </div>
          <div class="ac-card-num"><?php echo $num; ?></div>
        </div>
        <div class="ac-card-lvl"><?php echo esc_html($c['level']); ?></div>
        <h3 class="ac-card-title"><?php echo esc_html($c['title']); ?></h3>
        <p class="ac-card-desc"><?php echo esc_html($c['desc']); ?></p>
        <div class="ac-card-topics">
          <?php foreach($c['topics'] as $t): ?>
            <span class="ac-card-topic"><?php echo esc_html($t); ?></span>
          <?php endforeach; ?>
        </div>
        <div class="ac-card-foot">
          <div class="ac-card-access"><?php echo esc_html($c['access']); ?></div>
          <a href="<?php echo esc_url($login_url);?>" class="ac-card-cta">
            <?php echo $fa?'مشاهده':'View';?>
            <svg viewBox="0 0 24 24"><path d="M5 12h14M12 5l7 7-7 7" stroke-width="2" stroke-linecap="round"/></svg>
          </a>
        </div>
      </div>
      <?php endfor; ?>
    </div>
  </div>
</section>

<!-- ═════════════════════ BONUS · DEPOSIT MATCH ═════════════════════ -->
<section class="ac-bonus" id="ac-bonus">
  <div class="ac-bonus-grid-bg"></div>
  <div class="ac-bonus-inner">
    <div class="ac-bonus-head ac-rev">
      <span class="ac-bonus-badge"><?php echo $fa?'بونوس واریز':'DEPOSIT BONUS';?></span>
      <h2 class="ac-bonus-title"><?php echo $fa
        ?'هر چقدر بگذارید، <em>ما هم می‌گذاریم</em>'
        :'However much you put in, <em>we match it</em>';?></h2>
      <p class="ac-bonus-promise"><?php echo $fa
        ?'آنقدر به آموزش‌هایمان <strong>اطمینان</strong> داریم که حاضریم پای آن سرمایه‌گذاری کنیم. روی واریز شما تا <strong>۱۰۰٪</strong> بونوس می‌گذاریم — تا سقف <strong>۵٬۰۰۰ دلار</strong>. هرچه بیشتر باور داشته باشید، ما بیشتر کنارتان هستیم.'
        :'We are so <strong>confident</strong> in our education that we are willing to back it with our own capital. We match your deposit with up to <strong>100% bonus</strong> — up to a <strong>$5,000</strong> cap. The more you commit, the more we stand beside you.';?></p>
    </div>

    <div class="ac-tiers">
      <!-- Tier 1 -->
      <div class="ac-tier feat ac-rev d1" style="--tc:#14e0a3">
        <span class="ac-tier-flag"><?php echo $fa?'بهترین نرخ':'BEST RATE';?></span>
        <div class="ac-tier-pct">100<em>%</em></div>
        <div class="ac-tier-band"><?php echo $fa?'واریز تا ۴۰۰ دلار':'Deposits up to $400';?></div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'نرخ بونوس':'Bonus rate';?></span>
          <span class="ac-tier-v acc"><?php echo $fa?'۱۰۰٪':'100%';?></span>
        </div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'دامنه واریز':'Deposit range';?></span>
          <span class="ac-tier-v"><?php echo $fa?'$۱ – $۴۰۰':'$1 – $400';?></span>
        </div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'حداکثر بونوس':'Max bonus';?></span>
          <span class="ac-tier-v"><?php echo $fa?'$۴۰۰':'$400';?></span>
        </div>
      </div>
      <!-- Tier 2 -->
      <div class="ac-tier ac-rev d2" style="--tc:#f5a524">
        <div class="ac-tier-pct">50<em>%</em></div>
        <div class="ac-tier-band"><?php echo $fa?'واریز تا ۲٬۰۰۰ دلار':'Deposits up to $2,000';?></div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'نرخ بونوس':'Bonus rate';?></span>
          <span class="ac-tier-v acc"><?php echo $fa?'۵۰٪':'50%';?></span>
        </div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'دامنه واریز':'Deposit range';?></span>
          <span class="ac-tier-v"><?php echo $fa?'$۴۰۱ – $۲٬۰۰۰':'$401 – $2,000';?></span>
        </div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'حداکثر بونوس':'Max bonus';?></span>
          <span class="ac-tier-v"><?php echo $fa?'$۱٬۰۰۰':'$1,000';?></span>
        </div>
      </div>
      <!-- Tier 3 -->
      <div class="ac-tier ac-rev d3" style="--tc:#C8102E">
        <div class="ac-tier-pct">35<em>%</em></div>
        <div class="ac-tier-band"><?php echo $fa?'واریز بالای ۲٬۰۰۰ دلار':'Deposits above $2,000';?></div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'نرخ بونوس':'Bonus rate';?></span>
          <span class="ac-tier-v acc"><?php echo $fa?'۳۵٪':'35%';?></span>
        </div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'دامنه واریز':'Deposit range';?></span>
          <span class="ac-tier-v"><?php echo $fa?'$۲٬۰۰۱ به بالا':'$2,001 and above';?></span>
        </div>
        <div class="ac-tier-row">
          <span class="ac-tier-k"><?php echo $fa?'سقف بونوس':'Bonus cap';?></span>
          <span class="ac-tier-v"><?php echo $fa?'تا $۵٬۰۰۰':'Up to $5,000';?></span>
        </div>
      </div>
    </div>

    <div class="ac-bonus-note ac-rev">
      <svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" stroke-width="2"/><path d="M12 16v-4M12 8h.01" stroke-width="2" stroke-linecap="round"/></svg>
      <span><?php echo $fa
        ?'حداکثر بونوس قابل دریافت ۵٬۰۰۰ دلار است. نرخ بونوس بر اساس مبلغ هر واریز و طبق شرایط و ضوابط برنامه اعمال می‌شود.'
        :'Maximum receivable bonus is $5,000. The bonus rate applies per deposit amount and is subject to the program terms and conditions.';?></span>
    </div>

    <div class="ac-bonus-cta ac-rev d1">
      <a href="<?php echo esc_url($register_url);?>" class="ac-btn-primary"><?php echo $fa?'دریافت بونوس':'Claim Your Bonus';?>
        <svg viewBox="0 0 24 24"><path d="M5 12h14M12 5l7 7-7 7" stroke-width="2" stroke-linecap="round"/></svg></a>
    </div>
  </div>
</section>

<!-- ═════════════════════ HOW IT WORKS ═════════════════════ -->
<section class="ac-how">
  <div class="ac-how-inner">
    <div class="ac-sec-head ac-rev">
      <span class="ac-sec-kicker"><?php echo $fa?'مسیر یادگیری':'HOW IT WORKS';?></span>
      <h2 class="ac-sec-title"><?php echo $fa?'سه قدم تا <em>اولین گواهینامه</em>':'Three steps to your <em>first certificate</em>';?></h2>
    </div>
    <div class="ac-steps">
      <div class="ac-step ac-rev d1">
        <div class="ac-step-num">01
          <div class="ac-step-icon">
            <svg viewBox="0 0 24 24"><path d="M16 21v-2a4 4 0 00-4-4H6a4 4 0 00-4 4v2" stroke-width="2"/><circle cx="9" cy="7" r="4" stroke-width="2"/><path d="M20 8v6M23 11h-6" stroke-width="2"/></svg>
          </div>
        </div>
        <h3 class="ac-step-title"><?php echo $fa?'افتتاح حساب':'Open Account';?></h3>
        <p class="ac-step-desc"><?php echo $fa?'یک حساب در STB افتتاح کنید و فرآیند احراز هویت را تکمیل نمایید.':'Open an STB account and complete the KYC verification process.';?></p>
      </div>
      <div class="ac-step ac-rev d2">
        <div class="ac-step-num">02
          <div class="ac-step-icon">
            <svg viewBox="0 0 24 24"><path d="M22 10v6M2 10l10-5 10 5-10 5-10-5z" stroke-width="2"/><path d="M6 12v5c0 2.21 2.686 4 6 4s6-1.79 6-4v-5" stroke-width="2"/></svg>
          </div>
        </div>
        <h3 class="ac-step-title"><?php echo $fa?'انتخاب دوره':'Pick a Course';?></h3>
        <p class="ac-step-desc"><?php echo $fa?'از منوی Marketplace در پنل کاربری، دوره متناسب با سطح خود را انتخاب کنید.':'Choose the course that matches your level from the Marketplace menu inside your dashboard.';?></p>
      </div>
      <div class="ac-step ac-rev d3">
        <div class="ac-step-num">03
          <div class="ac-step-icon">
            <svg viewBox="0 0 24 24"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" stroke-width="2"/></svg>
          </div>
        </div>
        <h3 class="ac-step-title"><?php echo $fa?'یاد بگیرید و معامله کنید':'Learn & Trade';?></h3>
        <p class="ac-step-desc"><?php echo $fa?'ویدیوها را تماشا کنید، در کوییزها شرکت کنید و گواهینامه دریافت کنید. سپس با اطمینان معامله کنید.':'Watch the video lessons, take the quizzes, earn your certificate — then trade with confidence.';?></p>
      </div>
    </div>
  </div>
</section>

<!-- ═════════════════════ ENCYCLOPEDIA STRIP ═════════════════════ -->
<section class="ac-enc">
  <div class="ac-enc-inner">
    <div class="ac-enc-grid">
      <div class="ac-enc-left ac-rev">
        <span class="ac-sec-kicker"><?php echo $fa?'دانشنامه STB':'STB ENCYCLOPEDIA';?></span>
        <div class="ac-enc-counter">450<em>+</em></div>
        <div class="ac-enc-lbl"><?php echo $fa?'اصطلاح معاملاتی':'TRADING TERMS';?></div>
        <p class="ac-enc-desc"><?php echo $fa
          ?'دانشنامه‌ای جامع از اصطلاحات بازارهای مالی — هر اصطلاح با تعریف دقیق، مثال‌های کاربردی و توضیحات مرتبط با MT5. مرجع کامل معامله‌گران.'
          :'A complete A–Z reference of financial-market terminology. Every term carries a precise definition, practical examples and MT5-specific context.';?></p>
        <a href="<?php echo $B;?>/encyclopedia/" class="ac-btn-ghost" style="margin-top:8px">
          <?php echo $fa?'مشاهده دانشنامه':'Browse Encyclopedia';?>
          <svg viewBox="0 0 24 24"><path d="M5 12h14M12 5l7 7-7 7" stroke-width="2" stroke-linecap="round"/></svg>
        </a>
      </div>
      <div class="ac-enc-right ac-rev d1">
        <div class="ac-enc-terms">
          <?php
          $sample = $fa ? [
            ['اسپرد','بازار'],['اهرم','حساب'],['پیپ','قیمت'],
            ['مارجین','حساب'],['RSI','اندیکاتور'],['MACD','اندیکاتور'],
          ] : [
            ['Spread','MARKET'],['Leverage','ACCOUNT'],['Pip','PRICE'],
            ['Margin','ACCOUNT'],['RSI','INDICATOR'],['MACD','INDICATOR'],
          ];
          foreach($sample as $s): ?>
          <a href="<?php echo $B;?>/encyclopedia/" class="ac-term">
            <div class="ac-term-name"><?php echo esc_html($s[0]); ?></div>
            <div class="ac-term-cat"><?php echo esc_html($s[1]); ?></div>
          </a>
          <?php endforeach; ?>
        </div>
      </div>
    </div>
  </div>
</section>

<!-- ═════════════════════ FINAL CTA ═════════════════════ -->
<section class="ac-cta-sec">
  <div class="ac-cta-inner">
    <h2 class="ac-cta-title ac-rev"><?php echo $fa?'آماده‌اید <em>شروع کنید</em>؟':'Ready to <em>start learning</em>?';?></h2>
    <p class="ac-cta-desc ac-rev d1"><?php echo $fa
      ?'یک حساب STB افتتاح کنید و در کمتر از پنج دقیقه به اولین دوره خود دسترسی پیدا کنید. کاملاً رایگان برای دوره مقدماتی.'
      :'Open an STB account and unlock your first course in under five minutes. The starter course is completely free.';?></p>
    <div class="ac-ctas ac-rev d2">
      <a href="<?php echo esc_url($register_url);?>" class="ac-btn-primary"><?php echo $fa?'ثبت‌نام رایگان':'Open Free Account';?>
        <svg viewBox="0 0 24 24"><path d="M12 5v14M5 12h14" stroke-width="2" stroke-linecap="round"/></svg></a>
      <a href="<?php echo esc_url($login_url);?>" class="ac-btn-ghost"><?php echo $fa?'ورود به پنل':'Open Dashboard';?>
        <svg viewBox="0 0 24 24"><path d="M9 5l7 7-7 7" stroke-width="2" stroke-linecap="round"/></svg></a>
    </div>
  </div>
</section>

</article>

<script>
(function(){
  /* ─── Floating knowledge nodes in hero ─── */
  var nd = document.getElementById('ac-nodes');
  if(nd){
    var syms = ['Σ','π','Δ','∞','λ','φ','α','β','$','€','¥','₿','%','+','×'];
    for(var i=0;i<12;i++){
      var n = document.createElement('div');
      n.className = 'ac-node';
      var size = 22 + Math.random()*28;
      var green = Math.random()>.5;
      n.style.cssText = 'left:'+Math.random()*92+'%;top:'+Math.random()*88+'%;'
        +'width:'+size+'px;height:'+size+'px;'
        +'background:rgba('+(green?'20,224,163':'200,16,46')+',0.04);'
        +'border:1px solid rgba('+(green?'20,224,163':'200,16,46')+',0.10);'
        +'--dx:'+(Math.random()*30-15)+'px;'
        +'--dy:'+(Math.random()*30-15)+'px;'
        +'animation-duration:'+(5+Math.random()*8)+'s;'
        +'animation-delay:'+(-Math.random()*5)+'s;';
      n.textContent = syms[i % syms.length];
      nd.appendChild(n);
    }
  }

  /* ─── Scroll reveal ─── */
  var obs = new IntersectionObserver(function(entries){
    entries.forEach(function(en){
      if(en.isIntersecting){
        en.target.classList.add('vis');
        obs.unobserve(en.target);
      }
    });
  },{threshold:0,rootMargin:"0px 0px -10% 0px"});
  document.querySelectorAll('.ac-rev').forEach(function(el){ obs.observe(el); });
  /* Safety net: reveal any straggler after 1.5s (handles headless/PrefersReducedMotion/blocked observers) */
  setTimeout(function(){ document.querySelectorAll(".ac-rev:not(.vis)").forEach(function(el){el.classList.add("vis");}); }, 600);

  /* ─── Smooth scroll for in-page anchors ─── */
  document.querySelectorAll('a[href^="#"]').forEach(function(a){
    a.addEventListener('click', function(e){
      var id = a.getAttribute('href');
      if(id.length < 2) return;
      var t = document.querySelector(id);
      if(t){
        e.preventDefault();
        t.scrollIntoView({behavior:'smooth',block:'start'});
      }
    });
  });
})();
</script>
