/* GCCReady — Pillar certification pages.
 * Deep, AEO/SEO-optimised pages for US CPA, EA, CFA, ACCA.
 * (US CMA has its own dedicated cohort page in Other.jsx — see CMAPage.)
 */

const CERT_PILLAR = {
  'us-cpa': {
    name: 'US CPA',
    tier: 'Live',
    tagline: 'The global gold standard for audit, tax, and US-GAAP roles.',
    hero_sub: 'US CPA is the globally portable accounting credential that opens doors to Big 4 GDS, US accounting GCCs, and global audit/tax functions. We prepare you end-to-end — eligibility evaluation, exam prep, mock interviews, and named-employer placement support.',
    timeline: '12–24 months',
    cost: '₹3.5 – 5 lakhs',
    parts: '4 sections (FAR · AUD · REG · Discipline)',
    eligibility: '120+ credit hours; 150 for licensure in most states',
    issuer: 'AICPA / NASBA',
    who_for: [
      'CA / CA-Inter students seeking faster global mobility than full ICAI route',
      'B.Com / M.Com graduates targeting Big 4 GDS (Deloitte / EY / KPMG / PwC)',
      'MBA finance students who want a tactical credential alongside their degree',
      'Working professionals in finance ops or audit looking to break into US accounting GCCs',
    ],
    syllabus: [
      { name:'FAR — Financial Accounting & Reporting', topics:['US GAAP financial statements','Conceptual framework','Standard-setting process','Financial reporting','Select transactions (leases, pensions, equity)','Governmental & not-for-profit'], pass_rate:'~43% (lowest of 4)' },
      { name:'AUD — Auditing & Attestation', topics:['Engagement acceptance','Risk assessment','Internal controls','Audit evidence','Reporting','Professional responsibilities','PCAOB & SEC standards'], pass_rate:'~48%' },
      { name:'REG — Regulation', topics:['Federal taxation (individual + entity)','Business law','Ethics & professional responsibilities','Federal tax procedures','Property transactions'], pass_rate:'~58%' },
      { name:'Discipline (pick one)', topics:['BAR — Business Analysis & Reporting','ISC — Information Systems & Controls','TCP — Tax Compliance & Planning'], pass_rate:'~50% avg across BAR/ISC/TCP' },
    ],
    fees_breakdown: [
      ['Application + evaluation (NASBA + state board)', '₹35,000 – 50,000'],
      ['Exam fees (4 sections × ~$240 + intl. testing fee)', '₹1.25 – 1.5 L'],
      ['Review course (Becker / Wiley / Roger)', '₹1.0 – 3.0 L'],
      ['Books, Prometric, miscellaneous', '₹15,000 – 30,000'],
      ['Bridge programme (if credit gap)', '₹50,000 – 1.5 L'],
    ],
    salary: [
      { stage:'Entry (Big 4 GDS)',   bengaluru:'₹6.5–9 L',  hyderabad:'₹6.0–8.5 L', mumbai:'₹7.0–10 L' },
      { stage:'3–5 yrs (Senior)',     bengaluru:'₹14–22 L', hyderabad:'₹12–20 L',   mumbai:'₹16–25 L' },
      { stage:'7+ yrs (Manager)',     bengaluru:'₹28–45 L', hyderabad:'₹25–40 L',   mumbai:'₹32–55 L' },
    ],
    gccs: ['deloitte','ey','kpmg','pwc','jpmorganchase','wellsfargo','citi','bankofamerica','walmart','amazon'],
    roles: ['fa-ops','audit-sox','tax','fpa'],
    article_topic: 'US CPA',
    faq: [
      { q:'Can a B.Com graduate take US CPA from India?', a:'Yes. B.Com gives 90–105 credit hours in most Indian universities. You need 120 to sit for the exam (states like Montana, Alaska, Guam accept this). For licensure in most states, you need 150 credits — typically achieved via M.Com or a bridge programme.' },
      { q:'How long does US CPA take from India?', a:'Typical timeline is 12–24 months: 2–4 months for eligibility evaluation and registration, 12–18 months for exam prep across 4 sections, plus 2–3 months between sections to consolidate.' },
      { q:'How much does US CPA cost in India in total?', a:'Total all-in: ₹3.5 – 5 lakhs. This includes evaluation (₹35–50K), 4 exam fees (₹1.25–1.5L), review course (₹1–3L), plus books and miscellaneous. Bridge programmes add ₹50K–1.5L if needed.' },
      { q:'Is US CPA worth it after CA?', a:'Strongly yes for CA-qualified professionals targeting Big 4 GDS, US accounting GCCs, or international roles. CPA + CA stack opens senior controllers, US tax, and cross-border advisory roles. Average salary uplift: ₹6–12L within 2–3 years.' },
      { q:'CPA vs CMA — which is better for India GCCs?', a:'CPA suits audit / US tax / controllership and Big 4 GDS roles. CMA suits FP&A and finance operations across cross-industry GCCs (Amazon, Microsoft, Walmart, etc.). CMA is faster (8–12 months vs 12–24) and cheaper (₹1.5–2L vs ₹3–5L). Pick based on target role.' },
      { q:'Which US state should I register in?', a:'For exam-only: Montana, Alaska, Guam (120-credit). For licensure with India experience: California, Illinois, Colorado (accept Indian CA experience). For Big 4 GDS: New York or Delaware (where Big 4 entities are commonly registered). We recommend specific states based on your degree + career target.' },
      { q:'Can I take US CPA exams from India?', a:'Yes. Prometric centres in Bengaluru, Hyderabad, Mumbai, Delhi, Chennai, Kolkata, Ahmedabad and Trivandrum offer US CPA exams continuously throughout the year (with brief blackout windows around quarter-ends).' },
      { q:'What is the pass rate for US CPA?', a:'Global pass rates: FAR ~43% (lowest), AUD ~48%, REG ~58%, Discipline (BAR/ISC/TCP) ~50%. Indian candidates often outperform global averages with structured prep — GCCReady cohorts average 65–75% first-attempt rates across sections.' },
      { q:'Do GCCs in India hire US CPA freshers?', a:'Yes, especially Big 4 GDS (Deloitte USI, EY GDS, KPMG GDC, PwC AC) and US-headquartered finance GCCs (Wells Fargo, Bank of America, JP Morgan, Citi). Entry CTC ₹6.5–10L for fresh CPAs, scaling to ₹14–22L by year 3–5.' },
      { q:'Is the CPA exam being changed in 2026?', a:'CPA Evolution rolled out from January 2024: 3 core sections (FAR, AUD, REG) + 1 of 3 disciplines (BAR / ISC / TCP). The change reflects modern accountant skills — data analytics, tech, advisory. The 2026 CPA exam follows this format.' },
    ],
  },

  'ea': {
    name: 'EA (Enrolled Agent)',
    tier: 'Live',
    tagline: 'India\'s fastest US-tax credential. Federally licensed by the IRS.',
    hero_sub: 'EA is the only credential authorised by the US Treasury to represent taxpayers before all administrative levels of the IRS. For Indian professionals, it is the fastest route to US tax practice — no degree required, 3 exam parts, completable in 4–8 months.',
    timeline: '4–8 months',
    cost: '₹70,000 – 1 lakh',
    parts: '3 SEE parts (Individuals · Businesses · Representation)',
    eligibility: 'No degree requirement; 18+',
    issuer: 'IRS (US Internal Revenue Service)',
    who_for: [
      'CA / CMA / B.Com graduates targeting US-tax-focused GCC roles (Big 4 GDS tax)',
      'Working professionals in tax / accounting wanting a faster, cheaper US credential than CPA',
      'Anyone serving US clients in tax preparation / advisory practice',
      'Those who want to add US-tax representation rights to their practice',
    ],
    syllabus: [
      { name:'Part 1 — Individuals', topics:['Filing requirements & filing status','Income & assets','Deductions & credits','Taxation & advice (estate, gift, retirement)','Specialised returns'], pass_rate:'~70%' },
      { name:'Part 2 — Businesses', topics:['Business entities (sole prop / partnership / corp / S-corp)','Business income, expenses, basis','Specialised returns (estates, trusts, exempts)','Property transactions','Retirement plans'], pass_rate:'~62%' },
      { name:'Part 3 — Representation, Practices & Procedures', topics:['Practitioner rights & responsibilities','Power of attorney','Audit & appeals','Collection process','Penalties & interest'], pass_rate:'~80%' },
    ],
    fees_breakdown: [
      ['SEE exam fees (3 parts × $259)', '₹65,000'],
      ['PTIN application + IRS enrolment', '₹5,000'],
      ['Review course (Gleim / Surgent)', '₹15,000 – 35,000'],
      ['Books + practice tests', '₹5,000 – 10,000'],
    ],
    salary: [
      { stage:'Entry (Big 4 GDS Tax)', bengaluru:'₹4.5–7 L',  hyderabad:'₹4–6.5 L', mumbai:'₹5–8 L' },
      { stage:'3 yrs (Sr. Tax Analyst)', bengaluru:'₹9–15 L',   hyderabad:'₹8–13 L',   mumbai:'₹10–18 L' },
      { stage:'5+ yrs (Tax Lead)',       bengaluru:'₹18–28 L',  hyderabad:'₹16–25 L',  mumbai:'₹20–32 L' },
    ],
    gccs: ['deloitte','ey','kpmg','pwc','jpmorganchase','amazon','microsoft','walmart'],
    roles: ['tax','fa-ops'],
    article_topic: 'EA',
    faq: [
      { q:'What is an Enrolled Agent (EA)?', a:'An Enrolled Agent is a federally licensed tax practitioner authorised by the IRS to represent taxpayers before the IRS for tax issues including audits, collections, and appeals. It is the highest credential the IRS awards.' },
      { q:'Do I need a degree to become an EA?', a:'No. The EA is one of the only US professional credentials with no degree requirement. You need to pass the 3-part Special Enrolment Examination (SEE), apply to the IRS for enrolment, and pass a tax-compliance background check.' },
      { q:'How long does it take to clear EA from India?', a:'Most candidates clear all 3 parts in 4–8 months with structured prep. Each part typically requires 80–120 hours of study; the parts are independent so you can take them in any order.' },
      { q:'How much does EA cost in India?', a:'All-in: ₹70,000 – 1 lakh. SEE exam fees (₹65K for 3 parts), IRS enrolment + PTIN (₹5K), review course (₹15–35K).' },
      { q:'EA vs CPA — which is better for US tax roles?', a:'EA is faster, cheaper, and tax-only. CPA is broader (audit + tax + advisory) and globally recognised. For Big 4 GDS tax teams or pure US-tax practice, EA is sufficient and faster. For senior tax/advisory roles, CPA is preferred. Many professionals pursue EA first, then add CPA.' },
      { q:'Can I take EA exams from India?', a:'Yes. Prometric centres across India (Bengaluru, Hyderabad, Mumbai, Delhi, Chennai, etc.) offer the SEE. Testing window is May–Feb each year; March–April is the IRS update blackout.' },
      { q:'Which GCCs hire EAs?', a:'Big 4 GDS tax teams (Deloitte USI, EY GDS, KPMG GDC, PwC AC) are the largest EA employers in India. Also: large MNC corporate tax teams (Amazon, Microsoft, Walmart, JP Morgan) and US-headquartered tax-prep firms (H&R Block, BDO).' },
      { q:'What is the EA salary in India?', a:'Entry: ₹4.5–7 L at Big 4 GDS. Mid-career (3 yrs): ₹9–15 L. Senior (5+ yrs): ₹18–28 L for Tax Leads. With CPA stack on top, ceiling rises another 30–50%.' },
    ],
  },

  'cfa': {
    name: 'CFA',
    tier: 'Live',
    tagline: 'Gold standard for investment, research, risk, and portfolio roles.',
    hero_sub: 'CFA is the world\'s most respected investment management credential. For India professionals, it is the entry ticket to buy-side / sell-side research, risk management, portfolio management, and treasury roles at top BFSI GCCs — Goldman Sachs, Morgan Stanley, BlackRock, JP Morgan.',
    timeline: 'Level I in 6 mo · Charter in 2.5–4 yrs',
    cost: '₹3 – 4 lakhs (all 3 levels)',
    parts: '3 levels (Foundations · Valuation · Portfolio Management)',
    eligibility: 'Final-year UG / any bachelor\'s; 4,000 hr work for charter',
    issuer: 'CFA Institute',
    who_for: [
      'Final-year UG students in commerce / finance / economics targeting research / risk roles',
      'CA / CMA / MBA finance graduates building toward portfolio management or buy-side',
      'Working professionals in investment banking, equity research, asset management',
      'Risk professionals seeking quant / model risk advancement',
    ],
    syllabus: [
      { name:'Level I — Foundations', topics:['Quantitative methods','Economics','Financial reporting & analysis','Corporate issuers','Equity investments','Fixed income','Derivatives','Alternative investments','Portfolio management','Ethics'], pass_rate:'~37–42%' },
      { name:'Level II — Asset Valuation', topics:['Same 10 topics, but applied — equity valuation, fixed-income valuation, derivative pricing, alternative analysis. Item-set format (vignettes).'], pass_rate:'~45–50%' },
      { name:'Level III — Portfolio Management', topics:['Portfolio construction','IPS (Investment Policy Statement)','Asset allocation','Equity & fixed-income strategy','Risk management & derivative strategies','Wealth management','Constructed-response + vignettes'], pass_rate:'~50–55%' },
    ],
    fees_breakdown: [
      ['One-time enrolment fee (CFA Institute)', '₹35,000'],
      ['Level I exam fee (early / standard)', '₹70,000 – 1 L'],
      ['Level II exam fee', '₹85,000 – 1.1 L'],
      ['Level III exam fee', '₹85,000 – 1.1 L'],
      ['Prep provider (Schweser / Wiley / Bloomberg)', '₹40,000 – 60,000 / level'],
    ],
    salary: [
      { stage:'Entry (CFA L2 cleared)',   bengaluru:'₹8–14 L',   hyderabad:'₹7–12 L',  mumbai:'₹10–18 L' },
      { stage:'Charterholder, 3 yrs',     bengaluru:'₹18–32 L',  hyderabad:'₹16–28 L', mumbai:'₹22–40 L' },
      { stage:'Charterholder, 7+ yrs',    bengaluru:'₹40–80 L',  hyderabad:'₹35–70 L', mumbai:'₹50–100 L+' },
    ],
    gccs: ['goldmansachs','morganstanley','jpmorganchase','blackrock','fidelity','statestreet','db','citi'],
    roles: ['equity-research','risk','fpa'],
    article_topic: 'CFA',
    faq: [
      { q:'What is CFA and who awards it?', a:'CFA (Chartered Financial Analyst) is a globally recognised credential awarded by the CFA Institute (US). It is the gold standard for investment professionals — research analysts, portfolio managers, risk managers, treasury, and asset managers.' },
      { q:'Can I take CFA Level I in my final year of college?', a:'Yes. CFA Institute requires you to be in the final 23 months before graduation, OR have a bachelor\'s degree, OR have 4,000+ hours of work experience by registration. Most India students start in their final year.' },
      { q:'How long does CFA take from India?', a:'Level I: 6 months prep on average. Level II: 6–8 months. Level III: 6 months. Plus mandatory 4,000 hours of relevant work experience for the charter. Total to charter: typically 2.5–4 years.' },
      { q:'How much does CFA cost in total?', a:'All-in for the 3 levels: ₹3 – 4 lakhs. This includes one-time enrolment (₹35K), 3 exam fees (₹70K–1.1L each at standard timing), and prep providers (₹40–60K per level). Costs increase if you re-take any level.' },
      { q:'Which GCCs hire CFA charterholders in India?', a:'Top buy-side / sell-side: Goldman Sachs, Morgan Stanley, JP Morgan, BlackRock, Fidelity, State Street. Plus knowledge centres: McKinsey Knowledge, BCG India X, Bain CTS. Plus Indian asset managers and PE/VC funds.' },
      { q:'CFA vs CA — which is better?', a:'They serve different careers. CA is broader (audit, tax, accounting, finance — practitioner). CFA is investment-focused (research, risk, portfolio — buy/sell-side). Many professionals stack CA + CFA for senior valuation, deal advisory, and portfolio roles.' },
      { q:'CFA vs MBA?', a:'CFA is cheaper (₹3–4L vs ₹15–40L), purely finance-focused, and adds depth. MBA is broader (general management) and adds breadth + network. For investment roles specifically, CFA is preferred. For consulting / general management, MBA is preferred. Top professionals do both.' },
      { q:'What is the CFA pass rate?', a:'Approximate global rates: Level I 37–42%, Level II 45–50%, Level III 50–55%. Indian candidates with structured prep (Schweser + question banks + mocks) often achieve 55–70% on first attempt.' },
      { q:'Can I clear CFA Level I while working full-time?', a:'Yes. CFA Institute estimates 300+ study hours per level. Working professionals typically allocate 12–15 hrs/week over 5–6 months. Expect to give up most weekends in the final 8 weeks.' },
    ],
  },

  'acca': {
    name: 'ACCA',
    tier: 'Upcoming',
    tagline: 'UK / Middle East finance track. Globally portable.',
    hero_sub: 'ACCA is the UK\'s leading global accounting credential, recognised in 180+ countries. For Indian students, it offers global mobility and significant exemptions if you have BCom / CA. ACCA-qualified professionals are in high demand at Big 4, UK-headquartered banks (HSBC, StanChart), and Middle East GCCs.',
    timeline: '1.5 – 3 years (with exemptions)',
    cost: '₹2 – 3 lakhs',
    parts: 'Up to 13 papers (with up to 9 exemptions for CA / 4 for BCom)',
    eligibility: '12th-pass (with FIA route) or BCom / BBA / CA',
    issuer: 'ACCA (Association of Chartered Certified Accountants), UK',
    who_for: [
      '12th-pass students wanting an early start on a global accounting credential',
      'BCom / BBA / MCom graduates targeting UK or ME finance roles',
      'CA / CA-Inter holders looking for global portability with significant exemptions',
      'Working professionals at MNCs / GCCs wanting a globally recognised qualification',
    ],
    syllabus: [
      { name:'Applied Knowledge (3 papers)', topics:['Business & Technology (BT)','Management Accounting (MA)','Financial Accounting (FA)'], pass_rate:'~70–80%' },
      { name:'Applied Skills (6 papers)', topics:['Corporate & Business Law (LW)','Performance Management (PM)','Taxation (TX)','Financial Reporting (FR)','Audit & Assurance (AA)','Financial Management (FM)'], pass_rate:'~45–55%' },
      { name:'Strategic Professional (4 papers — 2 essential + 2 of 4 options)', topics:['Strategic Business Leader (SBL)','Strategic Business Reporting (SBR)','Options: Advanced Financial Mgmt / Performance Mgmt / Taxation / Audit'], pass_rate:'~40–50%' },
    ],
    fees_breakdown: [
      ['Initial registration', '₹4,500'],
      ['Annual subscription (× years to charter)', '₹12,000 / year'],
      ['Exam fees (per paper, standard timing)', '₹14,000 – 25,000'],
      ['Tuition + materials (per paper)', '₹12,000 – 20,000'],
      ['Practical Experience Requirement (PER) — recorded via employer', 'No fee'],
    ],
    salary: [
      { stage:'Affiliate (papers cleared, no PER)', bengaluru:'₹4.5–7 L',  hyderabad:'₹4–6.5 L', mumbai:'₹5–8 L' },
      { stage:'Member (3 yrs PER complete)',         bengaluru:'₹10–18 L', hyderabad:'₹9–16 L',  mumbai:'₹12–22 L' },
      { stage:'Senior, 7+ yrs',                      bengaluru:'₹22–40 L', hyderabad:'₹20–35 L', mumbai:'₹26–50 L' },
    ],
    gccs: ['hsbc','sc','ey','kpmg','pwc','db'],
    roles: ['fa-ops','fpa','audit-sox','tax'],
    article_topic: 'ACCA',
    faq: [
      { q:'What is ACCA?', a:'ACCA (Association of Chartered Certified Accountants) is the UK\'s globally recognised accounting credential. ACCA members work in 180+ countries across audit, tax, finance, and management accounting roles.' },
      { q:'How many ACCA exemptions does a B.Com get?', a:'BCom from a UGC-recognised university typically earns exemptions from F1–F3 (Applied Knowledge level). Some BCom programmes also earn an LW (Corporate & Business Law) exemption. Always check the ACCA Exemptions Database for your specific university.' },
      { q:'How many ACCA exemptions does a CA get?', a:'ICAI CA holders get up to 9 exemptions (F1–F9) under the ACCA-ICAI MoU. You only need to clear the 4 Strategic Professional papers (SBL + SBR + 2 options). This route saves 1–2 years.' },
      { q:'How long does ACCA take from India?', a:'BCom + ACCA: 1.5–2.5 years. CA + ACCA: 6–18 months. 12th-pass via FIA route: 3–4 years to ACCA membership. PER (Practical Experience Requirement) of 36 months runs in parallel.' },
      { q:'How much does ACCA cost from India?', a:'All-in for full path (no exemptions): ₹2.5 – 3 lakhs over the duration. With CA exemptions: ₹1.2 – 1.5 lakhs. Includes registration, annual subs, exam fees, tuition.' },
      { q:'ACCA vs CA — which is better in India?', a:'CA gives signing rights (statutory audit) in India. ACCA does NOT give signing rights in India. ACCA gives global mobility (UK, Middle East, Singapore, Australia) and is faster + cheaper. For India practice: CA. For global mobility: ACCA. For both: do CA + ACCA via the MoU.' },
      { q:'Which GCCs hire ACCA members in India?', a:'UK-headquartered: HSBC, Standard Chartered, Barclays, Lloyds, Aviva. Big 4 GDS: Deloitte, EY GDS, KPMG GDC, PwC AC. ME-aligned: Emirates NBD, ADCB India operations. Plus MNC corporate finance teams across all sectors.' },
      { q:'When will GCCReady\'s ACCA programme launch?', a:'ACCA programme is upcoming. Join the waitlist on the GCCReady site to get early-access pricing and the cohort calendar. Existing CMA / CPA / EA / CFA programmes are live.' },
    ],
  },
};

