/* ==========================================================================
   JMatrix360 — Public / Marketing & Auth surfaces ("jm-*" system)
   ==========================================================================
   Covers the signed-out front door: templates/public_home.html,
   templates/industry_landing.html, templates/accounts/login.html,
   templates/accounts/signed_out.html, and the top of
   templates/accounts/pricing.html (its "talk to sales" form keeps the
   original .field/.btn classes from design-system.css and is left alone).

   These templates were built with a clean "jm-" class vocabulary but no
   matching CSS ever shipped for it, so every one of these pages was
   rendering as unstyled text. This file is that missing stylesheet — it
   only ever targets .jm-* selectors (plus bare form controls scoped under
   them), so nothing here can touch the already-working app shell, the
   signed-in dashboard, or any other page.

   Palette / gradients are deliberately reused, not reinvented: the dark
   navy → teal gradient and the --brand / --cat-3 tokens below are the same
   ones already shipped on the signed-in dashboard hero and the app header,
   so a visitor who signs up sees one consistent brand, not two. */

.jm-public, .jm-auth { --jm-radius: 20px; }

/* ---------- Shared primitives ---------- */

.jm-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand-strong);
}
.jm-eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--cat-3); flex: none;
  box-shadow: 0 0 0 3px rgba(27,175,122,.15);
}
/* On a dark panel the eyebrow needs a light-on-dark treatment instead. */
.jm-auth-story .jm-eyebrow, .jm-dark-panel .jm-eyebrow, .jm-cta .jm-eyebrow {
  color: #d6ecff;
}
.jm-auth-story .jm-eyebrow::before, .jm-dark-panel .jm-eyebrow::before, .jm-cta .jm-eyebrow::before {
  background: #6be8bf; box-shadow: 0 0 0 3px rgba(107,232,191,.18);
}

.jm-heading {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.06;
  letter-spacing: -.03em;
  font-weight: 800;
  margin: 14px 0 16px;
  color: var(--ink-primary);
  text-wrap: balance;
}
.jm-heading em { font-style: normal; color: var(--brand-strong); }
.jm-auth-story h1, .jm-dark-panel h2, .jm-cta h2 { text-wrap: balance; letter-spacing: -.025em; }

.jm-lead {
  font-size: 17px; line-height: 1.65; color: var(--ink-secondary);
  max-width: 46ch; margin: 0 0 26px;
}

.jm-note { font-size: 13px; color: var(--ink-muted); margin: 0; }
.jm-note a { font-weight: 700; }

.jm-scope {
  margin-top: 18px; padding: 11px 15px; max-width: 46ch;
  background: var(--surface-2); border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-secondary);
}

.jm-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 20px; }

.jm-button {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 14px 24px; border-radius: 12px;
  font-size: 14.5px; font-weight: 700; text-decoration: none; line-height: 1;
  border: 1.5px solid transparent; cursor: pointer;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff; box-shadow: 0 10px 24px rgba(24,79,149,.22);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}
