/* ICT Autopilot SaaS — design system */
:root {
  --bg: #0b0e14;
  --bg-2: #0f131a;
  --bg-3: #131720;
  --panel: #131720;
  --panel-2: #1a1f2b;
  --line: #232938;
  --ink: #d4d6dd;
  --ink-2: #9ca3af;
  --mute: #6b7280;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #eab308;
  --blue: #3b82f6;
  --purple: #a855f7;
  --gold: #ffd54f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif; font-size: 14px; line-height: 1.55; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 28px; margin-bottom: 8px; }
h2 { font-size: 20px; margin: 18px 0 12px; }
h3 { font-size: 16px; margin: 12px 0 8px; }
code { background: var(--bg-3); padding: 1px 5px; border-radius: 3px; font-family: "SF Mono", ui-monospace, Menlo, monospace; font-size: 12px; }
small { font-size: 11px; color: var(--mute); }
.muted { color: var(--mute); }
.small { font-size: 11px; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.error { color: var(--red); margin-top: 8px; }
.fineprint { font-size: 11px; color: var(--mute); margin-top: 8px; }

/* === Product nav === */
.product-nav { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: var(--bg-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.product-nav .brand { font-weight: 700; color: var(--gold); letter-spacing: 0.4px; margin-right: auto; }
.product-nav .brand .v { font-size: 10px; color: var(--mute); font-weight: 500; margin-left: 6px; }
.product-nav .tabnav { display: flex; gap: 2px; background: var(--panel); border-radius: 6px; padding: 3px; border: 1px solid var(--line); }
.product-nav .tabnav a { color: var(--mute); padding: 5px 14px; border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.product-nav .tabnav a.on { background: var(--blue); color: #fff; }
.product-nav .tabnav a:not(.on):hover { color: var(--ink); background: rgba(255,255,255,0.05); text-decoration: none; }
.product-nav .acct { font-size: 11px; color: var(--mute); padding: 4px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); }

/* === Main / page === */
main.page { max-width: 1280px; margin: 0 auto; padding: 24px 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.card.big { padding: 28px; }

/* === Buttons === */
button, .btn-primary, .btn-ghost, .btn-red { font-family: inherit; cursor: pointer; border: none; padding: 10px 20px; border-radius: 6px; font-weight: 600; font-size: 13px; letter-spacing: 0.2px; transition: opacity 0.15s, transform 0.05s; display: inline-block; text-align: center; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #4a91ff; text-decoration: none; }
.btn-primary.big { padding: 14px 28px; font-size: 15px; }
.btn-ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg-3); text-decoration: none; }
.btn-ghost.small { padding: 5px 12px; font-size: 11px; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #f56565; text-decoration: none; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Forms === */
form label { display: block; margin: 10px 0; color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: 0.3px; text-transform: uppercase; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); border-radius: 6px; font: inherit; font-size: 14px;
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; align-items: end; }
.form-row label { margin: 0; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding: 12px 0; }
.checkgrid label { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkgrid input[type=checkbox] { width: auto; margin: 0; }

/* === Pills / Banners === */
.pill { padding: 4px 10px; border-radius: 4px; font-size: 11px; background: var(--panel); border: 1px solid var(--line); color: var(--mute); display: inline-block; }
.pill.green { color: var(--green); border-color: var(--green); }
.pill.red { color: var(--red); border-color: var(--red); }
.pill.yellow { color: var(--yellow); border-color: var(--yellow); }
.banner { padding: 12px 18px; border-radius: 6px; margin-bottom: 16px; font-weight: 500; }
.banner.warn { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.3); color: var(--yellow); }
.banner.error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--red); }

/* === Tables === */
table.trades { width: 100%; border-collapse: collapse; font-size: 12px; font-family: "SF Mono", ui-monospace, monospace; }
table.trades th, table.trades td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
table.trades th { color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; font-size: 10px; }
table.trades.striped tbody tr:nth-child(odd) { background: var(--bg-2); }
table.trades td.pos { color: var(--green); }
table.trades td.neg { color: var(--red); }
table.trades td.r { color: var(--yellow); }

/* === Dashboard === */
.dash-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-header h1 { font-size: 22px; margin-right: auto; }
.dash-actions { display: flex; gap: 10px; align-items: center; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); padding: 14px 16px; border-radius: 8px; }
.kpi label { display: block; font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; margin-bottom: 4px; }
.kpi b { font-size: 22px; font-weight: 700; font-family: ui-monospace, monospace; letter-spacing: -0.02em; }

.skipped { list-style: none; padding: 0; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.skipped li { padding: 4px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.skipped li .t { color: var(--mute); min-width: 100px; }
.skipped li .g { color: var(--gold); min-width: 50px; }
.skipped li .r { color: var(--red); }

/* === Auth === */
.auth-card { max-width: 420px; margin: 80px auto; padding: 32px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.auth-card h2 { margin-top: 0; }
.dev-link { background: rgba(234, 179, 8, 0.1); border: 1px solid rgba(234, 179, 8, 0.3); padding: 10px; border-radius: 4px; font-size: 11px; margin: 12px 0; word-break: break-all; }
.dev-link a { color: var(--yellow); }

/* === Onboard wizard === */
.onboard { max-width: 720px; margin: 0 auto; }
.wizard { list-style: none; padding: 0; margin-top: 24px; }
.wizard .step { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; margin-bottom: 12px; opacity: 0.5; }
.wizard .step.active { opacity: 1; border-color: var(--blue); }
.wizard .step.done { opacity: 0.85; border-left: 4px solid var(--green); }
.wizard .step h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 12px; }
.wizard .step .num { background: var(--bg-3); width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--gold); }
.wizard .step.done .num { background: var(--green); color: #fff; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.preset-card { display: block; padding: 14px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; transition: all 0.15s; background: var(--bg-2); }
.preset-card:has(input:checked) { border-color: var(--blue); background: rgba(59, 130, 246, 0.08); }
.preset-card input { display: none; }
.preset-card strong { display: block; margin-bottom: 4px; color: var(--gold); text-transform: capitalize; }
.preset-card p { font-size: 11px; color: var(--mute); margin: 0; }
.finish { text-align: center; margin-top: 28px; font-size: 16px; }

/* === Landing page === */
body.landing { background: var(--bg); }
body.landing main { max-width: 1100px; padding: 0; }
.hero { padding: 24px 32px 80px; background: radial-gradient(ellipse at top right, rgba(255, 213, 79, 0.06), transparent 50%), var(--bg); border-bottom: 1px solid var(--line); }
.hero-nav { display: flex; justify-content: space-between; align-items: center; max-width: 1100px; margin: 0 auto 60px; }
.hero-nav .brand { font-size: 16px; font-weight: 700; color: var(--gold); }
.hero-nav .brand .v { font-size: 10px; color: var(--mute); font-weight: 500; margin-left: 6px; }
.hero-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.hero-inner h1 { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; margin: 18px 0 20px; line-height: 1.1; }
.hero-inner h1 .gold { color: var(--gold); }
.hero-inner .sub { font-size: 17px; color: var(--ink-2); max-width: 680px; margin: 0 auto 32px; line-height: 1.55; }
.hero-inner .pill { padding: 6px 14px; font-size: 11px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-bottom: 60px; }
.hero-cta .btn-primary, .hero-cta .btn-ghost { padding: 14px 28px; font-size: 14px; }
.hero-proof { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; max-width: 720px; margin: 0 auto; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-proof > div { text-align: center; }
.hero-proof b { display: block; font-size: 28px; color: var(--gold); font-weight: 700; font-family: ui-monospace, monospace; }
.hero-proof span { font-size: 11px; color: var(--mute); text-transform: uppercase; letter-spacing: 0.5px; }
.how, .strategy, .pricing { max-width: 1100px; margin: 0 auto; padding: 60px 32px; }
.how h2, .strategy h2, .pricing h2 { font-size: 32px; text-align: center; margin-bottom: 40px; letter-spacing: -0.02em; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.how-step { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.how-step .num { background: var(--gold); color: var(--bg); width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.how-step h3 { margin: 6px 0 10px; }
.how-step p { color: var(--ink-2); font-size: 13px; }
.strategy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.strategy-grid .card h3 { color: var(--gold); margin-top: 0; }
.strategy-grid .card ul { list-style: none; padding: 0; }
.strategy-grid .card ul li { padding: 6px 0; font-size: 13px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.strategy-grid .card ul li:last-child { border-bottom: 0; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 720px; margin: 0 auto; }
.plan { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 32px; text-align: center; position: relative; }
.plan.featured { border-color: var(--blue); transform: scale(1.04); box-shadow: 0 12px 60px rgba(59, 130, 246, 0.2); }
.plan .badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--blue); color: #fff; padding: 4px 12px; border-radius: 99px; font-size: 10px; font-weight: 700; letter-spacing: 1px; }
.plan h3 { font-size: 20px; margin-bottom: 8px; }
.plan .price { font-size: 38px; font-weight: 700; color: var(--gold); margin: 12px 0; }
.plan .price span { font-size: 14px; color: var(--mute); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 20px 0; text-align: left; }
.plan ul li { padding: 6px 0; font-size: 13px; color: var(--ink-2); }
.plan ul li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.plan .btn-primary { display: block; }
.plan .fineprint { margin-top: 12px; }
.risk-callout { max-width: 880px; margin: 40px auto 60px; padding: 24px 32px; background: rgba(239, 68, 68, 0.06); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 8px; color: var(--ink-2); font-size: 13px; }
.risk-callout h3 { color: var(--red); margin: 0 0 8px; }

/* === Billing === */
.billing .card.big { max-width: 560px; margin: 32px auto; text-align: center; }
.plan-name { font-size: 32px; color: var(--gold); margin-bottom: 16px; }

/* === Legal === */
article.legal { max-width: 760px; margin: 0 auto; padding: 32px; }
.legal-body { font-size: 14px; line-height: 1.7; color: var(--ink-2); }

/* === Diagnostics === */
.diag { max-width: 1100px; margin: 0 auto; }

/* === Footer === */
.site-footer { max-width: 1280px; margin: 40px auto 20px; padding: 16px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--mute); font-size: 11px; }
.site-footer a { color: var(--mute); }
.site-footer a:hover { color: var(--ink); }

@media (max-width: 720px) {
  .hero-inner h1 { font-size: 36px; }
  .hero-proof { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .plan.featured { transform: none; }
  .product-nav { flex-wrap: wrap; padding: 8px 12px; }
  .product-nav .tabnav { order: 99; flex-basis: 100%; overflow-x: auto; }
}

/* ─── COMPREHENSIVE MOBILE PASS 2026-05-12 ─────────────────────────────
   Every SaaS page that extends base.html inherits these rules. /sim and
   /live have their own inline @media in ict-event-detector.html.        */
@media (max-width: 720px) {
  body { font-size: 13px; }
  main.page { padding: 16px 12px; max-width: 100vw; }
  /* Forms collapse to single column */
  .form-row { grid-template-columns: 1fr; gap: 10px; }
  .checkgrid { grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px 0; }
  /* KPI grid: 2-col on phones */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
  .kpi .lbl { font-size: 9px; }
  .kpi .val { font-size: 18px; }
  /* Auth + onboard cards full-width */
  .auth-card { max-width: 100%; margin: 24px 12px; padding: 22px 18px; }
  .onboard { max-width: 100%; }
  .preset-grid { grid-template-columns: 1fr; }
  /* Landing hero */
  .hero-inner h1 { font-size: 28px; line-height: 1.15; }
  .hero-inner .sub { font-size: 14px; padding: 0 8px; }
  .hero-proof { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px 4px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .hero-cta .cta { width: 100%; text-align: center; box-sizing: border-box; }
  .hero-nav { padding: 8px 12px; margin-bottom: 30px; }
  /* Section paddings collapse */
  .how, .strategy, .pricing { padding: 32px 16px; }
  .how-grid { grid-template-columns: 1fr; gap: 12px; }
  .strategy-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; gap: 16px; }
  .plan { padding: 22px 18px; }
  .plan h3 { font-size: 16px; }
  /* Risk callout */
  .risk-callout { margin: 24px 12px; padding: 16px 18px; font-size: 12px; }
  /* Billing card */
  .billing .card.big { margin: 16px 12px; padding: 22px 18px; }
  /* Legal pages */
  article.legal { padding: 16px 14px; font-size: 13px; }
  article.legal h2 { font-size: 20px; }
  article.legal h3 { font-size: 16px; }
  /* Tables (admin/trades) scroll horizontally on mobile */
  table { display: block; overflow-x: auto; white-space: nowrap; }
  /* Site footer stacks */
  .site-footer { flex-direction: column; gap: 6px; padding: 12px; text-align: center; }
  /* Headings tighter */
  h1 { font-size: 22px; }
  h2 { font-size: 18px; }
  h3 { font-size: 15px; }
  /* Buttons full-width-ish where appropriate */
  button, .btn { font-size: 13px; }
  /* Input fields easier to tap */
  input, select, textarea { font-size: 16px !important; min-height: 38px; }
}

@media (max-width: 420px) {
  .hero-inner h1 { font-size: 24px; }
  .hero-proof { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
  .checkgrid { grid-template-columns: 1fr; }
  main.page { padding: 12px 8px; }
}