function pillarSchemaCourse(slug, c) {
  return {
    '@context':'https://schema.org','@type':'Course',
    'name': c.name + ' — GCCReady Pathway',
    'description': c.tagline + ' ' + c.hero_sub,
    'provider': { '@type':'Organization', 'name':'GCCReady', 'url':'https://gccready.com' },
    'educationalCredentialAwarded': c.name,
    'url': `https://gccready.com/certifications/${slug}`,
    'hasCourseInstance': { '@type':'CourseInstance', 'courseMode':'Online','courseWorkload':'PT500H' },
    'offers': { '@type':'Offer','priceCurrency':'INR','description': c.cost },
  };
}

function PillarCertPage({ slug }) {
  const c = CERT_PILLAR[slug];
  if (!c) return null;
  const isUpcoming = c.tier === 'Upcoming';

  // Pull related employers + roles + articles
  const employers = c.gccs.map((s) => GR_EMPLOYERS[s]).filter(Boolean).slice(0, 8);
  const roles = c.roles.map((s) => GR_ROLES.find((r) => r.slug === s)).filter(Boolean);
  const [articles, setArticles] = React.useState([]);
  React.useEffect(() => {
    fetch('./articles.json').then((r) => r.json()).then((m) => {
      const all = (m.articles || []).filter((a) => (a.topic || '').includes(c.article_topic));
      setArticles(all.slice(0, 6));
    }).catch(() => {});
  }, [slug]);

  return (
    <>
      <PageHead
        title={`${c.name} from India — Eligibility, Fees, Salary, GCCs Hiring`}
        description={`Complete ${c.name} pathway for Indians: ${c.timeline} timeline · ${c.cost} cost · ${c.parts}. Plus salary signals, named GCCs hiring, role pods, and ${articles.length}+ deep-dive articles.`}
        canonical={`/certifications/${slug}`}
        schema={[
          pillarSchemaCourse(slug, c),
          schemaFAQ(c.faq),
          schemaBreadcrumb([
            {label:'Home',href:'/'},
            {label:'Certifications',href:'/certifications'},
            {label: c.name, href:`/certifications/${slug}`},
          ]),
        ]}
      />

      <HeroDark>
        <div style={{display:'grid', gridTemplateColumns:'1.3fr 1fr', gap:48, alignItems:'center'}}>
          <div>
            <Crumbs items={[{label:'Certifications',href:'#/certifications'},{label: c.name}]}/>
            <div style={{marginTop:18, display:'flex', alignItems:'center', gap:10}}>
              <Pill tone={isUpcoming ? 'teal' : 'gold'} icon={isUpcoming ? 'clock' : 'check-circle'}>
                {isUpcoming ? 'Upcoming · Join waitlist' : 'Live programme'}
              </Pill>
            </div>
            <h1 className="gr-h1" style={{color:'#fff', marginTop:14, fontSize:60, lineHeight:1.05}}>
              {c.name}.<br/>
              <span style={{color:'#F59E0B'}}>{c.tagline}</span>
            </h1>
            <p className="gr-lead" style={{color:'rgba(255,255,255,.78)', marginTop:18, maxWidth:580}}>{c.hero_sub}</p>
            <div style={{display:'flex', gap:12, marginTop:28, flexWrap:'wrap'}}>
              {!isUpcoming && (
                <a href={`#/contact?intent=cert&cert=${slug}`} className="gr-btn gr-btn-gold gr-btn-lg">Talk to a {c.name} advisor <Icon name="arrow-right" size={16}/></a>
              )}
              {isUpcoming && (
                <a href={`#/contact?intent=cert&cert=${slug}&waitlist=1`} className="gr-btn gr-btn-gold gr-btn-lg">Join the waitlist <Icon name="arrow-right" size={16}/></a>
              )}
              <a href="#/compare-certifications" className="gr-btn gr-btn-lg" style={{background:'rgba(255,255,255,.1)', color:'#fff', border:'1px solid rgba(255,255,255,.18)'}}>
                Compare with another cert
              </a>
            </div>
          </div>
          <div style={{padding:30, borderRadius:24, background:'rgba(255,255,255,.06)', border:'1px solid rgba(255,255,255,.10)'}}>
            <div className="gr-eyebrow" style={{color:'#FBBF24', marginBottom:14}}>At a glance</div>
            {[
              ['Issuer', c.issuer],
              ['Timeline', c.timeline],
              ['Total cost (India)', c.cost],
              ['Exam structure', c.parts],
              ['Eligibility', c.eligibility],
            ].map(([k, v]) => (
              <div key={k} style={{display:'flex', justifyContent:'space-between', padding:'10px 0', borderTop:'1px solid rgba(255,255,255,.08)', gap:12}}>
                <span style={{font:'500 13px/1.3 Inter', color:'rgba(255,255,255,.65)'}}>{k}</span>
                <span style={{font:'700 13px/1.3 DM Sans', color:'#fff', textAlign:'right'}}>{v}</span>
              </div>
            ))}
          </div>
        </div>
      </HeroDark>

      {/* Who it's for */}
      <section className="gr-section">
        <div className="gr-container">
          <SectionTitle eyebrow="Is it right for you?" title="Who this pathway fits"/>
          <div style={{display:'grid', gridTemplateColumns:'repeat(auto-fill, minmax(280px, 1fr))', gap:14}}>
            {c.who_for.map((line, i) => (
              <div key={i} className="gr-card" style={{padding:22, display:'flex', gap:12, alignItems:'flex-start'}}>
                <Icon name="check-circle" size={20} style={{color:'var(--gr-green)', flexShrink:0, marginTop:2}}/>
                <p style={{font:'500 14.5px/1.55 Inter', color:'var(--gr-fg-1)', margin:0}}>{line}</p>
              </div>
            ))}
          </div>
          <div style={{marginTop:18, display:'flex', gap:10, flexWrap:'wrap'}}>
            <a href="/tools-static/cpa-eligibility-checker.html" className="gr-btn gr-btn-ghost"><Icon name="shield-check" size={14}/> Run the eligibility checker</a>
            <a href="#/skill-badge" className="gr-btn gr-btn-ghost"><Icon name="qr" size={14}/> Take the Skill Badge</a>
          </div>
        </div>
      </section>

      {/* Syllabus / Exam structure */}
      <section className="gr-section" style={{background:'var(--gr-bg-cream)'}}>
        <div className="gr-container">
          <SectionTitle eyebrow="Exam structure" title={`${c.name} syllabus + pass rates`}/>
          <div style={{display:'grid', gridTemplateColumns:'1fr', gap:14}}>
            {c.syllabus.map((p, i) => (
              <div key={i} className="gr-card" style={{padding:28, display:'grid', gridTemplateColumns:'1.4fr 1fr', gap:24}}>
                <div>
                  <div className="gr-eyebrow" style={{color:'var(--gr-gold-700)'}}>Section {i+1}</div>
                  <h3 className="gr-h3" style={{fontSize:22, marginTop:6}}>{p.name}</h3>
                  <ul style={{listStyle:'none', padding:0, margin:'14px 0 0', display:'flex', flexDirection:'column', gap:8}}>
                    {p.topics.map((t, j) => (
                      <li key={j} style={{display:'flex', gap:10, font:'500 14px/1.5 Inter', color:'var(--gr-fg-2)'}}>
                        <Icon name="book" size={14} style={{flexShrink:0, marginTop:3, color:'var(--gr-gold-700)'}}/>{t}
                      </li>
                    ))}
                  </ul>
                </div>
                <div style={{padding:20, background:'var(--gr-bg-tint)', borderRadius:14}}>
                  <div className="gr-eyebrow" style={{color:'var(--gr-fg-3)'}}>Global pass rate</div>
                  <div style={{font:'800 32px/1 "DM Sans"', color:'var(--gr-navy)', marginTop:8, letterSpacing:'-0.02em'}}>{p.pass_rate}</div>
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* Fees */}
      <section className="gr-section">
        <div className="gr-container">
          <SectionTitle eyebrow="Real numbers" title="Fees breakdown — what it actually costs from India"/>
          <div className="gr-card" style={{padding:0, overflow:'hidden'}}>
            <table style={{width:'100%', borderCollapse:'collapse'}}>
              <tbody>
                {c.fees_breakdown.map(([k, v], i) => (
                  <tr key={i} style={{borderTop: i>0 ? '1px solid var(--gr-border-soft)' : 'none'}}>
                    <td style={{padding:'16px 20px', font:'500 14.5px/1.5 Inter', color:'var(--gr-fg-1)'}}>{k}</td>
                    <td style={{padding:'16px 20px', font:'700 14.5px/1 "DM Sans"', color:'var(--gr-navy)', textAlign:'right'}}>{v}</td>
                  </tr>
                ))}
                <tr style={{background:'var(--gr-navy)', color:'#fff'}}>
                  <td style={{padding:'18px 20px', font:'800 14.5px/1 "DM Sans"'}}>All-in</td>
                  <td style={{padding:'18px 20px', font:'800 18px/1 "DM Sans"', color:'#FBBF24', textAlign:'right'}}>{c.cost}</td>
                </tr>
              </tbody>
            </table>
          </div>
          <div style={{marginTop:14}}>
            <a href="/tools-static/cpa-roi-calculator.html" className="gr-btn gr-btn-ghost"><Icon name="trending-up" size={14}/> Run the ROI calculator</a>
          </div>
        </div>
      </section>

      {/* Salary */}
      <section className="gr-section" style={{background:'var(--gr-bg-cream)'}}>
        <div className="gr-container">
          <SectionTitle eyebrow="Salary signals" title={`${c.name} salaries by city + experience`}/>
          <div className="gr-card" style={{padding:0, overflow:'hidden'}}>
            <table style={{width:'100%', borderCollapse:'collapse'}}>
              <thead>
                <tr style={{background:'var(--gr-bg-tint)'}}>
                  <th style={{padding:'14px 18px', textAlign:'left', font:'700 11.5px/1 Inter', letterSpacing:'.10em', textTransform:'uppercase', color:'var(--gr-fg-3)'}}>Stage</th>
                  <th style={{padding:'14px 18px', textAlign:'left', font:'700 11.5px/1 Inter', letterSpacing:'.10em', textTransform:'uppercase', color:'var(--gr-fg-3)'}}>Bengaluru</th>
                  <th style={{padding:'14px 18px', textAlign:'left', font:'700 11.5px/1 Inter', letterSpacing:'.10em', textTransform:'uppercase', color:'var(--gr-fg-3)'}}>Hyderabad</th>
                  <th style={{padding:'14px 18px', textAlign:'left', font:'700 11.5px/1 Inter', letterSpacing:'.10em', textTransform:'uppercase', color:'var(--gr-fg-3)'}}>Mumbai</th>
                </tr>
              </thead>
              <tbody>
                {c.salary.map((row, i) => (
                  <tr key={i} style={{borderTop: i>0 ? '1px solid var(--gr-border-soft)' : 'none'}}>
                    <td style={{padding:'16px 18px', font:'700 13.5px/1.4 "DM Sans"', color:'var(--gr-navy)'}}>{row.stage}</td>
                    <td style={{padding:'16px 18px', font:'600 14px/1 "DM Sans"', color:'var(--gr-navy)'}}>{row.bengaluru}</td>
                    <td style={{padding:'16px 18px', font:'600 14px/1 "DM Sans"', color:'var(--gr-navy)'}}>{row.hyderabad}</td>
                    <td style={{padding:'16px 18px', font:'600 14px/1 "DM Sans"', color:'var(--gr-navy)'}}>{row.mumbai}</td>
                  </tr>
                ))}
              </tbody>
            </table>
          </div>
          <p style={{font:'500 12.5px/1.5 Inter', color:'var(--gr-fg-4)', marginTop:14}}>
            Bands are entry-to-mid market medians sourced from public salary data + GCCReady alumni records. Exact offers depend on degree, exam scores, prior experience, and interview performance.
          </p>
        </div>
      </section>

      {/* GCCs hiring */}
      {employers.length > 0 && (
        <section className="gr-section">
          <div className="gr-container">
            <SectionTitle eyebrow="Named employers" title={`GCCs hiring ${c.name}-qualified candidates`} sub="Featured set across BFSI, Big Tech, Big 4 and Pharma. The full hiring universe is much larger."/>
            <div style={{display:'grid', gridTemplateColumns:'repeat(auto-fill, minmax(180px, 1fr))', gap:14}}>
              {c.gccs.map((s) => GR_EMPLOYERS[s] && (
                <LogoTile key={s} slug={s} employer={GR_EMPLOYERS[s]}/>
              ))}
            </div>
          </div>
        </section>
      )}

      {/* Role pods that fit */}
      {roles.length > 0 && (
        <section className="gr-section" style={{background:'var(--gr-bg-cream)'}}>
          <div className="gr-container">
            <SectionTitle eyebrow="Role pods" title={`Where ${c.name} graduates land`} sub="Each pod is a focused GCCReady programme with the specific tools and mock interviews for that function."/>
            <div style={{display:'grid', gridTemplateColumns:'repeat(auto-fill, minmax(280px, 1fr))', gap:18}}>
              {roles.map((r) => (
                <a key={r.slug} href={`#/role/${r.slug}`} className="gr-card" style={{
                  padding:22, textDecoration:'none', color:'var(--gr-fg-1)',
                  display:'flex', flexDirection:'column', gap:10,
                }}>
                  <div style={{
                    width:42, height:42, borderRadius:12,
                    background:'var(--gr-gold-50)', color:'var(--gr-gold-700)',
                    display:'grid', placeItems:'center',
                  }}><Icon name={r.icon} size={18}/></div>
                  <Pill tone="navy">{r.family}</Pill>
                  <h3 className="gr-h4" style={{fontSize:18, marginTop:4}}>{r.title}</h3>
                  <p style={{font:'500 13.5px/1.55 Inter', color:'var(--gr-fg-2)', margin:0}}>{r.does}</p>
                  <div style={{font:'700 13px/1 "DM Sans"', color:'var(--gr-navy)', marginTop:6}}>{r.salary}</div>
                </a>
              ))}
            </div>
          </div>
        </section>
      )}

      {/* Articles in topic — inline previews (top 3) + remaining as cards */}
      {articles.length > 0 && (
        <section className="gr-section">
          <div className="gr-container">
            <SectionTitle eyebrow="Read deeper" title={`Top ${c.name} articles — previewed inline`} sub="First few hundred words of each, then continue reading. AEO-friendly, deep, and skim-able."/>
            <div style={{display:'flex', flexDirection:'column', gap:18}}>
              {articles.slice(0, 3).map((a) => <ArticleInlinePreview key={a.slug} a={a}/>)}
            </div>
            {articles.length > 3 && (
              <div style={{marginTop:18}}>
                <SectionTitle eyebrow="More on this topic" title="Continue with the next reads" sub=""/>
                <div style={{display:'grid', gridTemplateColumns:'repeat(auto-fill, minmax(320px, 1fr))', gap:16}}>
                  {articles.slice(3).map((a) => <ArticleCard key={a.slug} a={a}/>)}
                </div>
              </div>
            )}
            <div style={{marginTop:18}}>
              <a href="#/resources/library" className="gr-btn gr-btn-ghost">All Library articles <Icon name="arrow-right" size={14}/></a>
            </div>
          </div>
        </section>
      )}

      {/* FAQ */}
      <section className="gr-section" style={{background:'var(--gr-bg-cream)'}}>
        <div className="gr-container">
          <SectionTitle eyebrow="Frequently asked" title={`${c.name} — questions students actually ask`}/>
          <Accordion items={c.faq.map((p) => ({ q: p.q, a: p.a }))}/>
        </div>
      </section>

      <CTABand
        title={isUpcoming ? `${c.name} cohort opens soon — join the waitlist.` : `Ready to start your ${c.name} pathway?`}
        sub={isUpcoming ? 'Get early-access pricing and the cohort calendar in your inbox.' : 'Talk to an advisor about cohort dates, EMI, and your specific eligibility. 30-minute call, free.'}
        primaryLabel={isUpcoming ? 'Join the waitlist' : `Talk to a ${c.name} advisor`}
        primaryHref={`#/contact?intent=cert&cert=${slug}${isUpcoming ? '&waitlist=1' : ''}`}
      />
    </>
  );
}

/* ============================================================================
 * ArticleInlinePreview — fetches the article fragment, strips HTML, shows first
 * ~140 words inline with proper typography + "Continue reading" link.
 * Used in cert pillar pages for AEO-friendly inline content.
 * ========================================================================== */
function ArticleInlinePreview({ a }) {
  const [excerpt, setExcerpt] = React.useState('');
  React.useEffect(() => {
    fetch(`./articles/${a.slug}.html`).then((r) => r.text()).then((html) => {
      // Strip JSON-LD + tags; keep text only
      let plain = html.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, '');
      plain = plain.replace(/<[^>]+>/g, ' ').replace(/&nbsp;/g, ' ').replace(/\s+/g, ' ').trim();
      // Take first ~140 words
      const words = plain.split(' ').slice(0, 140);
      setExcerpt(words.join(' ') + (plain.split(' ').length > 140 ? '…' : ''));
    }).catch(() => setExcerpt(a.description || ''));
  }, [a.slug]);

  const meta = (typeof TOPIC_META !== 'undefined' && TOPIC_META[a.topic]) || { icon:'book', tone:'navy' };

  return (
    <article className="gr-card" style={{padding:30, display:'grid', gridTemplateColumns:'1fr', gap:14}}>
      <div style={{display:'flex', alignItems:'center', gap:10}}>
        <div style={{
          width:38, height:38, borderRadius:11,
          background:'var(--gr-gold-50)', color:'var(--gr-gold-700)',
          display:'grid', placeItems:'center',
        }}><Icon name={meta.icon} size={16}/></div>
        <Pill tone={meta.tone}>{a.topic}</Pill>
        <span style={{marginLeft:'auto', font:'600 12px/1 Inter', color:'var(--gr-fg-3)'}}>
          <Icon name="clock" size={11} style={{verticalAlign:'-1px', marginRight:5}}/>{a.reading_time_min} min · {a.word_count.toLocaleString()} words
        </span>
      </div>
      <h3 style={{font:'800 24px/1.25 "DM Sans"', color:'var(--gr-navy)', letterSpacing:'-0.015em', margin:0}}>{a.title}</h3>
      {a.description && (
        <p style={{font:'500 15px/1.55 Inter', color:'var(--gr-fg-2)', margin:0}}>{a.description}</p>
      )}
      <p style={{font:'400 14.5px/1.7 Inter', color:'var(--gr-fg-2)', margin:0,
        paddingTop:14, borderTop:'1px solid var(--gr-border-soft)'}}>
        {excerpt || (a.description || 'Loading excerpt…')}
      </p>
      <a href={`#/article/${a.slug}`} className="gr-btn gr-btn-gold" style={{width:'fit-content', marginTop:4}}>
        Continue reading <Icon name="arrow-right" size={14}/>
      </a>
    </article>
  );
}

Object.assign(window, { PillarCertPage, CERT_PILLAR, ArticleInlinePreview });
