/* =========================================================
   broker.css  –  Broker Profile Pages
   Light theme, matching the main broker comparison page.
   ========================================================= */

:root {
  --font-family-primary: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg-page: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-soft: #f9faff;
  --bg-hero: linear-gradient(135deg, rgba(22, 93, 255, 0.08) 0%, rgba(22, 93, 255, 0.02) 50%, #ffffff 100%);
  --text-primary: rgba(0, 0, 0, 0.92);
  --text-secondary: rgba(0, 0, 0, 0.6);
  --text-muted: rgba(0, 0, 0, 0.45);
  --brand: #165dff;
  --brand-hover: #1454e5;
  --brand-light: rgba(22, 93, 255, 0.08);
  --brand-light-border: rgba(22, 93, 255, 0.18);
  --success: #009b67;
  --warning: #f59e0b;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.07);
  --shadow-hero: 0 4px 24px rgba(22, 93, 255, 0.12);
  --radius-card: 16px;
  --radius-pill: 999px;
  --content-width: 1164px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-family-primary);
  -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }

ul {
  margin: 0;
  padding-left: 20px;
}

/* ── Layout ─────────────────────────────────────────────── */
.content-wrap {
  width: min(calc(100% - 48px), var(--content-width));
  margin: 0 auto;
}

/* ── Full site header (used by /brokers/* pages) ─────────── */
.page-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
}

.brand {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.main-nav a {
  position: relative;
  transition: color 0.15s;
}

.main-nav a:hover { color: var(--text-primary); }

/* Mega-menu */
.mega-menu {
  position: relative;
}

.mega-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 24px;
}

.mega-menu-trigger {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  position: relative;
}


.mega-menu-panel {
  position: absolute;
  top: calc(100% + 22px);
  left: 50%;
  width: min(980px, calc(100vw - 72px));
  transform: translate(-50%, 10px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  padding: 22px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 20;
}

.mega-menu-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-top: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
  background: #ffffff;
  transform: translateX(-50%) rotate(45deg);
}

.mega-menu-group {
  position: relative;
  min-width: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.mega-menu-group h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.mega-menu-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.mega-menu-group a {
  color: var(--brand);
  font-size: 13px;
  line-height: 1.4;
  transition: color 0.15s;
}

.mega-menu-group a:hover { color: var(--brand-hover); }

.mega-menu:hover .mega-menu-panel,
.mega-menu:focus-within .mega-menu-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.mega-menu:hover .mega-menu-trigger,
.mega-menu:focus-within .mega-menu-trigger {
  color: var(--text-primary);
}


/* header CTA button */
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: var(--radius-pill);
  padding: 0 20px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-cta:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

/* Supported Brokers dropdown */
.supported-brokers-dropdown {
  position: relative;
}

.supported-brokers-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 24px;
}

.dropdown-trigger {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 22px);
  left: 50%;
  width: min(700px, calc(100vw - 72px));
  transform: translate(-50%, 10px);
  border: 1px solid rgba(22, 93, 255, 0.1);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(10px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 20;
}

.supported-brokers-dropdown:hover .dropdown-panel,
.supported-brokers-dropdown:focus-within .dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.supported-brokers-dropdown:hover .dropdown-trigger,
.supported-brokers-dropdown:focus-within .dropdown-trigger {
  color: var(--text-primary);
}

.dropdown-group {
  position: relative;
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(22, 93, 255, 0.1);
  display: grid;
  gap: 8px;
  align-content: start;
}

.dropdown-group--two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dropdown-group--two-col .dropdown-label {
  grid-column: 1 / -1;
}

.dropdown-label {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.3;
  color: var(--text-primary);
}

.dropdown-group a {
  font-size: 12px;
  color: var(--brand);
  line-height: 1.4;
}

.dropdown-group a:hover {
  color: var(--brand-hover);
}

/* ── Old-style broker header (kept for /topics/* backward compat) ── */
.broker-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(14px);
}

.broker-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand-logo img {
  display: block;
  width: 108px;
  height: auto;
}

