@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cairo:wght@400;500;600;700;800&display=swap');

/* ═══════════════════════════════════════════════════════════════════════════
   portal_ui.css — the portal's views_new pages on the shared Brand layer.

   Loaded LAST on every views_new page, right after brand.css (Brand Part 1, an exact copy of the CRM's
   crm_tokens.css). Sizes are the CRM new UI's (crm_new_ui/assets/css/crm_components.css + crm_shell.css):
     button 14px / 10×16 / radius 8 · small button 12.5px / 6×11 · input 11×13 / radius 8 · label 12.5px 600 muted
     card radius 10 / padding 18 (auth card 24) · card title 16px 700 · page title 19px 700 · badge 11.5px
     alert 13.5px / 11×14 · focus ring 3px var(--focus)
   Markup and behaviour of the pages are unchanged — this file only maps the portal classes onto those tokens.
   Replaces the earlier invest-auth.css (its --iv-* colours are the same Brand tokens).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Base ─────────────────────────────────────────────────────────────────── */
/* Backgrounds (ticker charts, background image, artwork) stay exactly as the pages draw them. */
body.mlogin, body.mauth { color: var(--text); }
body.mlogin, body.mauth { font-family: var(--font) !important; font-size: 14px; line-height: 1.5; }
body.mlogin *, body.mauth * { font-family: inherit; }
body.mlogin .mdi, body.mauth .mdi { font-family: 'Material Design Icons'; }

/* ── Layout ──
   Login (desktop): two sections like the live portal — marketing panel on the left, sign-in card on the right.
   Registration / forgot / change password / verify: one centred card (registration is a wide two-column card). */
body.mauth .vshell__body--split { display: flex !important; flex-direction: column; }
body.mauth .vshell__panel { display: none !important; }
body.mauth .vshell__content .mauth__main { justify-content: center !important; }
body.mauth .vshell__body--split .mauth__footer .mauth__risk { display: block !important; }
@media (min-width: 900px) {
  body.mlogin .vshell__body--split {
    display: grid !important; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center;
    width: 100%; max-width: 1216px; margin: 0 auto; padding: 0 32px; box-sizing: border-box;
  }
  body.mlogin .vshell__panel {
    display: flex !important; flex-direction: column; justify-content: center; gap: 28px; color: var(--text) !important;
    position: relative; isolation: isolate; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important;
  }
  /* No box: an edgeless halo of the page colour behind the text keeps it readable over the ticker background */
  body.mlogin .vshell__panel::before {
    content: ""; position: absolute; inset: -90px -120px -90px -140px; z-index: -1; pointer-events: none;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--bg) 92%, transparent) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 55%, transparent 100%);
  }
  body.mlogin .vshell__panel-mid, body.mlogin .vshell__panel-bottom { gap: 18px !important; backdrop-filter: none !important; }
  body.mlogin .vshell__panel-title {
    color: var(--text) !important; font-size: 40px !important; font-weight: 800 !important; line-height: 1.15 !important; letter-spacing: -.02em !important;
    max-width: 520px; text-shadow: none !important;
  }
  body.mlogin .vshell__panel-sub { color: var(--muted) !important; font-size: 15px !important; line-height: 1.6 !important; max-width: 440px; text-shadow: none !important; }
  /* CTA = CRM .btn.btn-primary at hero size */
  body.mlogin .vshell__panel-cta {
    display: inline-flex !important; align-items: center; gap: 8px; padding: 12px 22px !important; border: 1px solid transparent !important;
    border-radius: var(--radius-sm) !important; background: var(--grad) !important; color: #fff !important;
    font-size: 14.5px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important;
    box-shadow: var(--btn-glow) !important; transform: none !important; transition: filter var(--t) !important; text-decoration: none !important;
  }
  body.mlogin .vshell__panel-cta:hover { filter: brightness(1.1); transform: none !important; }
  body.mlogin .vshell__panel-bottom { max-width: 440px; }
  body.mlogin .vshell__panel-risk {
    color: var(--muted) !important; font-size: 12.5px !important; line-height: 1.6 !important;
    border-top: 1px solid var(--border) !important; padding-top: 16px !important; text-shadow: none !important;
  }
  body.mlogin .vshell__content .mlogin__main { justify-content: flex-end !important; align-items: center; padding: 0 !important; }
  /* The panel carries the sign-up button, so inside the card it's a one-line link (as on the live portal) */
  body.mlogin .vshell__body--split:has(.vshell__panel) .mlogin__signup { display: block !important; border-top: 0 !important; padding-top: 0 !important; margin-top: 14px !important; }
  body.mlogin .vshell__body--split:has(.vshell__panel) .mlogin__signup a {
    display: inline !important; width: auto !important; min-height: 0 !important; padding: 0 !important; border: 0 !important;
    background: none !important; color: var(--primary-2) !important; font-size: 13px !important; margin-inline-start: 4px; white-space: nowrap;
  }
  body.mlogin .vshell__body--split:has(.vshell__panel) .mlogin__signup a:hover { text-decoration: underline !important; }
  /* risk text already shown in the panel */
  body.mlogin .vshell__body--split:has(.vshell__panel) ~ .mlogin__footer .mlogin__risk,
  body.mlogin .vshell__body--split:has(.vshell__panel) .mlogin__footer .mlogin__risk { display: none !important; }
}