.jm-button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(24,79,149,.28); color: #fff; }
.jm-button:active { transform: translateY(0); }
.jm-button.secondary {
  background: var(--surface); color: var(--ink-primary);
  border-color: var(--border-strong); box-shadow: none;
}
.jm-button.secondary:hover { background: var(--surface-sunken); color: var(--ink-primary); }
.jm-button.light {
  background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); box-shadow: none;
}
.jm-button.light:hover { background: rgba(255,255,255,.22); color: #fff; }

.jm-form-error {
  display: flex; align-items: center; gap: 8px;
  background: #fff2f2; border: 1px solid #f7c9c9; color: #9c2626;
  padding: 11px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 16px;
}

/* ---------- Dark "brand story" panel (auth visual + promo bands) ---------- */

.jm-auth-story, .jm-dark-panel, .jm-cta {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 82% 14%, rgba(27,175,122,.30), transparent 42%),
    linear-gradient(150deg, #051a35 0%, #082b59 55%, #0f766e 120%);
}
.jm-auth-story::before, .jm-dark-panel::before, .jm-cta::before {
  content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 26px 26px;
}
.jm-auth-story::after, .jm-dark-panel::after, .jm-cta::after {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  right: -140px; bottom: -140px; pointer-events: none;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 0 36px rgba(255,255,255,.02), 0 0 0 78px rgba(255,255,255,.015);
}
.jm-auth-story > *, .jm-dark-panel > *, .jm-cta > * { position: relative; z-index: 1; }
.jm-auth-story p, .jm-dark-panel p, .jm-cta p { color: rgba(255,255,255,.82); }
.jm-auth-story h1, .jm-dark-panel h2, .jm-cta h2 { color: #fff; }

/* ---------- /login/ and /logout/ split screen ---------- */

.jm-auth {
  display: grid; grid-template-columns: 1.05fr 1fr; min-height: 640px;
  max-width: 1120px; margin: 8px auto 40px;
  border-radius: var(--jm-radius); overflow: hidden;
  box-shadow: var(--shadow-lg); background: var(--surface);
}
.jm-auth-story { padding: 48px 46px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.jm-auth-story > div:first-child { max-width: 420px; }
.jm-auth-story h1 { font-size: 33px; line-height: 1.14; margin: 16px 0 14px; }
.jm-auth-story p { font-size: 14.5px; line-height: 1.6; margin: 0; }
.jm-auth-symbol {
  margin-top: 30px; width: 56px; height: 56px; border-radius: 16px;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16);
  display: grid; place-items: center; font-size: 24px; color: #bdf0dd;
}
.jm-auth-story > small {
  display: block; font-size: 12.5px; line-height: 1.6; color: rgba(255,255,255,.7);
  padding-top: 22px; border-top: 1px solid rgba(255,255,255,.16); max-width: 380px;
}
.jm-success-mark {
  width: 60px; height: 60px; border-radius: 50%; margin-bottom: 6px;
  background: var(--brand-wash); color: var(--brand-strong); border: 1px solid rgba(24,79,149,.14);
  display: grid; place-items: center; font-size: 26px;
}

.jm-auth-form {
  padding: 52px 48px; display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.jm-auth-form > * { width: 100%; max-width: 380px; }
.jm-auth-form > .jm-eyebrow { margin-bottom: 6px; width: auto; }
.jm-auth-form h2 { font-size: 27px; letter-spacing: -.02em; margin: 0 0 8px; color: var(--ink-primary); }
.jm-auth-form > p { color: var(--ink-secondary); font-size: 14px; margin: 0 0 26px; }
.jm-auth-form form { display: flex; flex-direction: column; gap: 18px; }
.jm-auth-form form label {
  display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-secondary);
  margin-bottom: 7px; letter-spacing: .01em;
}
.jm-auth-form form input[type="text"],
.jm-auth-form form input[type="password"],
.jm-auth-form form input[type="email"] {
  width: 100%; height: 48px; padding: 0 15px; font-size: 14.5px; font-family: inherit;
  border: 1.5px solid var(--border-strong); border-radius: 11px; background: var(--surface);
  color: var(--ink-primary); transition: border-color .15s ease, box-shadow .15s ease;
}
.jm-auth-form form input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-wash);
}
.jm-auth-form form ul.errorlist { list-style: none; margin: 7px 0 0; padding: 0; color: #c62828; font-size: 12px; font-weight: 600; }
.jm-auth-form form button.jm-button { margin-top: 4px; width: 100%; justify-content: center; height: 50px; }
.jm-auth-foot {
  margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 11px;
  font-size: 13px; color: var(--ink-muted); text-align: center;
}
.jm-auth-foot a { font-weight: 700; }

@media (max-width: 900px) {
  .jm-auth { grid-template-columns: 1fr; min-height: 0; }
  .jm-auth-story { padding: 34px 28px; }
  .jm-auth-story h1 { font-size: 27px; }
  .jm-auth-story > small { display: none; }
  .jm-auth-form { padding: 36px 26px; }
}

/* ---------- Marketing hero (public_home.html, industry_landing.html, pricing.html) ---------- */

.jm-public { display: block; }

.jm-public-hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
  padding: 26px 0 54px;
}
.jm-public-hero .jm-note { margin-top: 6px; }

.jm-art { position: relative; }
.jm-art::before {
  content: ""; position: absolute; width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(42,120,214,.16), transparent 68%);
  right: -60px; top: -60px; z-index: 0; pointer-events: none;
}
.jm-art-card {
  position: relative; z-index: 1;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px 28px 24px; box-shadow: var(--shadow-lg);
}
.jm-art-top {
  display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 13.5px;
  padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border);
  color: var(--ink-primary);
}
.jm-art-top i { color: var(--brand); font-size: 16px; }
.jm-art-title { font-size: 21px; margin: 0 0 6px; letter-spacing: -.02em; }
.jm-art-sub { color: var(--ink-muted); font-size: 13px; margin: 0 0 20px; }
.jm-art-flow { display: grid; gap: 12px; margin-bottom: 18px; }
.jm-art-flow span {
  display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; color: var(--ink-secondary);
}
.jm-art-flow b {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand-wash); color: var(--brand-strong);
  font-size: 12px; font-weight: 800;
}
.jm-art-flow span:last-child b { background: rgba(27,175,122,.14); color: #0f7a55; }
.jm-art-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-muted); padding-top: 16px; border-top: 1px solid var(--border);
}

