/**
 * Embed pages — readable desktop layout, soft canvas + white sheet.
 */

:root {
  --jd-ink: #0c0f14;
  --jd-smoke: #5c6a80;
  --jd-bone: #f7f9fc;
  --jd-linen: #e8eef8;
  --jd-border: rgba(79, 127, 255, 0.1);
  --jd-blue: #4f7fff;
  --jd-ember: #f97316;
  --jd-teal: #06c0b2;
  --jd-ease: cubic-bezier(0.22, 1, 0.36, 1);

  --ep-max: 1080px;
  --ep-pad-x: clamp(28px, 4.5vw, 56px);
  --ep-pad-top: clamp(44px, 6vh, 64px);
  --ep-pad-bot: clamp(56px, 8vh, 88px);
}

@keyframes jx-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Canvas ── */
body.ja-body:has(.jx-page) {
  background: #e9edf6;
  color: var(--jd-ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.ja-body:has(.jx-page) .jg-page-wrap {
  padding-top: 0 !important;
  min-height: 100vh;
}

/* ── White sheet ── */
.jx-page {
  --jx-accent: var(--jd-blue);
  --jx-accent-soft: rgba(79, 127, 255, 0.1);
  --jx-glow: rgba(79, 127, 255, 0.14);

  max-width: var(--ep-max);
  margin: 24px auto 32px;
  padding: var(--ep-pad-top) var(--ep-pad-x) var(--ep-pad-bot);
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(79, 127, 255, 0.08);
  box-shadow:
    0 1px 2px rgba(12, 20, 38, 0.04),
    0 12px 48px rgba(12, 20, 38, 0.07);
  animation: jx-in 0.45s var(--jd-ease) both;
}

body.ja-embed .jx-page {
  margin: 20px auto 28px;
  max-width: min(var(--ep-max), calc(100% - 40px));
  width: auto;
}

.jx-page.jx-package {
  --jx-accent: var(--jd-ember);
  --jx-accent-soft: rgba(249, 115, 22, 0.1);
  --jx-glow: rgba(249, 115, 22, 0.14);
}
.jx-page.jx-wallet {
  --jx-accent: var(--jd-teal);
  --jx-accent-soft: rgba(6, 192, 178, 0.12);
  --jx-glow: rgba(6, 192, 178, 0.14);
}
.jx-page.jx-needs  { --jx-accent: var(--jd-blue); }
.jx-page.jx-profile { --jx-accent: var(--jd-blue); }
.jx-page.jx-help   { --jx-accent: var(--jd-teal); }
.jx-page.jx-admin  {
  --jx-accent: #7c3aed;
  --jx-accent-soft: rgba(124, 58, 237, 0.1);
  --jx-glow: rgba(124, 58, 237, 0.12);
}

/* ── Page header ── */
.jx-hero,
.jx-hero.jx-hero-compact {
  position: relative;
  background: none;
  color: var(--jd-ink);
  padding: 0 0 32px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--jd-border);
  overflow: visible;
}

.jx-hero-mesh { display: none !important; }

.jx-hero-icon {
  display: block !important;
  position: absolute;
  right: 0;
  top: -8px;
  font-size: 4.5rem;
  opacity: 0.06;
  color: var(--jx-accent);
  pointer-events: none;
}

.jx-hero-inner { max-width: 72ch; position: relative; z-index: 1; }

.jx-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--jx-accent);
  background: var(--jx-accent-soft);
  border: 1px solid color-mix(in srgb, var(--jx-accent) 20%, transparent);
  margin-bottom: 14px;
}

.jx-hero h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin: 0 0 12px;
  color: var(--jd-ink);
}

.jx-hero p {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--jd-smoke);
  line-height: 1.65;
  max-width: 58ch;
}

.jx-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.jx-hero-actions { flex-shrink: 0; }

.jx-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--jd-border);
  background: var(--jx-accent-soft);
  color: var(--jx-accent);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
}
.jx-hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--jx-glow);
}

.jx-hero-stats { display: flex; gap: 12px; }
.jx-stat-pill {
  text-align: center;
  background: var(--jd-bone);
  border: 1px solid var(--jd-border);
  border-radius: 14px;
  padding: 14px 20px;
  min-width: 88px;
}
.jx-stat-pill strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--jd-ink);
  line-height: 1;
}
.jx-stat-pill span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--jd-smoke);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
}

/* ── Trust chips ── */
.jx-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.jx-feat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--jd-bone);
  border: 1px solid var(--jd-border);
  border-radius: 14px;
}

.jx-feat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--jx-accent-soft);
  color: var(--jx-accent);
  flex-shrink: 0;
}

.jx-feat-text strong {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--jd-ink);
}
.jx-feat-text span {
  display: block;
  font-size: 0.8125rem;
  color: var(--jd-smoke);
  margin-top: 2px;
}

/* ── Path / choice cards ── */
.jx-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.jx-path {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: #fff;
  border: 1px solid var(--jd-border);
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(12, 20, 38, 0.05), 0 8px 28px rgba(79, 127, 255, 0.06);
  transition: transform 0.22s var(--jd-ease), box-shadow 0.22s, border-color 0.22s;
}