/* ── Top bar: logo + language + theme (CRM .icon-btn / small ghost button) ── */
.mlogin__topbar, .mauth__topbar { gap: 10px; }
.mlogin__logo img, .mauth__logo img { max-height: 40px; width: auto; }
.mlogin__lang-btn, .mauth__lang-btn {
  height: 38px !important; padding: 0 12px !important; display: inline-flex !important; align-items: center; gap: 8px;
  border-radius: 10px !important; border: 1px solid var(--border) !important; background: var(--surface-2) !important;
  color: var(--text) !important; font-size: 12.5px !important; font-weight: 600 !important; box-shadow: none !important;
  transition: border-color var(--t), background var(--t);
}
.mlogin__lang-btn:hover, .mauth__lang-btn:hover { border-color: var(--primary) !important; background: var(--surface-3) !important; }
.mlogin__lang-btn img, .mauth__lang-btn img { width: 18px; height: auto; border-radius: 2px; }
[class*="theme-toggle"], .mlogin__theme-btn, .mauth__theme-btn {
  width: 38px !important; height: 38px !important; display: inline-grid !important; place-items: center;
  border-radius: 10px !important; border: 1px solid var(--border) !important; background: var(--surface-2) !important;
  color: var(--text) !important; box-shadow: none !important; transition: border-color var(--t), background var(--t);
}
[class*="theme-toggle"]:hover { border-color: var(--primary) !important; background: var(--surface-3) !important; }
.mlogin__lang-menu, .mauth__lang-menu {
  border-radius: var(--radius) !important; border: 1px solid var(--border) !important; background: var(--surface) !important;
  box-shadow: var(--shadow-lg) !important; padding: 6px !important;
}
.mlogin__lang-menu li, .mauth__lang-menu li { border-radius: var(--radius-sm); padding: 8px 10px !important; font-size: 13.5px; color: var(--text); }
.mlogin__lang-menu li:hover, .mauth__lang-menu li:hover { background: var(--surface-2); }
.mlogin__lang-menu li.is-selected, .mauth__lang-menu li.is-selected { background: var(--surface-3); color: var(--primary-2); font-weight: 600; }

/* ── Card (CRM .card, a little more air on sign-in pages) ── */
.mlogin__card, .mauth__card, .vshell__content .mlogin__card, .vshell__content .mauth__card {
  background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important; width: 100% !important; max-width: 440px !important; padding: 24px !important;
  animation: pui-rise .4s cubic-bezier(.16, 1, .3, 1) both;
}
.mauth__card { max-width: 520px !important; }
@keyframes pui-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.mlogin__title, .mauth__title, .vshell__content .mlogin__title, .vshell__content .mauth__title {
  color: var(--text) !important; font-size: 19px !important; font-weight: 700 !important; letter-spacing: 0 !important; margin: 0 0 4px !important;
}
.mlogin__subtitle, .mauth__subtitle { color: var(--muted) !important; font-size: 13px !important; margin: 0 0 18px !important; }

/* ── Fields: label ABOVE the control, like the CRM (.field / .input) ──
   Floating-label markup (input + label) and static markup (label + control) both render the same way. */
