/* ==========================================================================
   3rader — brand layer
   --------------------------------------------------------------------------
   Loaded after app.css and client.css, so it wins on equal specificity. It does
   two things and nothing else:

   1. Re-points the design tokens in app.css §1 at the 3rader palette. Because
      every colour in the application is already expressed as a token reference,
      this one block re-tones the console, the client platform, the auth pages
      and the admin area at once. No component stylesheet is edited, so nothing
      can break by being re-toned.
   2. Adds the marketing page styles (`.mk-*`), which have no equivalent in the
      application stylesheets because there was no public site before.

   Palette, fixed:
     Deep Black    #0B0F14   page background
     Electric Blue #00A8FF   interactive / accent
     Success/Buy   #22C55E   positive, and the buy direction only
     Sell/Warning  #EF4444   negative, and the sell direction only
     Main Text     #F8FAFC   primary copy

   The intermediate surfaces are steps derived from the deep black, not new
   hues: they lift a card off the page without introducing a second colour.
   ========================================================================== */

:root,
[data-bs-theme="dark"] {
  /* --- Surfaces: a ramp out of #0B0F14 ------------------------------- */
  --c-bg:          #0B0F14;
  --c-surface:     #111820;
  --c-surface-2:   #151E28;
  --c-surface-3:   #1B2634;
  --c-line:        #1E2A36;
  --c-line-soft:   #16202B;

  /* --- Text ---------------------------------------------------------- */
  --c-text:        #F8FAFC;
  --c-text-dim:    #9AA8B8;
  --c-text-faint:  #6B7A8C;

  /* --- Meaning -------------------------------------------------------
     Blue is interaction. Green and red are reserved for direction and
     profit/loss: they are never used decoratively, or a green button would
     read as "buy" on a page where it means "save". */
  --c-accent:      #00A8FF;
  --c-accent-soft: #4DC4FF;
  --c-pos:         #22C55E;
  --c-neg:         #EF4444;
  --c-warn:        #F59E0B;
  --c-info:        #00A8FF;

  /* RGB triplets for the translucent fills, focus rings and glows built from
     the accents above. Kept in step with them by hand — the one place in this
     file where two values must agree. */
  --rgb-accent:  0, 168, 255;
  --rgb-pos:     34, 197, 94;
  --rgb-neg:     239, 68, 68;
  --rgb-warn:    245, 158, 11;
  --rgb-info:    0, 168, 255;
  --rgb-muted:   154, 168, 184;

  --bs-emphasis-color: #FFFFFF;
}

/* Focus visible must stay obvious against the deep background; Bootstrap's
   default ring is a low-contrast indigo once the tokens move. */
:root,
[data-bs-theme="dark"] {
  --bs-focus-ring-color: rgba(var(--rgb-accent), .45);
}

/* Primary buttons. app.css hard-codes an indigo hover and active
   (#5457e5 / #4f46e5) rather than deriving them from --c-accent, so the token
   re-point above cannot reach them and a brand-blue button flashed purple the
   moment it was hovered — on the login, register, pricing and CTA buttons,
   which are the most brand-visible controls on the platform. Re-pointed here at
   the same specificity, which is what loading last is for. */
.btn-primary {
  --bs-btn-hover-bg: var(--c-accent-soft);
  --bs-btn-hover-border-color: var(--c-accent-soft);
  --bs-btn-active-bg: #0090DB;
  --bs-btn-active-border-color: #0090DB;
}

/* A link on the dark surface needs the brighter accent to stay readable at
   body size; --c-accent is tuned for fills and borders. */
a {
  color: var(--c-accent-soft);
}
a:hover {
  color: var(--c-accent);
}

/* --------------------------------------------------------------------------
   Flash messages
   The client shell had no region for these, because nothing flashed inside it
   before the subscription flow. Placed at the top of the content column so a
   "payment received" lands where the reader is already looking.
   -------------------------------------------------------------------------- */