.jx-path:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--jx-accent) 28%, var(--jd-border));
  box-shadow: 0 12px 36px rgba(12, 20, 38, 0.1), 0 16px 40px var(--jx-glow);
}

.jx-path:focus-visible {
  outline: 3px solid var(--jx-accent);
  outline-offset: 3px;
}

.jx-path-bar { height: 4px; width: 100%; }
.jx-path-a .jx-path-bar { background: var(--jd-blue); }
.jx-path-b .jx-path-bar { background: #8b5cf6; }
.jx-package .jx-path-a .jx-path-bar { background: var(--jd-teal); }
.jx-package .jx-path-b .jx-path-bar { background: var(--jd-ember); }

.jx-path-body { padding: 26px 28px 24px; flex: 1; display: flex; flex-direction: column; }

.jx-path-top {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.jx-path-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  background: var(--jx-accent-soft);
  color: var(--jx-accent);
}

.jx-path-meta h2 {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--jd-ink);
  margin: 0 0 4px;
}

.jx-path-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--jx-accent);
}

.jx-path-desc {
  font-size: 1rem;
  color: var(--jd-smoke);
  line-height: 1.6;
  margin: 0 0 18px;
}

.jx-path-feats {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.jx-path-feats li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--jd-smoke);
  line-height: 1.5;
}

.jx-path-feats li i {
  color: var(--jx-accent);
  font-size: 12px;
  margin-top: 5px;
  flex-shrink: 0;
}

.jx-path-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  background: var(--jx-accent);
  pointer-events: none;
}

.jx-path-a .jx-path-cta { background: var(--jd-blue); }
.jx-path-b .jx-path-cta { background: #7c3aed; }
.jx-package .jx-path-a .jx-path-cta { background: var(--jd-teal); }
.jx-package .jx-path-b .jx-path-cta { background: var(--jd-ember); }

/* ── Journey steps ── */
.jx-steps-wrap { margin-top: 8px; }

.jx-steps-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jd-smoke);
  margin: 0 0 16px;
}
.jx-steps-title::before {
  content: '';
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: var(--jd-blue);
  opacity: 0.5;
}

.jx-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  background: var(--jd-bone);
  border: 1px solid var(--jd-border);
  border-radius: 16px;
  padding: 22px 18px;
}

.jx-flow::before { display: none; }

.jx-flow-step { text-align: center; padding: 0 6px; }

.jx-flow-num {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  background: #fff;
  color: var(--jx-accent);
  border: 2px solid color-mix(in srgb, var(--jx-accent) 25%, transparent);
}

.jx-flow-step strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--jd-ink);
  line-height: 1.35;
  margin-bottom: 4px;
}

.jx-flow-step span {
  display: block;
  font-size: 0.75rem;
  color: var(--jd-smoke);
  line-height: 1.4;
}

.jx-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: var(--jx-accent-soft);
  color: var(--jx-accent);
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  vertical-align: middle;
}

.jx-escrow-wrap { position: relative; display: inline-flex; }
.jx-escrow-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(300px, 80vw);
  background: var(--jd-ink);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--jd-smoke);
  line-height: 1.55;
  text-align: left;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.22);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.jx-escrow-tip strong { color: #fff; display: block; margin-bottom: 4px; font-size: 13px; }
.jx-escrow-wrap:hover .jx-escrow-tip,
.jx-escrow-wrap.jx-tip-open .jx-escrow-tip { opacity: 1; pointer-events: auto; }

.jx-panel {
  background: var(--jd-bone);
  border: 1px solid var(--jd-border);
  border-radius: 16px;
  padding: 24px 28px;
}

.jx-hero .vf-search { margin-top: 18px; max-width: 480px; }
.jx-hero .vf-search input {
  padding: 14px 44px 14px 16px;
  font-size: 1rem;
  background: var(--jd-bone);
  border: 1px solid var(--jd-border);
  color: var(--jd-ink);
}

.sv-flow-mask {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(12, 15, 20, 0.45);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sv-flow-mask.is-visible { display: flex; }

.sv-flow-message {
  background: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--jd-ink);
  border: 1px solid var(--jd-border);
  box-shadow: 0 12px 40px rgba(12, 20, 38, 0.14);
  max-width: min(400px, 100%);
  text-align: center;
}

@media (max-width: 900px) {
  .jx-features { grid-template-columns: repeat(2, 1fr); }
  .jx-flow { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .jx-page {
    margin: 12px auto 20px;
    border-radius: 16px;
    padding: 32px 24px 48px;
  }
  body.ja-embed .jx-page {
    max-width: calc(100% - 24px);
    margin: 12px auto 20px;
  }
  .jx-paths { grid-template-columns: 1fr; }
  .jx-hero-icon { display: none !important; }
}

@media (max-width: 480px) {
  .jx-features { grid-template-columns: 1fr; }
  .jx-flow { grid-template-columns: repeat(2, 1fr); }
  .jx-hero-row { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .jx-page, .jx-path { animation: none !important; transition: none !important; }
}
