/* ============================================================
   ACCOUNT SHELL
   Persistent sub-navigation shared by every /Account surface.
   Tokens only (see tokens.css); dark mode is automatic.
   Sits beneath the 72px fixed site navbar (body.has-fixed-nav).
   ============================================================ */

.acct-nav {
  position: sticky;
  /* Abut the scrolled site-nav (padding 14px + ~28px logo ≈ 56px). At 64px an
     ~8px band opened between the navbar's bottom and this bar, letting page
     content bleed through. */
  top: 56px;
  z-index: 900;
  background: color-mix(in srgb, var(--ntl-surface) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ntl-border);
  /* break out of the .container padding so the bar spans edge-to-edge,
     yet the inner content stays aligned to the 1200px grid */
  margin: 0 calc(50% - 50vw) var(--ntl-space-5);
  padding: 0 calc(50vw - 50%);
}

.acct-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--ntl-space-5);
  display: flex;
  align-items: stretch;
  gap: var(--ntl-space-3);
}

/* The full-bleed marketing layouts (_LayoutDashboard / _LayoutMarketStatus) use
   body.ntl-marketing and don't reserve space for the fixed navbar, so push the
   sticky sub-nav clear of it and pin a touch higher to match the compact nav. */
body.ntl-marketing .acct-nav { margin-top: 56px; top: 56px; margin-bottom: 0; }

/* Those pages give their hero a big top padding (140px) to float below the
   translucent navbar. With the sub-nav now sitting above the hero that padding
   becomes a large empty band, so trim it — the sub-nav supplies the offset. */
body.ntl-marketing .section-dashboard { padding-top: var(--ntl-space-6); }
body.ntl-marketing .ms-hero { padding-top: var(--ntl-space-6); }

/* ---- Primary trading-tool tabs (scroll horizontally on narrow screens) ---- */
.acct-nav-tabs {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* old Edge */
}

.acct-nav-tabs::-webkit-scrollbar { display: none; }

.acct-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--ntl-space-2);
  white-space: nowrap;
  padding: var(--ntl-space-4) var(--ntl-space-3);
  font-size: var(--ntl-fs-sm);
  font-weight: 500;
  color: var(--ntl-text-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--ntl-transition-fast), border-color var(--ntl-transition-fast);
}

.acct-nav-link i { font-size: var(--ntl-fs-xs); opacity: 0.85; }

.acct-nav-link:hover {
  color: var(--ntl-text);
  text-decoration: none;
}

.acct-nav-link.is-active {
  color: var(--ntl-blue-text);
  border-bottom-color: var(--ntl-blue);
  font-weight: 600;
}

/* ---- Right-aligned "Account" disclosure menu (native <details>, no JS) ---- */
.acct-menu {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
}

.acct-menu > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--ntl-space-2);
  padding: var(--ntl-space-4) var(--ntl-space-3);
  font-size: var(--ntl-fs-sm);
  font-weight: 500;
  color: var(--ntl-text-2);
  border-bottom: 2px solid transparent;
  transition: color var(--ntl-transition-fast);
}

.acct-menu > summary::-webkit-details-marker { display: none; }
.acct-menu > summary:hover { color: var(--ntl-text); }
.acct-menu[open] > summary { color: var(--ntl-text); }

.acct-menu .acct-caret { transition: transform var(--ntl-transition-fast); }
.acct-menu[open] .acct-caret { transform: rotate(180deg); }

.acct-menu-list {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 230px;
  margin-top: var(--ntl-space-1);
  padding: var(--ntl-space-2);
  background: var(--ntl-surface);
  border: 1px solid var(--ntl-border);
  border-radius: var(--ntl-radius-sm);
  box-shadow: var(--ntl-shadow-md);
  z-index: 950;
}

.acct-menu-label {
  display: block;
  padding: var(--ntl-space-2) var(--ntl-space-3) var(--ntl-space-1);
  font-size: var(--ntl-fs-2xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ntl-text-3);
}

.acct-menu-list a {
  display: flex;
  align-items: center;
  gap: var(--ntl-space-3);
  padding: var(--ntl-space-2) var(--ntl-space-3);
  border-radius: var(--ntl-radius-sm);
  font-size: var(--ntl-fs-sm);
  color: var(--ntl-text);
  text-decoration: none;
  transition: background var(--ntl-transition-fast);
}

.acct-menu-list a:hover { background: var(--ntl-surface-hover); color: var(--ntl-text); }
.acct-menu-list a.is-active { color: var(--ntl-blue-text); font-weight: 600; }
.acct-menu-list a i { width: 16px; text-align: center; color: var(--ntl-text-3); }
.acct-menu-list a.is-active i { color: var(--ntl-blue); }

.acct-menu-divider {
  height: 1px;
  margin: var(--ntl-space-2) var(--ntl-space-1);
  background: var(--ntl-border);
}

/* ---- Standardised page header (composes .ntl-page-* tokens) ---- */
.acct-header-actions {
  display: flex;
  gap: var(--ntl-space-2);
  flex-wrap: wrap;
  margin-top: var(--ntl-space-3);
}