.header-back {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.header-back:hover { color: var(--brand); }

.header-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.18s, transform 0.18s;
}

.header-cta-btn:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

/* ── Hero (Tier 1) ───────────────────────────────────────── */
.broker-hero {
  padding: 52px 0 44px;
  background: var(--bg-hero);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: start;
}

/* broker identity */
.broker-identity {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.broker-logo-wrap {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: #fff;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.broker-logo-wrap img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.broker-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.01em;
}

.broker-identity-info h1 {
  font-size: clamp(26px, 3.5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text-primary);
}

.region-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-light);
  border: 1px solid var(--brand-light-border);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.value-prop {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 580px;
  margin-bottom: 20px;
}

.promo-teaser {
  display: inline-block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.promo-teaser a {
  color: var(--brand);
  font-weight: 700;
  background: var(--brand-light);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--brand-light-border);
  transition: background 0.15s;
}

.promo-teaser a:hover {
  background: rgba(22, 93, 255, 0.14);
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-open-account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(22, 93, 255, 0.28);
  transition: background 0.18s, transform 0.18s, box-shadow 0.18s;
}

.btn-open-account:hover {
  background: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 93, 255, 0.36);
}

.btn-connect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--brand);
  transition: background 0.18s, transform 0.18s;
}

.btn-connect:hover {
  background: var(--brand-light);
  transform: translateY(-2px);
}

/* integration card (hero right column) */
.integration-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
}

.integration-card h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.integration-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}

.integration-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.integration-list li:last-child { border-bottom: none; }

.integration-list li span {
  color: var(--text-muted);
  flex-shrink: 0;
}

.integration-list li strong {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
}

/* ── Section chrome ───────────────────────────────────────── */
.section-wrap {
  padding: 52px 0;
}

.section-wrap:nth-child(even) {
  background: var(--bg-surface-soft);
}

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}

.section-title {
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 32px;
}

/* ── Tier 2: Scorecard ──────────────────────────────────── */
.scorecard-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.scorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

.scorecard-table thead tr {
  background: var(--brand-light);
}

.scorecard-table th {
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
  border-bottom: 1px solid var(--border-subtle);
}

.scorecard-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  line-height: 1.5;
}

.scorecard-table tbody tr:last-child td { border-bottom: none; }

.scorecard-table tbody tr:hover { background: rgba(22, 93, 255, 0.025); }

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
}

.score-high {
  background: rgba(0, 155, 103, 0.1);
  color: var(--success);
}