.jm-ribbon {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 34px;
  padding: 24px 0; margin: 6px 0 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.jm-ribbon span {
  display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 700; color: var(--ink-secondary);
}
.jm-ribbon i { color: var(--brand); font-size: 15px; }

.jm-section { padding: 56px 0; }
.jm-section-head { max-width: 640px; margin: 0 0 30px; }
.jm-section-head h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.02em; margin: 8px 0 10px; text-wrap: balance; }
.jm-section-head > p { color: var(--ink-secondary); font-size: 14.5px; line-height: 1.6; margin: 0; }
/* pricing.html's #plans head is a bare <h2> with no wrapping copy */
#plans .jm-section-head { max-width: none; }

.jm-editions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.jm-edition {
  display: block; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.jm-edition:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(24,79,149,.22); }
.jm-edition i { font-size: 24px; color: var(--brand); display: block; margin-bottom: 14px; }
.jm-edition h3 { font-size: 15.5px; margin: 0 0 6px; }
.jm-edition p { font-size: 13px; color: var(--ink-muted); line-height: 1.55; margin: 0 0 14px; }
.jm-arrow { font-size: 12px; font-weight: 700; color: var(--brand-strong); }
.jm-edition:hover .jm-arrow { color: var(--brand); }

.jm-dark-panel {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center;
  border-radius: var(--jm-radius); padding: 44px 46px; margin: 8px 0;
}
.jm-dark-panel h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 10px 0 12px; }
.jm-dark-panel > div:last-child { text-align: center; }
.jm-dark-panel > div:last-child > i { display: block; margin: 0 auto; }
.jm-dark-panel .jm-actions { justify-content: center; margin-top: 18px; margin-bottom: 0; }

.jm-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.jm-step {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px;
}
.jm-step b {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  color: var(--brand-strong); background: var(--brand-wash); padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.jm-step h3 { font-size: 15.5px; margin: 0 0 8px; }
.jm-step p { font-size: 13px; color: var(--ink-muted); line-height: 1.55; margin: 0; }

/* pricing.html reuses .jm-steps as a 3-up plan-card row */
.jm-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 26px;
  display: flex; flex-direction: column;
}
.jm-panel h2 { font-size: 21px; margin: 10px 0 10px; letter-spacing: -.015em; }
.jm-panel > p { font-size: 13.5px; color: var(--ink-secondary); line-height: 1.55; margin: 0 0 20px; flex: 1; }
.jm-panel .jm-actions { margin: 0; }
.jm-steps > .jm-panel:nth-child(2) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-md); }

.jm-home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.jm-home-grid .jm-panel { height: 100%; }
.jm-home-grid .jm-panel .field { margin-bottom: 14px; }

.jm-cta {
  border-radius: var(--jm-radius); padding: 52px 48px; margin: 12px 0 8px; text-align: center;
}
.jm-cta > .jm-eyebrow { justify-content: center; display: inline-flex; }
.jm-cta h2 { font-size: clamp(24px, 3vw, 32px); margin: 12px auto 12px; max-width: 620px; }
.jm-cta > p { max-width: 560px; margin: 0 auto; }
.jm-cta .jm-actions { justify-content: center; margin-top: 22px; margin-bottom: 0; }

@media (max-width: 980px) {
  .jm-public-hero { grid-template-columns: 1fr; gap: 36px; padding-top: 8px; }
  .jm-editions { grid-template-columns: repeat(2, 1fr); }
  .jm-dark-panel { grid-template-columns: 1fr; text-align: left; padding: 34px 30px; }
  .jm-dark-panel > div:last-child { text-align: left; }
  .jm-dark-panel > div:last-child > i { margin: 0 0 12px; }
  .jm-dark-panel .jm-actions { justify-content: flex-start; }
  .jm-steps { grid-template-columns: repeat(2, 1fr); }
  .jm-home-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .jm-editions, .jm-steps { grid-template-columns: 1fr; }
  .jm-cta, .jm-dark-panel { padding: 30px 24px; }
  .jm-section { padding: 40px 0; }
}