/* ---- Definition list (read-only key/value rows, e.g. sign-in details) ---- */
.acct-deflist > div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ntl-space-2);
  padding: var(--ntl-space-3) 0;
  border-top: 1px solid var(--ntl-border);
}

.acct-deflist > div:first-child { border-top: 0; }

.acct-deflist dt {
  flex: 0 0 160px;
  margin: 0;
  font-size: var(--ntl-fs-sm);
  font-weight: 600;
  color: var(--ntl-text-2);
}

.acct-deflist dd {
  flex: 1 1 220px;
  margin: 0;
  font-size: var(--ntl-fs-sm);
  color: var(--ntl-text);
}

/* ---- Stacked cards (licences) ---- */
.acct-stack { display: flex; flex-direction: column; gap: var(--ntl-space-4); }

.acct-license-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ntl-space-3);
}

.acct-key {
  display: inline-flex;
  align-items: center;
  gap: var(--ntl-space-3);
  margin-top: var(--ntl-space-1);
  padding: var(--ntl-space-2) var(--ntl-space-3);
  background: var(--ntl-bg-subtle);
  border: 1px solid var(--ntl-border);
  border-radius: var(--ntl-radius-sm);
}

.acct-key code {
  font-family: var(--ntl-font-mono);
  font-size: var(--ntl-fs-sm);
  color: var(--ntl-text);
  background: none;
  padding: 0;
}

.acct-key .copy2clpbrd-icon { cursor: pointer; color: var(--ntl-text-3); }
.acct-key .copy2clpbrd-icon:hover { color: var(--ntl-blue); }

/* ---- Empty state ---- */
.acct-empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--ntl-space-3);
  display: grid; place-items: center;
  border-radius: var(--ntl-radius-full);
  background: var(--ntl-blue-dim);
  color: var(--ntl-blue);
  font-size: var(--ntl-fs-xl);
}

/* ---- Call-to-action card (e.g. link MT5 payment) ---- */
.acct-cta {
  display: flex;
  align-items: center;
  gap: var(--ntl-space-4);
  padding: var(--ntl-space-4) var(--ntl-space-5);
  text-decoration: none;
  color: inherit;
}

.acct-cta-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--ntl-radius-sm);
  background: var(--ntl-blue-dim);
  color: var(--ntl-blue);
}

.acct-cta-body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.acct-cta-title { font-weight: 600; color: var(--ntl-text); }
.acct-cta-chevron { color: var(--ntl-text-3); }

/* ---- Tile grid (downloads / resources) ---- */
.acct-grid { display: grid; gap: var(--ntl-space-4); }
.acct-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.acct-tile {
  display: flex;
  align-items: center;
  gap: var(--ntl-space-4);
  padding: var(--ntl-space-4) var(--ntl-space-5);
  text-decoration: none;
  color: inherit;
}

.acct-tile-icon {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--ntl-radius-sm);
  background: var(--ntl-surface-hover);
  color: var(--ntl-text-2);
}

.acct-tile-icon--teal   { background: var(--ntl-info-dim);   color: var(--ntl-info); }
.acct-tile-icon--blue   { background: var(--ntl-blue-dim);   color: var(--ntl-blue); }
.acct-tile-icon--indigo { background: var(--ntl-purple-dim); color: var(--ntl-purple); }

.acct-tile-body { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.acct-tile-title { font-weight: 600; color: var(--ntl-text); }
.acct-tile-action { flex: 0 0 auto; color: var(--ntl-text-3); }

/* ---- Numbered steps ---- */
.acct-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--ntl-space-4); }
.acct-steps li { display: flex; align-items: flex-start; gap: var(--ntl-space-3); }
.acct-steps code { font-family: var(--ntl-font-mono); font-size: var(--ntl-fs-sm); }

.acct-step-num {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: var(--ntl-radius-full);
  background: var(--ntl-blue);
  color: #fff;
  font-size: var(--ntl-fs-xs);
  font-weight: 700;
}

/* Below desktop the full label row is too wide, so collapse the tabs (and the
   Account toggle) to icon-only — the title attribute still gives a hover hint,
   and the active tab keeps its colour + underline. */
@media (max-width: 991.98px) {
  .acct-nav-text { display: none; }
  .acct-nav-link { gap: 0; }
  .acct-menu > summary { gap: var(--ntl-space-1); }
  .acct-nav-link i, .acct-menu > summary > i { font-size: var(--ntl-fs-md); opacity: 1; }
}

@media (max-width: 575.98px) {
  .acct-nav-inner { padding: 0 var(--ntl-space-3); }
  .acct-nav-link, .acct-menu > summary { padding-left: var(--ntl-space-2); padding-right: var(--ntl-space-2); }
  .acct-grid--2 { grid-template-columns: 1fr; }
  /* Keep the account dropdown within the viewport on narrow phones. */
  .acct-menu-list { min-width: 0; max-width: calc(100vw - 24px); }
}