.score-mid {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.score-yes {
  background: rgba(22, 93, 255, 0.1);
  color: var(--brand);
}

.score-no {
  background: rgba(0,0,0,0.05);
  color: var(--text-muted);
}

.score-quote {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.55;
}

.score-quote cite {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-link {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}

.source-link:hover {
  color: var(--brand-hover);
}

/* ── Tier 3: Pros / Cons ──────────────────────────────────── */
.proscons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.pros-col, .cons-col {
  border-radius: var(--radius-card);
  padding: 28px 30px;
}

.pros-col {
  background: rgba(0, 155, 103, 0.04);
  border: 1px solid rgba(0, 155, 103, 0.18);
}

.cons-col {
  background: rgba(239, 68, 68, 0.03);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.pros-col h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cons-col h3 {
  font-size: 16px;
  font-weight: 700;
  color: #dc2626;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pros-col ul, .cons-col ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 14px;
}

.pros-col li, .cons-col li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pros-col li::before {
  content: "✓";
  flex-shrink: 0;
  color: var(--success);
  font-weight: 700;
  margin-top: 1px;
}

.cons-col li::before {
  content: "✗";
  flex-shrink: 0;
  color: #dc2626;
  font-weight: 700;
  margin-top: 1px;
}

.pros-col li strong, .cons-col li strong {
  color: var(--text-primary);
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

/* ── Tier 4: Reward Matrix ──────────────────────────────────── */
.reward-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  margin-bottom: 48px;
}

.reward-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

.reward-table thead tr {
  background: linear-gradient(90deg, rgba(22, 93, 255, 0.06) 0%, rgba(22, 93, 255, 0.02) 100%);
}

.reward-table th {
  padding: 14px 24px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
}

.reward-table td {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-secondary);
}

.reward-table tbody tr:last-child td { border-bottom: none; }

.reward-table td:last-child {
  font-weight: 700;
  color: var(--success);
}

.reward-table tbody tr:hover { background: rgba(0, 155, 103, 0.025); }

/* ── About narrative ───────────────────────────────────────── */
.about-block {
  max-width: 780px;
  margin-bottom: 48px;
}

.about-block p {
  font-size: 15px;
  line-height: 1.78;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.about-block p:last-child { margin-bottom: 0; }

/* ── Disclaimer ──────────────────────────────────────────── */
.legal-disclaimer {
  padding: 20px 24px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.025);
  border: 1px solid var(--border-subtle);
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ── Footer ──────────────────────────────────────────────── */
.broker-footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0;
}

.broker-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-brand img {
  width: 96px;
  height: auto;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--brand); }

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────────────────── */

/* LG ≤ 1410px */
@media (max-width: 1410px) {
  .mega-menu-panel {
    width: min(980px, calc(100vw - 72px));
  }
}

/* MD ≤ 900px */
@media (max-width: 900px) {
  .hero-layout {
    grid-template-columns: 1fr;
  }

  .proscons-grid {
    grid-template-columns: 1fr;
  }

  .broker-identity {
    flex-direction: column;
    align-items: flex-start;
  }

  .broker-identity-info {
    margin-top: 0;
  }

  .integration-card {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  /* Nav becomes horizontal scroller */
  .nav-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .main-nav {
    order: 3;
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .header-cta {
    margin-left: auto;
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }

  /* Mega-menu pinned left and 2-column on mobile */
  .mega-menu-panel {
    left: 0;
    right: auto;
    transform: translate(0, 10px);
    width: min(680px, calc(100vw - 32px));
    max-height: 70vh;
    overflow-y: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mega-menu:hover .mega-menu-panel,
  .mega-menu:focus-within .mega-menu-panel {
    transform: translate(0, 0);
  }

  /* Supported Brokers dropdown full-width, 2-col on mobile */
  .dropdown-panel {
    width: min(calc(100vw - 32px), 700px);
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
  }

  .dropdown-group--two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supported-brokers-dropdown:hover .dropdown-panel,
  .supported-brokers-dropdown:focus-within .dropdown-panel {
    transform: translateY(0);
  }

  /* Scorecard — hide quote on narrow, show category + score only */
  .scorecard-table .score-quote cite {
    display: none;
  }

  .scorecard-table {
    font-size: 13px;
  }

  .scorecard-table th,
  .scorecard-table td {
    padding: 10px 12px;
  }

  /* Reward table full-width scroll */
  .reward-table-wrap {
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* Footer stack */
  .broker-footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-links {
    gap: 12px;
    flex-direction: column;
  }
}

/* SM ≤ 500px */
@media (max-width: 500px) {
  .content-wrap {
    width: min(calc(100% - 32px), 1164px);
  }

  .broker-hero {
    padding: 24px 0 20px;
  }

  .section-wrap {
    padding: 32px 0;
  }

  .section-title {
    font-size: 20px;
  }

  .hero-cta-row {
    flex-direction: column;
  }

  .btn-open-account,
  .btn-connect {
    width: 100%;
    justify-content: center;
  }

  .main-nav {
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .scorecard-table th,
  .scorecard-table td {
    padding: 8px;
    font-size: 12px;
  }

  /* Hide quote column on very small screens, show only score */
  .scorecard-table td:last-child,
  .scorecard-table th:last-child {
    display: none;
  }

  .scorecard-table td:nth-child(2),
  .scorecard-table th:nth-child(2) {
    width: 30%;
  }

  .pros-col, .cons-col {
    padding: 16px;
  }

  .integration-list li {
    flex-direction: column;
    gap: 2px;
  }

  .integration-list li strong {
    text-align: left;
  }
}