.flash-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: var(--gutter);
}
.flash-stack .alert {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Subscription pages
   -------------------------------------------------------------------------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.plan-card {
  display: flex;
  flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 1.4rem;
}
.plan-card.is-current {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 1px rgba(var(--rgb-accent), .30);
}
.plan-card.is-featured {
  border-color: rgba(var(--rgb-accent), .45);
}

.plan-name {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 0 0 0.25rem 0;
}
.plan-price {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--c-text);
}
.plan-price .unit {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-dim);
}
.plan-desc {
  color: var(--c-text-dim);
  font-size: 0.85rem;
  margin: 0.6rem 0 0.9rem 0;
}
.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem 0;
  font-size: 0.85rem;
  color: var(--c-text-dim);
}
.plan-features li {
  position: relative;
  padding-left: 1.1rem;
  margin-bottom: 0.35rem;
}
.plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-accent);
}

/* --------------------------------------------------------------------------
   Marketing pages
   Self-contained: the public site shares the token layer above but none of the
   application's component classes, so a change to a dashboard card can never
   move something on the homepage.
   -------------------------------------------------------------------------- */
.mk-body {
  background: var(--c-bg);
  color: var(--c-text);
}

.mk-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 20, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.mk-nav-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.mk-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--c-text);
  text-decoration: none;
}
.mk-brand:hover { color: var(--c-text); }
.mk-brand .brand-mark { width: 10px; height: 10px; }

.mk-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}
.mk-links a {
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.mk-links a:hover,
.mk-links a.is-active { color: var(--c-text); }

.mk-nav-toggle { display: none; }

@media (max-width: 860px) {
  /* The links collapse to one row that scrolls rather than a JavaScript menu:
     the whole public site then works with scripting disabled, which also means
     it works for a crawler and for anyone on a locked-down browser. */
  .mk-nav-inner { flex-wrap: wrap; gap: 0.75rem; }
  .mk-links {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }
  .mk-links::-webkit-scrollbar { display: none; }
}

.mk-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.mk-hero {
  padding: 4.5rem 0 3.5rem 0;
}
.mk-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 1rem;
}
.mk-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 750;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1.1rem 0;
  max-width: 20ch;
}
.mk-hero-lede {
  font-size: 1.05rem;
  color: var(--c-text-dim);
  max-width: 60ch;
  margin: 0 0 1.75rem 0;
}

.mk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.mk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--c-line);
}
.mk-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}
.mk-stat-label {
  font-size: 0.78rem;
  color: var(--c-text-faint);
  margin-top: 0.25rem;
}

.mk-section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--c-line);
}
.mk-section-head {
  margin-bottom: 2rem;
  max-width: 62ch;
}
.mk-section-head h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem 0;
}
.mk-section-head p {
  color: var(--c-text-dim);
  margin: 0;
}

.mk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.mk-card {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 1.35rem;
}
.mk-card h3 {
  font-size: 0.98rem;
  font-weight: 650;
  margin: 0 0 0.5rem 0;
}
.mk-card p {
  color: var(--c-text-dim);
  font-size: 0.88rem;
  margin: 0;
}
.mk-card-glyph {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  display: block;
  margin-bottom: 0.7rem;
}

.mk-steps {
  counter-reset: mk-step;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
}
.mk-step {
  counter-increment: mk-step;
  padding-top: 1.1rem;
  border-top: 2px solid var(--c-line);
}
.mk-step::before {
  content: counter(mk-step, decimal-leading-zero);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c-accent);
  margin-bottom: 0.5rem;
}
.mk-step h3 {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 0 0 0.4rem 0;
}
.mk-step p {
  color: var(--c-text-dim);
  font-size: 0.86rem;
  margin: 0;
}

/* Pricing cards on the public page reuse the subscription card, so a price
   cannot be laid out one way on /pricing and another inside the product. */
