/* ============================================================
   CPE Trade Pro — inner pages (features, blog, guides)
   Loaded AFTER style.css so the tokens in :root are already set.
   ============================================================ */

/* ---------- Breadcrumb ---------- */
.crumbs{
  display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;
  font-size:.78rem;color:var(--muted);padding:1.4rem 0 .2rem;
}
.crumbs a{color:var(--muted)}
.crumbs a:hover{color:var(--accent)}
.crumbs span.sep{opacity:.5}

/* ---------- Page hero ---------- */
.page-hero{position:relative;padding:1.4rem 0 2.4rem;overflow:hidden}
.page-hero .hero-bg{
  position:absolute;inset:0;z-index:0;
  background:
    radial-gradient(700px 380px at 12% 0%,rgba(0,229,168,.13),transparent 62%),
    radial-gradient(600px 400px at 88% 20%,rgba(59,130,246,.14),transparent 62%);
}
.page-hero .container{position:relative;z-index:1}
.page-hero h1{
  font:800 clamp(1.7rem,4vw,2.6rem)/1.18 'Sora',sans-serif;
  letter-spacing:-.4px;margin-bottom:.8rem;max-width:900px;
}
.page-hero .lead{max-width:760px;color:var(--muted);font-size:1.02rem}
.page-hero .lead strong{color:var(--text)}

.page-meta{
  display:flex;flex-wrap:wrap;gap:.5rem 1.2rem;margin-top:1.1rem;
  font-size:.78rem;color:var(--muted);
}
.page-meta b{color:var(--accent);font-weight:600}

/* ---------- Layout: prose + sidebar ---------- */
.page-body{padding:0 0 4rem}
.page-grid{
  display:grid;grid-template-columns:minmax(0,1fr) 300px;
  gap:2.2rem;align-items:start;
}
@media(max-width:940px){
  .page-grid{grid-template-columns:1fr}
}