.mlogin__field, .mauth__field {
  position: relative; display: flex !important; flex-direction: column; gap: 6px; margin: 0 0 14px !important; height: auto !important;
}
.mlogin__field > label, .mauth__field > label {
  order: -1; position: static !important; transform: none !important; inset: auto !important; pointer-events: auto;
  font-size: 12.5px !important; font-weight: 600 !important; color: var(--muted) !important; text-transform: none !important;
  letter-spacing: 0 !important; line-height: 1.3; margin: 0 !important; padding: 0 !important; background: none !important;
}
.mlogin__field input:focus + label, .mauth__field input:focus + label,
.mlogin__field input:not(:placeholder-shown) + label, .mauth__field input:not(:placeholder-shown) + label { color: var(--muted) !important; font-size: 12.5px !important; transform: none !important; }
.mlogin__field input, .mauth__field input, .mauth__field select, .mauth__field textarea, .mauth__phone input {
  width: 100%; height: auto !important; min-height: 44px; padding: 11px 13px !important;
  background: var(--surface-2) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important;
  color: var(--text) !important; font-size: 14px !important; line-height: 1.4 !important; box-shadow: none !important; outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.mlogin__field input:hover, .mauth__field input:hover, .mauth__field select:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)) !important; }
.mlogin__field input:focus, .mauth__field input:focus, .mauth__field select:focus, .mauth__field textarea:focus, .mauth__phone input:focus {
  border-color: var(--primary) !important; box-shadow: 0 0 0 3px var(--focus) !important; background: var(--surface-2) !important;
}
.mlogin__field input::placeholder, .mauth__field input::placeholder { color: var(--muted); opacity: .7; }
.mauth__field select { appearance: none; -webkit-appearance: none; padding-inline-end: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23647087' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 12px center !important; }
[dir="rtl"] .mauth__field select { background-position: left 12px center !important; }
.mauth__phone { display: grid !important; grid-template-columns: 96px 1fr; gap: 8px; }
.mauth__phone .mauth__phone-code, .mauth__phone .mauth__phone-number { width: 100% !important; min-width: 0; flex: none; }
.mauth__phone-code { text-align: center; font-weight: 600 !important; }
.mauth__error-text { font-size: 12px !important; color: var(--sell) !important; margin-top: -8px; margin-bottom: 10px; }
.mauth__error-text:empty { display: none; }
/* Show / hide password: CRM small ghost button inside the input */
.mlogin__field .mlogin__toggle-pwd, .mauth__field .mauth__toggle-pwd {
  position: absolute !important; inset-inline-end: 8px; bottom: 8px; top: auto !important; transform: none !important;
  height: 28px; padding: 0 9px !important; border-radius: 6px !important; border: 1px solid var(--border) !important;
  background: var(--surface) !important; color: var(--muted) !important; font-size: 11.5px !important; font-weight: 700 !important;
  text-transform: uppercase; letter-spacing: .03em;
}
.mlogin__toggle-pwd:hover, .mauth__toggle-pwd:hover { color: var(--primary-2) !important; border-color: var(--primary) !important; }
.mlogin__field input[type="password"], .mlogin__field input#password { padding-inline-end: 72px !important; }

/* Check boxes (accept terms…) */
.mauth__check { display: flex !important; gap: 10px; align-items: flex-start; font-size: 13px !important; color: var(--muted) !important; line-height: 1.5; margin: 4px 0 16px !important; }
.mauth__check input[type="checkbox"] { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex: none; }

/* ── Links ── */
.mlogin__forgot-row, .mauth__forgot-row { display: flex; justify-content: flex-end; margin: -4px 0 16px !important; }
.mlogin__forgot-row a, .mauth__forgot-row a, .mauth__card a:not(.mauth__submit):not([class*="btn"]), .mauth__check a {
  color: var(--primary-2) !important; font-size: 13px; font-weight: 600; text-decoration: none;
}
.mlogin__forgot-row a:hover, .mauth__card a:not(.mauth__submit):hover { text-decoration: underline; }

/* ── Primary button = CRM .btn.btn-primary.btn-block ── */
.mlogin__submit, .mauth__submit {
  width: 100%; height: auto !important; min-height: 44px; padding: 10px 16px !important; border: 1px solid transparent !important;
  border-radius: var(--radius-sm) !important; background: var(--grad) !important; color: #fff !important;
  font-size: 14px !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; line-height: 1.2;
  box-shadow: var(--btn-glow) !important; cursor: pointer; transition: filter var(--t) !important; transform: none !important;
}
.mlogin__submit:hover:not(:disabled), .mauth__submit:hover:not(:disabled) { filter: brightness(1.1); transform: none !important; }
.mlogin__submit:active:not(:disabled), .mauth__submit:active:not(:disabled) { filter: brightness(.95); transform: none !important; }
.mlogin__submit:disabled, .mauth__submit:disabled { opacity: .55; cursor: not-allowed; filter: none; }

/* ── "Open an account" = CRM .btn.btn-ghost.btn-block (was a dark slate button with purple text) ── */
.mlogin__signup, .mauth__signup {
  display: grid !important; gap: 8px; margin-top: 18px !important; padding: 16px 0 0 !important; border: 0 !important;
  border-top: 1px solid var(--border) !important; background: transparent !important; box-shadow: none !important;
  color: var(--muted) !important; font-size: 13px !important; text-align: center;
}
.mlogin__signup a, .mauth__signup a {
  display: inline-flex !important; align-items: center; justify-content: center; width: 100% !important; max-width: none !important; min-height: 44px; padding: 10px 16px !important;
  border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; background: transparent !important;
  color: var(--text) !important; font-size: 14px !important; font-weight: 600 !important; text-transform: none !important;
  letter-spacing: 0 !important; text-decoration: none !important; box-shadow: none !important; transition: background var(--t), border-color var(--t);
}
.mauth__card .mauth__signup a:not(.mauth__submit):not([class*="btn"]), .mlogin__card .mlogin__signup a { color: var(--text) !important; font-size: 14px; }
.mlogin__signup a:hover, .mauth__signup a:hover { background: var(--surface-2) !important; border-color: var(--primary) !important; }
.mlogin__signup--link a { border: 0 !important; min-height: 0; padding: 0 !important; color: var(--primary-2) !important; width: auto; }

/* ── Alerts = CRM .alert.err ── */
.mlogin__error, .mauth__error {
  padding: 11px 14px !important; border-radius: var(--radius-sm) !important; font-size: 13.5px !important; margin-bottom: 14px;
  background: var(--sell-bg) !important; color: var(--sell) !important; border: 1px solid color-mix(in srgb, var(--sell) 30%, transparent) !important;
}
.mlogin__error:empty, .mauth__error:empty { display: none !important; }

/* ── Footer ── */
.mlogin__footer, .mauth__footer { color: var(--muted) !important; }
.mlogin__risk, .mauth__risk { background: transparent !important; border: 0 !important; color: var(--muted) !important; font-size: 12px !important; line-height: 1.6; }
.mlogin__desktop-link, .mauth__desktop-link { color: var(--muted) !important; font-size: 12.5px !important; font-weight: 600; }

/* ── Phones ── */
@media (max-width: 560px) {
  .mlogin__card, .mauth__card, .vshell__content .mlogin__card, .vshell__content .mauth__card { padding: 18px !important; border-radius: var(--radius) !important; }
  .mlogin__title, .mauth__title { font-size: 18px !important; }
  .mauth__phone { grid-template-columns: 84px 1fr; }
}
@media (prefers-reduced-motion: reduce) { .mlogin__card, .mauth__card { animation: none; } }

/* ── Registration on laptops / desktops: two columns so the whole form fits without scrolling ──
   (markup unchanged: the fields are direct children of #registrationform) */
@media (min-width: 900px) {
  body.mauth .mauth__card:has(#registrationform) { max-width: 540px !important; }
  /* compact rhythm so the narrow card still fits a laptop screen without scrolling */
  #registrationform > .mauth__field { margin-bottom: 12px !important; }
  #registrationform .mauth__field input, #registrationform .mauth__field select { min-height: 42px; padding-top: 10px !important; padding-bottom: 10px !important; }
  #registrationform .mauth__phone { grid-template-columns: 78px 1fr; gap: 6px; }
  /* email gets a full row, so phone + language share the next one (no empty half-row) */
  #registrationform > .mauth__field:has(#email), #registrationform > .mauth__field:has(input[type="email"]) { grid-column: 1 / -1; }
  #registrationform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; align-items: start; }
  #registrationform > input[type="hidden"] { display: none; }
  #registrationform > .mauth__check, #registrationform > .mauth__recaptcha, #registrationform > .mauth__submit,
  #registrationform > #registration_questions_body, #registrationform > .mauth__error, #registrationform > .mauth__error-text,
  #registrationform > p, #registrationform > .mauth__field--full { grid-column: 1 / -1; }
  #registrationform > #registration_questions_body:empty, #registrationform > .mauth__recaptcha:empty { display: none; }
  #registrationform > .mauth__submit { justify-self: stretch; }
  body.mauth .mauth__card:has(#registrationform) .mauth__subtitle { margin-bottom: 14px !important; }
  body.mauth .vshell__content .mauth__main { padding-top: 8px !important; padding-bottom: 8px !important; }
}
@media (min-width: 900px) {
  /* Compact top bar on the registration page, and the "already have an account? Log in" row as one line */
  body.mauth:has(#registrationform) .mauth__topbar { padding-top: 14px !important; padding-bottom: 0 !important; min-height: 0 !important; }
  body.mauth:has(#registrationform) .vshell__content .mauth__main { margin-top: 0 !important; padding-top: 12px !important; }
  body.mauth:has(#registrationform) .mauth__card { margin-top: 0 !important; }
}
/* Empty captcha slot (captcha off) takes no space; sign-up row stays on one line */
.mauth__recaptcha:has(#recaptcha_box:empty), .mlogin__recaptcha:has(#recaptcha_box:empty) { margin: 0 !important; }
@media (min-width: 900px) {
  /* Panel and card line up with the top bar edges (logo left, language / theme right) */
  body.mlogin .vshell__body--split > .vshell__panel, body.mlogin .vshell__body--split > .vshell__content { margin: 0 !important; padding-left: 0; padding-right: 0; }
  body.mlogin .vshell__content .mlogin__card { margin-inline: 0 !important; }
}
@media (min-width: 900px) {
  body.mlogin .vshell__body--split { max-width: 1152px !important; padding: 0 !important; }
}

/* ── Logo in dark mode ── same as the Sahmee trading platform (tradingplatform/assets/css/app.css .logo-white):
   whichever logo shows is turned white in code — filter: brightness(0) invert(1) — never a white patch behind it.
   A soft blurred glow under it lifts it off the background. */
[data-theme="dark"] .mlogin__logo img, [data-theme="dark"] .mauth__logo img {
  background: none !important; padding: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
  filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(255, 255, 255, .35)) drop-shadow(0 0 18px color-mix(in srgb, var(--primary) 45%, transparent)) !important;
}

/* QR code button = the other top-bar buttons (CRM .icon-btn) — was a white disc in dark mode */
.mauth__qr-btn {
  width: 38px !important; height: 38px !important; display: inline-grid !important; place-items: center; padding: 0 !important;
  border-radius: 10px !important; border: 1px solid var(--border) !important; background: var(--surface-2) !important;
  color: var(--text) !important; box-shadow: none !important; transition: border-color var(--t), background var(--t);
}
.mauth__qr-btn:hover { border-color: var(--primary) !important; background: var(--surface-3) !important; }
.mauth__back {
  width: 38px; height: 38px; display: inline-grid !important; place-items: center; border-radius: 10px !important;
  border: 1px solid var(--border) !important; background: var(--surface-2) !important; color: var(--text) !important;
  text-decoration: none !important; font-size: 18px; box-shadow: none !important;
}
.mauth__back:hover { border-color: var(--primary) !important; }

/* "Back to login page · Login" (registration, forgot, change password): one quiet line like the login card's
   "You don't have an online account yet? Open an account now" — no divider, no bordered box */
body.mauth .mauth__card .mauth__signup {
  display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 6px;
  margin-top: 16px !important; padding-top: 0 !important; border-top: 0 !important; font-size: 13px !important; color: var(--muted) !important;
}
body.mauth .mauth__card .mauth__signup a, body.mauth .mauth__card .mauth__signup a:not(.mauth__submit):not([class*="btn"]) {
  display: inline !important; width: auto !important; min-height: 0 !important; padding: 0 !important; border: 0 !important;
  background: none !important; box-shadow: none !important; color: var(--primary-2) !important;
  font-size: 13px !important; font-weight: 600 !important; text-decoration: none !important;
}
body.mauth .mauth__card .mauth__signup a:hover { text-decoration: underline !important; background: none !important; }


/* ═══ Sign-in background: "modern" (Company › Branding › Client portal › Sign-in background) ═══
   Pure CSS, built from the theme's colours, so it follows each company's palette and light / dark mode:
   drifting aurora glows (primary / second / accent) · fine fading grid · a brand-gradient market line with a soft area
   under it. "classic" (html[data-auth-bg="classic"]) keeps the original ticker background untouched. */
html[data-auth-bg="modern"] body.mlogin, html[data-auth-bg="modern"] body.mauth { background: var(--bg) !important; }
html[data-auth-bg="modern"] :is(body.mlogin, body.mauth) .vshell { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; }
/* aurora */
html[data-auth-bg="modern"] :is(body.mlogin, body.mauth) .vshell::before {
  content: "" !important; display: block !important; position: fixed !important; inset: -15% !important; z-index: -2 !important; pointer-events: none;
  background:
    radial-gradient(38% 34% at 16% 20%, color-mix(in srgb, var(--primary) 34%, transparent), transparent 70%),
    radial-gradient(32% 36% at 86% 16%, color-mix(in srgb, var(--cyan) 24%, transparent), transparent 70%),
    radial-gradient(44% 40% at 68% 92%, color-mix(in srgb, var(--primary-2) 28%, transparent), transparent 70%) !important;
  background-size: auto !important; background-image: none; opacity: .75; filter: blur(30px);
  animation: pui-aurora 26s ease-in-out infinite alternate;
}
:root[data-theme="dark"][data-auth-bg="modern"] :is(body.mlogin, body.mauth) .vshell::before { opacity: 1; }
/* fine grid, fading out towards the edges */
html[data-auth-bg="modern"] :is(body.mlogin, body.mauth) .vshell::after {
  content: "" !important; display: block !important; position: fixed !important; inset: 0 !important; z-index: -1 !important; pointer-events: none;
  background:
    linear-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(90deg, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px) 0 0 / 46px 46px !important;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 25%, transparent 78%);
  opacity: 1; filter: none;
}
/* market line (brand gradient) + soft area under it */
html[data-auth-bg="modern"] body.mlogin::before, html[data-auth-bg="modern"] body.mauth::before,
html[data-auth-bg="modern"] body.mlogin::after, html[data-auth-bg="modern"] body.mauth::after {
  content: "" !important; display: block !important; position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important;
  height: 46vh !important; width: auto !important; z-index: 0 !important; pointer-events: none; transform: none !important; animation: none !important;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; filter: none !important;
}
html[data-auth-bg="modern"] body.mlogin::before, html[data-auth-bg="modern"] body.mauth::before {
  background: var(--grad) !important; opacity: .55 !important;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cpath d='M0 318 C 90 300 150 330 230 296 S 360 238 440 262 S 560 318 650 270 S 790 168 880 196 S 1010 262 1090 214 S 1230 98 1310 120 S 1410 86 1440 70' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cpath d='M0 318 C 90 300 150 330 230 296 S 360 238 440 262 S 560 318 650 270 S 790 168 880 196 S 1010 262 1090 214 S 1230 98 1310 120 S 1410 86 1440 70' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}
html[data-auth-bg="modern"] body.mlogin::after, html[data-auth-bg="modern"] body.mauth::after {
  background: linear-gradient(to bottom, color-mix(in srgb, var(--primary) 22%, transparent), transparent 90%) !important; opacity: 1 !important;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cpath d='M0 318 C 90 300 150 330 230 296 S 360 238 440 262 S 560 318 650 270 S 790 168 880 196 S 1010 262 1090 214 S 1230 98 1310 120 S 1410 86 1440 70 L 1440 400 L 0 400 Z' fill='%23000'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 400' preserveAspectRatio='none'%3E%3Cpath d='M0 318 C 90 300 150 330 230 296 S 360 238 440 262 S 560 318 650 270 S 790 168 880 196 S 1010 262 1090 214 S 1230 98 1310 120 S 1410 86 1440 70 L 1440 400 L 0 400 Z' fill='%23000'/%3E%3C/svg%3E");
}
html[data-auth-bg="modern"] :is(body.mlogin, body.mauth) .vshell > * { position: relative; z-index: 1; }
@keyframes pui-aurora {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2%, -2%, 0) scale(1.05); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { html[data-auth-bg="modern"] :is(body.mlogin, body.mauth) .vshell::before { animation: none; } }
/* the login hero halo blends into the modern background instead of the ticker */
html[data-auth-bg="modern"] body.mlogin .vshell__panel::before { opacity: .55; }

:root[data-theme="dark"][data-auth-bg="modern"] body.mlogin::after, :root[data-theme="dark"][data-auth-bg="modern"] body.mauth::after { background: linear-gradient(to bottom, color-mix(in srgb, var(--primary) 32%, transparent), transparent 90%) !important; }
:root[data-theme="dark"][data-auth-bg="modern"] body.mlogin::before, :root[data-theme="dark"][data-auth-bg="modern"] body.mauth::before { opacity: .85 !important; }

/* ═══ Risk disclosure (views_new/risk_disclosure.php, .mrd__*) — its inline navy palette mapped onto the Brand tokens ═══ */
body:has(.mrd__header) { --brand: var(--primary); --brand-light: var(--surface-3); background: var(--bg) !important; color: var(--text) !important; font-family: var(--font) !important; }
.mrd__header {
  background: color-mix(in srgb, var(--surface) 88%, transparent) !important; border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--text) !important;
}
.mrd__title { color: var(--text) !important; font-size: 16px !important; font-weight: 700 !important; letter-spacing: 0 !important; }
.mrd__print-btn {
  display: inline-flex !important; align-items: center; gap: 8px; padding: 6px 11px !important; border-radius: 8px !important;
  border: 1px solid var(--border) !important; background: transparent !important; color: var(--text) !important;
  font-size: 12.5px !important; font-weight: 600 !important; box-shadow: none !important; cursor: pointer;
}
.mrd__print-btn:hover { background: var(--surface-2) !important; border-color: var(--primary) !important; }
.mrd__doc-card { background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow) !important; }
.mrd__content { color: var(--text) !important; }
.mrd__content :is(h1, h2, h3, h4, h5, h6):not([style*="color"]):not([class*="bg-"]) { color: var(--text) !important; font-weight: 700; }
.mrd__content a { color: var(--primary-2) !important; }
.mrd__content hr { border-color: var(--border) !important; background: var(--border) !important; }
.mrd__content table { border-color: var(--border) !important; color: var(--text) !important; }
.mrd__content td, .mrd__content th { border-color: var(--border) !important; color: var(--text) !important; background: transparent !important; }
.mrd__content th { background: var(--surface-3) !important; font-weight: 700; }
.mrd__content tr:nth-child(even) td { background: var(--surface-2) !important; }
.mrd__footer-stamp { color: var(--muted) !important; border-color: var(--border) !important; }
/* dark mode: the logo is whitened in code (same as the trading platform), no light patch behind it or behind content images */
[data-theme="dark"] .mrd__logo { background: none !important; padding: 0 !important; box-shadow: none !important; filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(255, 255, 255, .3)) !important; }
/* the old dark-mode rules (mobile-dark.css §risk disclosure) paint fixed navy colours — use the tokens instead */
[data-theme="dark"] body:has(.mrd__header) { background: var(--bg) !important; }
[data-theme="dark"] .mrd__header { background: color-mix(in srgb, var(--surface) 88%, transparent) !important; }
.mrd__body, [data-theme="dark"] .mrd__body { background: transparent !important; }
[data-theme="dark"] .mrd__doc-card { background: var(--surface) !important; border-color: var(--border) !important; }
.mrd__content, [data-theme="dark"] .mrd__content { background: transparent !important; color: var(--text) !important; }
/* text the document colours itself (e.g. the white-on-red notice banner) keeps its colour */
[data-theme="dark"] .mrd__content :is(p, li, span, strong, b, h1, h2, h3, h4, h5, h6):not([style*="color"]):not([class*="bg-"]) { color: var(--text) !important; }
/* coloured blocks of the document template (bg-danger, bg-primary…) keep white text */
.mrd__content [class*="bg-"]:not(.bg-light):not(.bg-white):not(.bg-transparent) { color: #fff !important; }
[data-theme="dark"] .mrd__content th { background: var(--surface-3) !important; }
[data-theme="dark"] .mrd__content tr:nth-child(even) td { background: var(--surface-2) !important; }
[data-theme="dark"] .mrd__footer-stamp { color: var(--muted) !important; }

/* Light / dark toggle (#mobile-theme-toggle, injected by theme.js on every page) = CRM icon button in the theme colours.
   html:root #id outranks mobile-dark.css ("[data-theme=dark] #mobile-theme-toggle", old navy #1a2235). */
html:root #mobile-theme-toggle {
  width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); box-shadow: none; transition: background var(--t, .15s), border-color var(--t, .15s);
}
html:root #mobile-theme-toggle:hover { background: var(--surface-3); border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
html:root #mobile-theme-toggle:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); }
html:root #mobile-theme-toggle svg { color: var(--text); }