/* ---------- Entrance motion — CSS-only, no JS dependency, visible without it ---------- */
@media (prefers-reduced-motion: no-preference) {
  .jm-public-hero > *, .jm-auth-story, .jm-auth-form {
    animation: jm-rise .55s cubic-bezier(.2,.7,.3,1) both;
  }
  .jm-public-hero > *:nth-child(2) { animation-delay: .08s; }
  .jm-auth-form { animation-delay: .06s; }
  .jm-edition, .jm-step, .jm-panel { animation: jm-rise .5s ease both; }
  .jm-editions > *:nth-child(1), .jm-steps > *:nth-child(1) { animation-delay: 0s; }
  .jm-editions > *:nth-child(2), .jm-steps > *:nth-child(2) { animation-delay: .05s; }
  .jm-editions > *:nth-child(3), .jm-steps > *:nth-child(3) { animation-delay: .10s; }
  .jm-editions > *:nth-child(4) { animation-delay: .15s; }
  .jm-editions > *:nth-child(5) { animation-delay: .20s; }
  .jm-editions > *:nth-child(6) { animation-delay: .25s; }
}
@keyframes jm-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Dark "diamond" theme — scoped token override for the jm-* system
   ==========================================================================
   Everything above still applies unchanged; this just restates the design
   tokens it reads (--brand, --ink-primary, --surface, etc.) with dark
   values, scoped to .jm-public/.jm-auth only. Custom properties cascade by
   DOM position, not stylesheet order, so anything nested inside these two
   containers — including pricing.html's own .field/.btn contact form from
   design-system.css — picks up the dark values automatically. Nothing
   outside .jm-public/.jm-auth is affected: the signed-in app keeps its
   original light tokens untouched. */

.jm-public, .jm-auth {
  --brand: #cfa53a;            /* gold */
  --brand-strong: #a9822b;     /* deeper gold */
  --brand-wash: rgba(207,165,58,.16);
  --ink-primary: #eef0f4;
  --ink-secondary: #9095a3;
  --ink-muted: #6b7080;
  --surface: #14161d;
  --surface-2: #191c25;
  --surface-sunken: #1c1f28;
  --border: #262a34;
  --border-strong: #333846;
  --shadow-md: 0 14px 34px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  --cat-3: #a9dcec;            /* ice */
}

.jm-public {
  background: #0a0b0f;
  border-radius: 24px;
  padding: 0 28px;
  overflow: hidden;
}
@media (max-width: 640px) { .jm-public { border-radius: 16px; padding: 0 16px; } }

.jm-eyebrow::before { box-shadow: 0 0 0 3px rgba(169,220,236,.18); }

/* .jm-button's text colour and shadow tint are literal, not tokens —
   gold needs dark text for contrast, and the shadow reads better warm. */
.jm-public .jm-button, .jm-auth .jm-button {
  color: #171100;
  box-shadow: 0 10px 24px rgba(207,165,58,.28);
}
.jm-public .jm-button:hover, .jm-auth .jm-button:hover {
  color: #171100; box-shadow: 0 14px 30px rgba(207,165,58,.36);
}
.jm-public .jm-button.secondary, .jm-auth .jm-button.secondary,
.jm-public .jm-button.secondary:hover, .jm-auth .jm-button.secondary:hover { color: var(--ink-primary); }

/* Dark brand-story / promo panels: recolour the navy→teal gradient to a
   gold glow on the new dark surface, matching the splash and homepage. */
.jm-auth-story, .jm-dark-panel, .jm-cta {
  background:
    radial-gradient(circle at 82% 14%, rgba(207,165,58,.22), transparent 42%),
    linear-gradient(150deg, #14161d 0%, #191c25 55%, #1c1f28 120%);
}
.jm-auth-story .jm-eyebrow, .jm-dark-panel .jm-eyebrow, .jm-cta .jm-eyebrow { color: #f0dcb0; }
.jm-auth-story .jm-eyebrow::before, .jm-dark-panel .jm-eyebrow::before, .jm-cta .jm-eyebrow::before {
  background: #a9dcec; box-shadow: 0 0 0 3px rgba(169,220,236,.18);
}

.jm-auth-symbol { color: #a9dcec; }
.jm-art-flow span:last-child b { background: rgba(169,220,236,.16); color: #a9dcec; }

.jm-form-error {
  background: rgba(220,38,38,.14); border-color: rgba(220,38,38,.4); color: #ffb4b4;
}