/* ---------- Prose ---------- */
.prose{font-size:1rem;line-height:1.75;color:var(--text);min-width:0}
.prose>*+*{margin-top:1rem}
.prose h2{
  font:800 1.34rem/1.3 'Sora',sans-serif;letter-spacing:-.2px;
  margin-top:2.2rem;padding-top:.4rem;scroll-margin-top:88px;
}
.prose h3{
  font:700 1.08rem/1.35 'Sora',sans-serif;
  margin-top:1.7rem;scroll-margin-top:88px;
}
.prose h2:first-child,.prose h3:first-child{margin-top:0}
.prose p{color:#d3ddec}
.prose strong{color:#fff}
.prose em{color:var(--accent);font-style:normal}
.prose a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.prose a:hover{color:#5cf5c8}
.prose ul,.prose ol{padding-left:1.25rem;color:#d3ddec}
.prose ul{list-style:disc}
.prose ol{list-style:decimal}
.prose li+li{margin-top:.42rem}
.prose li::marker{color:var(--accent)}

.prose blockquote{
  margin:1.6rem 0;padding:1rem 1.2rem;border-left:3px solid var(--accent);
  background:rgba(0,229,168,.06);border-radius:0 12px 12px 0;color:#d3ddec;
}
.prose blockquote p{margin:0}

.prose code{
  font-family:'JetBrains Mono',Consolas,monospace;font-size:.86em;
  background:rgba(255,255,255,.07);padding:.15em .4em;border-radius:5px;color:#9ef0d5;
}
.prose pre{
  background:#0c1424;border:1px solid var(--line);border-radius:12px;
  padding:1rem;overflow-x:auto;font-size:.84rem;line-height:1.6;
}
.prose pre code{background:none;padding:0;color:#cfe2f5}

.prose img{border-radius:14px;border:1px solid var(--line);margin:1.4rem 0}
.pattern-figure{
  margin:1.35rem 0;padding:.75rem;border:1px solid var(--line);border-radius:16px;
  background:linear-gradient(150deg,#101a2c,#0b1220);overflow:hidden;
}
.pattern-figure svg{display:block;width:100%;height:auto;border-radius:10px}
.pattern-figure figcaption{padding:.65rem .3rem .1rem;color:var(--muted);font-size:.78rem;line-height:1.55}
.pattern-figure figcaption strong{color:var(--accent)}
.pattern-figure .chart-label{font:600 12px Inter,Arial,sans-serif;fill:#cbd5e1}
.pattern-figure .chart-small{font:500 10px Inter,Arial,sans-serif;fill:#94a3b8}
.pattern-figure .chart-grid{stroke:#263449;stroke-width:1}
.pattern-figure .chart-price{fill:none;stroke:#35d6b0;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.pattern-figure .chart-price-alt{fill:none;stroke:#60a5fa;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}
.pattern-figure .chart-level{stroke:#fbbf24;stroke-width:2;stroke-dasharray:7 6}
.pattern-figure .chart-break{stroke:#fb7185;stroke-width:2;stroke-dasharray:5 5}
.pattern-figure .candle-bull{fill:#22c55e;stroke:#22c55e}
.pattern-figure .candle-bear{fill:#ef4444;stroke:#ef4444}
.pattern-figure .candle-wick{stroke-width:3;stroke-linecap:round}
.prose hr{border:none;border-top:1px solid var(--line);margin:2rem 0}

.prose table{
  width:100%;border-collapse:collapse;font-size:.88rem;margin:1.4rem 0;
  display:block;overflow-x:auto;
}
.prose th,.prose td{
  border:1px solid var(--line);padding:.6rem .75rem;text-align:left;vertical-align:top;
}
.prose th{background:rgba(255,255,255,.05);font-weight:700;color:#fff;white-space:nowrap}
.prose td{color:#cdd8e8}

/* ---------- Callouts ---------- */
.callout{
  margin:1.6rem 0;padding:1rem 1.15rem;border-radius:14px;
  border:1px solid var(--line);background:var(--panel);
  display:flex;gap:.8rem;align-items:flex-start;font-size:.92rem;color:#d3ddec;
}
.callout .co-ico{font-size:1.15rem;line-height:1.4;flex:0 0 auto}
.callout.warn{border-color:rgba(245,158,11,.4);background:rgba(245,158,11,.08)}
.callout.tip{border-color:rgba(0,229,168,.4);background:rgba(0,229,168,.07)}
.callout.info{border-color:rgba(59,130,246,.4);background:rgba(59,130,246,.08)}
.callout strong{display:block;margin-bottom:.2rem;color:#fff}

/* ---------- Key facts strip ---------- */
.fact-row{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:.8rem;margin:1.6rem 0;
}
.fact{
  border:1px solid var(--line);border-radius:14px;padding:.95rem 1rem;
  background:linear-gradient(150deg,var(--panel),rgba(12,19,35,.94));
}
.fact b{display:block;font:800 1.35rem 'Sora',sans-serif;color:var(--accent)}
.fact span{font-size:.76rem;color:var(--muted);line-height:1.45;display:block;margin-top:.15rem}

/* ---------- Sidebar ---------- */
.side{display:grid;gap:1rem;position:sticky;top:88px}
@media(max-width:940px){.side{position:static}}
.side-card{
  border:1px solid var(--line);border-radius:16px;padding:1.15rem;
  background:linear-gradient(150deg,var(--panel),rgba(12,19,35,.94));
}
.side-card h4{font:700 .95rem 'Sora',sans-serif;margin-bottom:.7rem}
.side-card .btn{width:100%;margin-top:.55rem}
.side-links{display:grid;gap:.45rem;font-size:.86rem}
.side-links a{color:var(--muted)}
.side-links a:hover{color:var(--accent)}
.side-card p{font-size:.84rem;color:var(--muted);line-height:1.6}

.side-cta{background:linear-gradient(150deg,rgba(0,229,168,.13),rgba(59,130,246,.1));border-color:rgba(0,229,168,.32)}
.side-cta p{color:#cfeee3}

/* ---------- Blog index ---------- */
.post-grid{
  display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:1.1rem;margin-top:1.4rem;
}
.post-card{
  display:flex;flex-direction:column;gap:.55rem;
  border:1px solid var(--line);border-radius:16px;padding:1.2rem;
  background:linear-gradient(150deg,var(--panel),rgba(12,19,35,.94));
  transition:transform .15s,border-color .2s;
}
.post-card:hover{transform:translateY(-3px);border-color:rgba(0,229,168,.45)}
.post-tag{
  align-self:flex-start;font-size:.68rem;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--accent);
  background:rgba(0,229,168,.1);border:1px solid rgba(0,229,168,.28);
  padding:.16rem .5rem;border-radius:999px;
}
.post-card h3{font:700 1.02rem/1.35 'Sora',sans-serif;color:var(--text)}
.post-card p{font-size:.86rem;color:var(--muted);line-height:1.6}
.post-card .post-more{font-size:.82rem;color:var(--accent);font-weight:600;margin-top:auto}

/* ---------- Related links at end of an article ---------- */
.related{margin-top:2.6rem;padding-top:1.6rem;border-top:1px solid var(--line)}
.related h3{font:700 1.05rem 'Sora',sans-serif;margin-bottom:.9rem}
.related ul{list-style:none;padding:0;display:grid;gap:.5rem}
.related li a{color:var(--accent);font-size:.92rem}

/* ---------- Feature page blocks ---------- */
.f-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:1rem;margin:1.6rem 0;
}
.f-box{
  border:1px solid var(--line);border-radius:16px;padding:1.15rem;
  background:linear-gradient(150deg,var(--panel),rgba(12,19,35,.94));
}
.f-box .fb-ico{font-size:1.3rem;display:block;margin-bottom:.5rem}
.f-box strong{display:block;font:700 .96rem 'Sora',sans-serif;margin-bottom:.35rem}
.f-box span{font-size:.85rem;color:var(--muted);line-height:1.6;display:block}

/* ---------- Small print ---------- */
.fineprint{font-size:.76rem;color:var(--muted);line-height:1.6;margin-top:1.6rem}

/* ---------- Homepage language highlight ---------- */
.lang-strip{display:flex;flex-wrap:wrap;gap:.55rem;margin:1.6rem 0 0}
.lang-chip{
  display:inline-flex;align-items:baseline;gap:.45rem;
  border:1px solid var(--line);border-radius:999px;padding:.5rem .95rem;
  background:linear-gradient(150deg,var(--panel),rgba(12,19,35,.94));
  font-size:.9rem;color:var(--text);
}
.lang-chip b{
  font:700 .68rem/1 'Sora',sans-serif;letter-spacing:.08em;
  color:var(--accent);
}
.lang-cta{margin-top:1.8rem;display:flex;flex-wrap:wrap;gap:.7rem}

/* ---------- Legal / trust links row in the footer ---------- */
.footer-legal{
  display:flex;flex-wrap:wrap;justify-content:center;gap:.4rem .9rem;
  margin-bottom:.9rem;padding-bottom:.9rem;
  border-bottom:1px solid var(--line);
}
.footer-legal a{font-size:.78rem;color:var(--muted)}
.footer-legal a:hover{color:var(--accent)}

/* ============================================================
   App-style figures + auto-analysis animation (blog · academy)
   Inline SVG diagrams drawn in the app's own dark/teal language.
   ============================================================ */
.app-figure{
  margin:1.7rem 0;padding:.7rem;border:1px solid var(--line);border-radius:18px;
  background:linear-gradient(160deg,#0e1728,#0a1120);
  box-shadow:0 18px 50px rgba(0,0,0,.35);
  overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;
}
.app-figure svg{display:block;width:100%;height:auto;border-radius:12px}
.app-figure figcaption{padding:.7rem .35rem .15rem;color:var(--muted);font-size:.78rem;line-height:1.55}
.app-figure figcaption strong{color:var(--accent)}
.app-figure figcaption b{color:var(--text);font-weight:600}
@media(max-width:640px){.app-figure svg{min-width:500px}}

/* SVG text + shape tokens */
.app-figure .a-h{font:700 12px 'Sora',Inter,sans-serif;fill:#e6edf7}
.app-figure .a-t{font:600 11px Inter,sans-serif;fill:#cbd5e1}
.app-figure .a-s{font:500 9.5px Inter,sans-serif;fill:#8fa0b8}
.app-figure .a-m{font:600 10px 'JetBrains Mono',Consolas,monospace;fill:#9ef0d5}
.app-figure .a-panel{fill:#101a2c;stroke:#1e2a3f;stroke-width:1}
.app-figure .a-soft{fill:#0c1424;stroke:#1b2537;stroke-width:1}
.app-figure .a-chip{fill:#152038;stroke:#243349;stroke-width:1}
.app-figure .a-grid{stroke:#1b2537;stroke-width:1}
.app-figure .a-bull{fill:#22c55e}
.app-figure .a-bear{fill:#ef4444}
.app-figure .a-wbull{stroke:#22c55e;stroke-width:2.5;stroke-linecap:round}
.app-figure .a-wbear{stroke:#ef4444;stroke-width:2.5;stroke-linecap:round}
.app-figure .a-entry{stroke:#22d3ee;stroke-width:2;stroke-dasharray:7 6}
.app-figure .a-sl{stroke:#ef4444;stroke-width:2;stroke-dasharray:7 6}
.app-figure .a-tp1{stroke:#00e5a8;stroke-width:2;stroke-dasharray:7 6}
.app-figure .a-tp2{stroke:#fbbf24;stroke-width:2;stroke-dasharray:7 6}
.app-figure .a-price{fill:none;stroke:#35d6b0;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round}
.app-figure .a-track{fill:#182338}
.app-figure .a-link{stroke:#2b3a52;stroke-width:2;fill:none}
.app-figure .a-arrow{stroke:#2b3a52;stroke-width:2;fill:none;marker-end:url(#aaArrow)}
.app-figure .a-focus{fill:none;stroke:#fbbf24;stroke-width:2;stroke-dasharray:6 5}
.app-figure .a-zone-ob{fill:rgba(96,165,250,.16);stroke:#60a5fa;stroke-width:1.5}
.app-figure .a-zone-fvg{fill:rgba(168,85,247,.16);stroke:#a855f7;stroke-width:1.5}

/* Utility: small pill label inside a figure */
.app-figure .a-pill{fill:#0a1120;stroke:#243349;stroke-width:1}

/* ---------- Auto-analysis animation ---------- */
.aa-scan{opacity:0}
.aa-reveal{opacity:1}

@media (prefers-reduced-motion: no-preference){
  .aa-scan{opacity:1;animation:aaScan 5.2s cubic-bezier(.45,0,.25,1) .3s infinite}
  @keyframes aaScan{
    0%{transform:translateX(0)}
    52%{transform:translateX(var(--aa-x,360px))}
    72%,100%{transform:translateX(var(--aa-x,360px))}
  }
  .aa-reveal{opacity:0;animation:aaFade .7s ease-out both}
  @keyframes aaFade{
    from{opacity:0;transform:translateY(5px)}
    to{opacity:1;transform:none}
  }
  .aa-bar{transform-box:fill-box;transform-origin:left center;animation:aaGrow .95s cubic-bezier(.4,0,.2,1) both}
  @keyframes aaGrow{from{transform:scaleX(0)}to{transform:scaleX(1)}}
  .aa-soft{animation:aaGlow 2.6s ease-in-out infinite}
  @keyframes aaGlow{0%,100%{opacity:.35}50%{opacity:1}}
}

/* ============================================================
   Learn series — colourful figure tokens + animations
   Extra helpers on top of .app-figure, used by the blog guides.
   ============================================================ */

/* Accent text colours */
.app-figure .a-blue{fill:#60a5fa}
.app-figure .a-green{fill:#22c55e}
.app-figure .a-teal{fill:#00e5a8}
.app-figure .a-amber{fill:#fbbf24}
.app-figure .a-orange{fill:#fb923c}
.app-figure .a-purple{fill:#a855f7}
.app-figure .a-cyan{fill:#22d3ee}
.app-figure .a-pink{fill:#fb7185}
.app-figure .a-red{fill:#ef4444}
.app-figure .a-white{fill:#fff}

/* Tinted zone fills */
.app-figure .a-fill-blue{fill:rgba(96,165,250,.18);stroke:#60a5fa;stroke-width:1.5}
.app-figure .a-fill-green{fill:rgba(34,197,94,.18);stroke:#22c55e;stroke-width:1.5}
.app-figure .a-fill-teal{fill:rgba(0,229,168,.15);stroke:#00e5a8;stroke-width:1.5}
.app-figure .a-fill-amber{fill:rgba(251,191,36,.18);stroke:#fbbf24;stroke-width:1.5}
.app-figure .a-fill-orange{fill:rgba(251,146,60,.18);stroke:#fb923c;stroke-width:1.5}
.app-figure .a-fill-purple{fill:rgba(168,85,247,.18);stroke:#a855f7;stroke-width:1.5}
.app-figure .a-fill-cyan{fill:rgba(34,211,238,.18);stroke:#22d3ee;stroke-width:1.5}
.app-figure .a-fill-pink{fill:rgba(251,113,133,.18);stroke:#fb7185;stroke-width:1.5}
.app-figure .a-fill-red{fill:rgba(239,68,68,.18);stroke:#ef4444;stroke-width:1.5}

/* Card / pill surfaces */
.app-figure .a-card{fill:#0d1729;stroke:#22314a;stroke-width:1}
.app-figure .a-card-soft{fill:#0a1322;stroke:#1b2537;stroke-width:1}
.app-figure .a-panel-blue{fill:#0c1626;stroke:#27466e;stroke-width:1}
.app-figure .a-panel-green{fill:#0a1a17;stroke:#1f5e48;stroke-width:1}

/* Coloured bar fills for the .aa-bar grow animation */
.app-figure .a-bar-blue{fill:#60a5fa}
.app-figure .a-bar-green{fill:#22c55e}
.app-figure .a-bar-teal{fill:#00e5a8}
.app-figure .a-bar-amber{fill:#fbbf24}
.app-figure .a-bar-purple{fill:#a855f7}
.app-figure .a-bar-cyan{fill:#22d3ee}
.app-figure .a-bar-pink{fill:#fb7185}
.app-figure .a-bar-red{fill:#ef4444}

/* Numbered step bubble */
.app-figure .a-numbub{fill:#152038;stroke:#2b3a52;stroke-width:1}

/* ---------- Extra animations (all reduced-motion guarded) ---------- */
.aa-line{stroke-dasharray:1}
.aa-pop{opacity:1}
.aa-slide{opacity:1}
.aa-dash{stroke:#22d3ee;stroke-width:2;fill:none}

@media (prefers-reduced-motion: no-preference){
  /* draw a path/line that has pathLength="1" */
  .aa-line{animation:aaDraw 1.5s cubic-bezier(.4,0,.2,1) both}
  @keyframes aaDraw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}

  .aa-pop{opacity:0;transform-box:fill-box;transform-origin:center;
    animation:aaPop .55s cubic-bezier(.2,.85,.2,1) both}
  @keyframes aaPop{from{opacity:0;transform:scale(.55)}to{opacity:1;transform:none}}

  .aa-slide{opacity:0;animation:aaSlide .6s ease-out both}
  @keyframes aaSlide{from{opacity:0;transform:translateX(-16px)}to{opacity:1;transform:none}}

  .aa-slide-r{opacity:0;animation:aaSlideR .6s ease-out both}
  @keyframes aaSlideR{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}

  .aa-float{animation:aaFloat 3.4s ease-in-out infinite}
  @keyframes aaFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}

  .aa-pulse{animation:aaPulse 2.3s ease-in-out infinite}
  @keyframes aaPulse{0%,100%{opacity:.4}50%{opacity:1}}

  .aa-march{stroke-dashoffset:0;animation:aaMarch 1.1s linear infinite}
  @keyframes aaMarch{to{stroke-dashoffset:-26}}

  .aa-sweep{transform-box:fill-box;transform-origin:right center;
    animation:aaSweep 2.6s cubic-bezier(.45,0,.25,1) infinite}
  @keyframes aaSweep{0%{transform:scaleX(.05)}55%{transform:scaleX(1)}100%{transform:scaleX(1)}}
}

/* ============================================================
   Learn series — colourful HTML cards (non-SVG)
   ============================================================ */
.edu-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:.9rem;margin:1.6rem 0}
.edu-card{
  border:1px solid var(--line);border-radius:16px;padding:1.05rem;
  background:linear-gradient(150deg,var(--panel),rgba(12,19,35,.94));
}
.edu-card .ec-ico{font-size:1.4rem;display:block;margin-bottom:.45rem}
.edu-card strong{display:block;font:700 .95rem 'Sora',sans-serif;margin-bottom:.3rem;color:var(--text)}
.edu-card span{font-size:.84rem;color:var(--muted);line-height:1.6;display:block}
.edu-card.blue{border-color:rgba(96,165,250,.42)}
.edu-card.green{border-color:rgba(34,197,94,.42)}
.edu-card.teal{border-color:rgba(0,229,168,.42)}
.edu-card.amber{border-color:rgba(251,191,36,.42)}
.edu-card.purple{border-color:rgba(168,85,247,.42)}
.edu-card.cyan{border-color:rgba(34,211,238,.42)}
.edu-card.pink{border-color:rgba(251,113,133,.42)}
.edu-card.red{border-color:rgba(239,68,68,.45)}

/* Colourful "choose one" chips */
.edu-chips{display:flex;flex-wrap:wrap;gap:.5rem;margin:1.2rem 0}
.edu-chip{
  display:inline-flex;align-items:center;gap:.4rem;font-size:.82rem;font-weight:600;
  border:1px solid var(--line);border-radius:999px;padding:.42rem .85rem;color:var(--text);
  background:linear-gradient(150deg,var(--panel),rgba(12,19,35,.94));
}
.edu-chip i{font-style:normal;font-weight:800;font-size:.7rem}
.edu-chip.blue i{color:#60a5fa}
.edu-chip.green i{color:#22c55e}
.edu-chip.amber i{color:#fbbf24}
.edu-chip.purple i{color:#a855f7}
.edu-chip.cyan i{color:#22d3ee}
.edu-chip.pink i{color:#fb7185}
.edu-chip.red i{color:#ef4444}
