/* ===========================================================
   BrokerRank MY — stylesheet
   Clean, mobile-first fintech layout
   =========================================================== */

:root {
  --navy: #0b1f3a;
  --navy-2: #122a4d;
  --blue: #1a5fd6;
  --blue-dark: #124aa8;
  --accent: #10b981;
  --gold: #e0a500;
  --ink: #1c2733;
  --muted: #5a6b7b;
  --line: #e3e8ef;
  --bg: #f6f8fb;
  --card: #ffffff;
  --star: #f5a623;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(16, 32, 64, 0.08);
  --shadow-sm: 0 2px 8px rgba(16, 32, 64, 0.06);
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}

img, svg { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); font-weight: 750; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.75rem); margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 3.2vw, 2rem); margin: 1.8em 0 .6em; }
h3 { font-size: clamp(1.15rem, 2.4vw, 1.4rem); margin: 1.5em 0 .5em; }
p { margin: 0 0 1.1em; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.brand .logo-mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand span b { color: #4f9bff; }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  color: #d6e2f3; padding: 8px 12px; border-radius: 8px; font-size: .95rem; font-weight: 600;
}
.nav-links a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }

.nav-toggle {
  display: none; background: transparent; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; transition: .2s; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; background: var(--blue); color: #fff; padding: 12px 22px;
  border-radius: 10px; font-weight: 700; font-size: 1rem; border: 0; cursor: pointer;
  transition: background .18s, transform .18s;
}
.btn:hover { background: var(--blue-dark); text-decoration: none; transform: translateY(-1px); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: #0e9e70; }
.btn-ghost { background: transparent; border: 1.5px solid rgba(255,255,255,.4); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-sm { padding: 9px 16px; font-size: .92rem; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 55%, #17365f 100%);
  color: #eaf1fb; padding: 56px 0 64px;
}
.hero h1 { color: #fff; }
.hero p.lede { font-size: 1.18rem; color: #c3d3ea; max-width: 640px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 26px; }
.hero .badge {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  padding: 6px 13px; border-radius: 999px; font-size: .86rem; color: #cfe0f6;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Sections ---------- */
section { padding: 8px 0; }
.section-pad { padding: 40px 0; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 760px; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; color: var(--blue); margin-bottom: 6px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 24px;
}
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Broker ranking ---------- */
.broker-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 20px;
  display: grid; grid-template-columns: 54px 1.4fr 1fr auto; gap: 20px; align-items: center;
}
.broker-card.top { border: 2px solid var(--accent); position: relative; }
.broker-rank {
  width: 46px; height: 46px; border-radius: 12px; background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem;
}
.broker-card.top .broker-rank { background: var(--accent); }
.broker-name { font-size: 1.3rem; font-weight: 800; color: var(--navy); margin: 0; }
.broker-tag { font-size: .85rem; color: var(--muted); margin: 2px 0 0; }
.ribbon {
  position: absolute; top: -12px; left: 20px; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
}
.stars { color: var(--star); font-size: 1rem; letter-spacing: 1px; }
.rating-num { font-weight: 800; color: var(--navy); }
.broker-meta { font-size: .9rem; color: var(--muted); }
.broker-meta b { color: var(--ink); }

/* ---------- Comparison table ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
table.compare { width: 100%; border-collapse: collapse; background: #fff; min-width: 620px; }
table.compare th, table.compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: .95rem; }
table.compare thead th { background: var(--navy); color: #fff; font-weight: 700; }
table.compare tbody tr:nth-child(even) { background: #fafcff; }
table.compare .hl { background: #f0fbf6 !important; }
table.compare td:first-child { font-weight: 700; color: var(--navy); }

/* ---------- Feature list ---------- */
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .tick {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: #e7f6ef; color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; margin-top: 2px;
}
.feature h3 { margin: 0 0 4px; }

/* ---------- Interface figure ---------- */
figure.ui-shot { margin: 24px 0; }
figure.ui-shot img {
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); width: 100%;
}
figure.ui-shot figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; text-align: center; }

/* ---------- Pros / cons ---------- */
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.proscons .box { border-radius: var(--radius); padding: 20px 22px; border: 1px solid var(--line); background: #fff; }
.proscons .box.pros { border-left: 4px solid var(--accent); }
.proscons .box.cons { border-left: 4px solid #e76f6f; }
.proscons ul { margin: 0; padding-left: 20px; }
.proscons li { margin-bottom: 8px; }

/* ---------- FAQ ---------- */
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; box-shadow: var(--shadow-sm); overflow: hidden; }
.faq-item summary {
  cursor: pointer; padding: 18px 22px; font-weight: 700; color: var(--navy); font-size: 1.05rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.5rem; color: var(--blue); font-weight: 400; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-body { padding: 0 22px 18px; color: var(--ink); }

/* ---------- Callout ---------- */
.callout {
  background: linear-gradient(135deg, #0f2c54, #1a4a8a); color: #eaf2fd;
  border-radius: var(--radius); padding: 30px 28px; margin: 30px 0;
}
.callout h2, .callout h3 { color: #fff; margin-top: 0; }
.callout p { color: #cfe0f6; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .85rem; color: var(--muted); padding: 16px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--blue); }

/* ---------- Author / meta row ---------- */
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; color: var(--muted); font-size: .9rem; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 8px; }
.post-meta .avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }

/* ---------- TOC ---------- */
.toc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; box-shadow: var(--shadow-sm); }
.toc strong { display: block; color: var(--navy); margin-bottom: 8px; }
.toc ul { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #b9c8de; padding: 46px 0 28px; margin-top: 56px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; font-size: .95rem; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .06em; }
.site-footer a { color: #b9c8de; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding-top: 20px; font-size: .84rem; color: #8ea1bd; }
.risk-note { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; padding: 14px 18px; margin-bottom: 24px; font-size: .82rem; color: #9fb2cd; }

/* ---------- Utility ---------- */
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.text-center { text-align: center; }
.pill { display: inline-block; background: #eef3fb; color: var(--blue-dark); font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 40px 0; }
.cta-band { background: var(--accent); color: #fff; border-radius: var(--radius); padding: 26px 28px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; margin: 30px 0; }
.cta-band h3 { color: #fff; margin: 0; }
.cta-band .btn { background: #fff; color: var(--accent); }
.cta-band .btn:hover { background: #f0fff9; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0; background: var(--navy);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px 16px;
    display: none; box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 10px; border-radius: 8px; }
  .broker-card { grid-template-columns: 44px 1fr; gap: 12px 14px; }
  .broker-card .broker-col-rating, .broker-card .broker-col-cta { grid-column: 2; }
  .proscons { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .cta-band { flex-direction: column; align-items: flex-start; }
}
