/* /demo page. Built on ds.css tokens and bx-* components; shared header/footer come from site.css. */

[hidden] { display: none !important; }
.dm-wrap { max-width: 1080px; margin: 0 auto; padding: 40px 24px 72px; display: flex; flex-direction: column; gap: 24px; }
.dm-wrap h1 { margin: 0; font-size: 40px; line-height: 46px; font-weight: 650; letter-spacing: -0.03em; }
.dm-wrap h1:focus { outline: none; }
.dm-wrap h2 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.dm-wrap .dm-h2 { font-size: 24px; line-height: 32px; letter-spacing: -0.02em; }
.dm-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dm-stack { display: flex; flex-direction: column; gap: 10px; }
.dm-stack-lg { display: flex; flex-direction: column; gap: 16px; }
.dm-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.dm-label { font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.dm-note { margin: 0; font-size: 12px; line-height: 18px; color: var(--muted-foreground); }
code { font-family: var(--font-mono); font-size: 13px; color: var(--sky); background: #0B1118; padding: 1px 6px; border-radius: 4px; }

/* Stepper: "where am I" in the setup */
.dm-stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.dm-stepper li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 9999px; border: 1px solid var(--border); color: var(--muted-foreground); font-size: 13px; font-weight: 500; }
.dm-stepper li span { width: 22px; height: 22px; border-radius: 9999px; display: inline-grid; place-items: center; background: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.dm-stepper li[data-state="done"] { color: var(--foreground); }
.dm-stepper li[data-state="done"] span { background: var(--profit-soft); color: var(--profit); }
.dm-stepper li[aria-current="step"] { color: var(--foreground); border-color: var(--sky); }
.dm-stepper li[aria-current="step"] span { background: var(--sky); color: var(--primary-foreground); }

/* Loading skeleton (no layout jump when content arrives) */
.dm-skel { display: flex; flex-direction: column; gap: 14px; }
.dm-skel-row { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }

/* Logged out: pitch + login card side by side */
.dm-split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.dm-hero { display: flex; flex-direction: column; gap: 14px; }
.dm-hero p { margin: 0; font-size: 17px; line-height: 27px; }
.dm-points { font-size: 15px; line-height: 23px; gap: 10px; margin-top: 4px; }
.dm-login { max-width: 440px; width: 100%; justify-self: end; }
.dm-tg-btn { background: #1B6FA8; color: #fff; border-color: transparent; font-weight: 600; }  /* white on it: 5.2:1 */
.dm-tg-btn:hover { background: #175F90; color: #fff; }
.dm-tg-btn svg { width: 18px; height: 18px; }
.dm-or { display: flex; align-items: center; gap: 12px; color: var(--muted-foreground); font-size: 12px; }
.dm-or::before, .dm-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.dm-msg { margin: 0; font-size: 14px; line-height: 20px; padding: 10px 12px; border-radius: 8px; background: #121B26; border: 1px solid #2B4462; }
.dm-msg[data-kind="ok"] { border-color: #1E5A3F; background: var(--profit-soft); color: var(--profit); }
.dm-msg[data-kind="error"] { border-color: #5A2A2E; background: var(--loss-soft); color: var(--loss); }

/* Connect */
.dm-head { display: flex; flex-direction: column; gap: 8px; }
.dm-head p { margin: 0; }
.dm-head-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.dm-back { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; color: var(--sky); font-size: 14px; font-weight: 500; text-decoration: none; }
.dm-back:hover { text-decoration: underline; text-underline-offset: 3px; }
.dm-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 23px; color: #C9D5E2; }
.dm-steps b { color: var(--foreground); }

/* Checking */
.dm-narrow { max-width: 560px; margin: 0 auto; width: 100%; }
.dm-narrow p { margin: 0; }
.dm-indeterminate { height: 4px; border-radius: 9999px; background: var(--muted); overflow: hidden; }
.dm-indeterminate div { width: 35%; height: 100%; border-radius: inherit; background: var(--sky); animation: dm-slide 1.4s ease-in-out infinite; }
@keyframes dm-slide { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
.dm-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted-foreground); }
.dm-checklist li::before { content: "○"; margin-right: 10px; color: var(--sky); }
@media (prefers-reduced-motion: reduce) { .dm-indeterminate div { animation: none; width: 100%; opacity: .5; } }

/* Dashboard */
.dm-status { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 20px; }
.dm-status-main { flex: 1 1 360px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.dm-status-main p { margin: 0; font-size: 15px; line-height: 23px; }
.dm-days { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 6px; }
.dm-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dm-actions .bx-btn { min-width: 160px; }
.dm-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted-foreground); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.dm-link:hover { color: var(--foreground); }
.dm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.dm-kpis .dm-card { gap: 6px; padding: 20px; }
.dm-kpi { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 26px; line-height: 34px; font-weight: 500; }
.dm-table-card { padding: 0; gap: 0; overflow: hidden; }
.dm-table-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.dm-table-scroll { overflow-x: auto; }
.dm-table-scroll .bx-table { min-width: 560px; }
.dm-empty { margin: 0; padding: 20px 24px; font-size: 14px; line-height: 21px; color: var(--muted-foreground); }
.dm-alerts { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.dm-alerts p { margin: 4px 0 0; }
.dm-tg-btn-outline svg { color: #2AABEE; }

.dm-plans-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dm-plans-head p { margin: 4px 0 0; }
/* Pricing: the block gets a soft accent glow; one plan (6 months) is the recommended pick */
.dm-card[data-plans] { border-color: #2C4560; background: radial-gradient(120% 140% at 100% 0%, var(--navy) 0%, var(--card) 55%); }
.dm-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding-top: 14px; align-items: stretch; }
/* Plans are buttons: reset browser styles. The CTA sits at the bottom so all cards line up. */
.dm-plan { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 22px 20px 20px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--background);
  font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.dm-plan:not(:disabled):hover { border-color: var(--steel); transform: translateY(-2px); }
.dm-plan:disabled { cursor: default; }
.dm-plan:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }
.dm-plan[aria-busy="true"] { opacity: .6; }
.dm-price { margin-top: 8px; font-family: var(--font-mono); font-size: 36px; line-height: 44px; font-weight: 600; letter-spacing: -0.02em; color: var(--foreground); }
.dm-per { font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.dm-save { margin: 10px 0 18px; padding: 2px 9px; border-radius: var(--radius-full); font-size: 12px; line-height: 18px; font-weight: 600; color: var(--profit); background: var(--profit-soft); }
.dm-save[hidden] { display: block; visibility: hidden; }  /* keeps the row height so CTAs align */
.dm-plan-cta { display: block; box-sizing: border-box; width: 100%; margin-top: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  text-align: center; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--foreground); }
.dm-plan:not(:disabled):hover .dm-plan-cta { border-color: var(--steel); }
.dm-plan:disabled .dm-plan-cta { visibility: hidden; }
/* Recommended plan: sky border, glow, filled amber CTA */
.dm-plan-featured { border-color: var(--sky); background: linear-gradient(180deg, var(--accent) 0%, var(--background) 100%);
  box-shadow: 0 16px 40px -14px #7ea5cf80; }
.dm-plan-featured:not(:disabled):hover { border-color: var(--sky); }
.dm-plan-featured .dm-price { color: var(--sky); }
.dm-plan-featured .dm-plan-cta { background: var(--cta); border-color: var(--cta); color: var(--cta-foreground); box-shadow: var(--shadow-cta); }
.dm-plan-featured:not(:disabled):hover .dm-plan-cta { border-color: var(--cta); opacity: .92; }
.dm-plan-tag { position: absolute; top: -11px; left: 18px; padding: 2px 10px; border-radius: var(--radius-full); background: var(--sky); color: var(--primary-foreground); font-size: 11px; line-height: 18px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.dm-plans-card .dm-note a { color: inherit; text-decoration: underline; }

.dm-toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--popover); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 10px; padding: 10px 16px; font-size: 14px; z-index: 50; }
.dm-toast[data-kind="error"] { border-color: var(--loss); color: var(--loss); }

/* Trading balance: quick amounts on the key form, a card on the dashboard */
.dm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dm-chip { font: inherit; font-size: 13px; line-height: 18px; font-family: var(--font-mono); padding: 6px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--border); background: var(--background); color: var(--foreground); cursor: pointer; }
.dm-chip:hover { border-color: var(--steel); }
.dm-chip[aria-pressed="true"] { border-color: var(--sky); color: var(--sky); background: var(--accent); }
.dm-num { font-family: var(--font-mono); }
.dm-balance-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.dm-balance-line b { color: var(--foreground); font-weight: 600; font-family: var(--font-mono); }
.dm-inline-link { font: inherit; font-size: 12px; padding: 0; border: 0; background: none; color: var(--sky); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.dm-inline-link:hover { color: var(--foreground); }
.dm-balance-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dm-balance-form[hidden], .dm-balance-line[hidden] { display: none; }
.dm-balance-form .bx-field { width: 130px; height: 36px; }
.dm-balance-form .bx-btn { height: 36px; }
.dm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dm-msg[data-kind="warning"] { border-color: #5A4A22; background: var(--warning-soft); color: var(--warning); }

/* /account: confirmation checkbox, risk block, side-by-side buttons */
.dm-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 19px; color: var(--muted-foreground); cursor: pointer; }
.dm-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--sky); flex: none; }
.dm-check b { color: var(--foreground); }
.dm-risk p { margin: 0; font-size: 13px; line-height: 20px; }
.dm-row-actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 900px) {
  .dm-split, .dm-grid, .dm-skel-row { grid-template-columns: 1fr; }
  .dm-login { justify-self: stretch; max-width: none; }
  .dm-kpis, .dm-plans { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  /* Plans: one per row, the recommended one first */
  .dm-plans { grid-template-columns: 1fr; gap: 18px; }
  .dm-plan-featured { order: -1; }
  .dm-save { margin-bottom: 0; }
  .dm-plan-cta { margin-top: 16px; }
  .dm-wrap { padding: 24px 16px 56px; gap: 20px; }
  .dm-wrap h1 { font-size: 30px !important; line-height: 36px !important; }
  .dm-actions { align-items: stretch; width: 100%; }
  /* Steps: numbers only, the current one keeps its label */
  .dm-stepper { flex-wrap: nowrap; }
  .dm-stepper li:not([aria-current="step"]) { font-size: 0; gap: 0; padding: 4px; }
  .dm-stepper li span { font-size: 12px; }
}

/* A plan chosen on the landing page gets a brief highlight when the demo plans render. */
.dm-plan-chosen { outline: 2px solid var(--cta); outline-offset: 2px; animation: dm-plan-pulse 2.4s ease-out; }
@keyframes dm-plan-pulse { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 20% { box-shadow: 0 0 0 6px rgba(244,166,42,.25); } }
@media (prefers-reduced-motion: reduce) { .dm-plan-chosen { animation: none; } }

/* Paid gateway view: plan active -> link to the live bot controls (/account). */
.dm-paid { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.dm-paid .bx-btn-block { align-self: stretch; }
.dm-paid p { margin: 0; }

/* /account: Bybit key instructions - copyable server IP. */
.dm-ip { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0; vertical-align: middle; }
.dm-ip code { background: var(--inset, #182231); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; font-family: var(--font-mono); font-size: 13px; }
.dm-copy-ip { font: inherit; font-size: 12px; cursor: pointer; color: var(--cta); background: transparent; border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; }
.dm-copy-ip:hover { border-color: var(--cta); }
.dm-ikey-lead { margin-top: -4px; }