.mk-price-note {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--c-text-faint);
}

.mk-faq { max-width: 68ch; }
.mk-faq details {
  border-bottom: 1px solid var(--c-line);
  padding: 1rem 0;
}
.mk-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  list-style: none;
}
.mk-faq summary::-webkit-details-marker { display: none; }
.mk-faq summary::before {
  content: "+";
  display: inline-block;
  width: 1.1rem;
  color: var(--c-accent);
  font-weight: 700;
}
.mk-faq details[open] summary::before { content: "–"; }
.mk-faq p {
  color: var(--c-text-dim);
  font-size: 0.88rem;
  margin: 0.6rem 0 0 1.1rem;
}

.mk-preview {
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  background: var(--c-surface);
  overflow: hidden;
}
.mk-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-surface-2);
}
.mk-preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-line);
}
.mk-preview-body { padding: 1.25rem; }

.mk-cta {
  text-align: center;
  padding: 3.5rem 1.25rem;
  border-top: 1px solid var(--c-line);
}
.mk-cta h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem 0;
}
.mk-cta p {
  color: var(--c-text-dim);
  max-width: 56ch;
  margin: 0 auto 1.5rem auto;
}

.mk-foot {
  border-top: 1px solid var(--c-line);
  padding: 2.5rem 0 3rem 0;
  color: var(--c-text-faint);
  font-size: 0.83rem;
}
.mk-foot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.mk-foot h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin: 0 0 0.7rem 0;
}
.mk-foot ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mk-foot li { margin-bottom: 0.45rem; }
.mk-foot a { color: var(--c-text-dim); text-decoration: none; }
.mk-foot a:hover { color: var(--c-accent); }

.mk-disclaimer {
  border-top: 1px solid var(--c-line);
  padding-top: 1.5rem;
  line-height: 1.65;
  max-width: 90ch;
}

/* Legal documents: a readable measure, and headings that do not shout. */
.mk-doc { max-width: 74ch; padding: 2.5rem 0 4rem 0; }
.mk-doc h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem 0;
}
.mk-doc h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin: 2.2rem 0 0.7rem 0;
}
.mk-doc h3 {
  font-size: 0.95rem;
  font-weight: 650;
  margin: 1.5rem 0 0.5rem 0;
}
.mk-doc p,
.mk-doc li {
  color: var(--c-text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}
.mk-doc strong { color: var(--c-text); }
.mk-doc ul { padding-left: 1.15rem; }
.mk-doc li { margin-bottom: 0.4rem; }
.mk-doc-date {
  color: var(--c-text-faint);
  font-size: 0.82rem;
  margin-bottom: 2rem;
}
.mk-callout {
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
}
.mk-callout.is-warning { border-left-color: var(--c-neg); }
.mk-callout p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------- #
   Account settings — avatar panel
   --------------------------------------------------------------------------- #
   One image at a fixed size, or initials when there is none. The initials
   variant is drawn here rather than in the template so a missing picture is a
   styled block, not a broken-icon request. */
.avatar-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
.avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--c-line);
  background: var(--c-surface-2);
  flex: none;
}
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  color: var(--c-accent);
  letter-spacing: 0.02em;
  user-select: none;
}

/* The account chip in the client topbar. Sized to the topbar's pills rather
   than to the avatar panel, and hidden on narrow screens where the topbar
   already wraps. */
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0.6rem 0.15rem 0.15rem;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-surface-2);
  color: var(--c-text-dim);
  text-decoration: none;
  font-size: 0.82rem;
  max-width: 14rem;
}
.account-chip:hover { color: var(--c-text); border-color: var(--c-line); }
.account-chip-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.account-chip-initials {
  background: var(--c-surface-3);
  color: var(--c-accent);
  font-weight: 600;
  font-size: 0.8rem;
}
.account-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 860px) {
  .account-chip-name { display: none; }
  .account-chip { padding-right: 0.15rem; }
}
