/* ============================================================
   CaseStore × JCM — client portal design system
   Navy + amber brand · blueprint-cool neutrals · light/dark
   ============================================================ */

:root {
  --paper: #eceff4;
  --card: #ffffff;
  --card-2: #f7f9fb;
  --ink: #0f2033;
  --ink-soft: #4a5c6f;
  --ink-faint: #73879999;
  --line: #d6dee7;
  --line-strong: #c2cdd9;
  --navy: #10243d;
  --amber: #d47f22;
  --amber-ink: #9a5a12;
  --amber-soft: #f7ead6;
  --pass: #2e7d55;
  --pass-soft: #e0efe6;
  --warn: #b5761b;
  --warn-soft: #f6ead2;
  --shadow: 0 1px 2px rgba(16,36,61,.06), 0 8px 24px -12px rgba(16,36,61,.18);
  --shadow-lift: 0 2px 4px rgba(16,36,61,.08), 0 18px 40px -16px rgba(16,36,61,.28);

  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a1522; --card: #10243a; --card-2: #142a42;
    --ink: #e7eef5; --ink-soft: #a3b5c7; --ink-faint: #6d8298;
    --line: #21384f; --line-strong: #2d4661; --navy: #0c1c30;
    --amber: #e6a04c; --amber-ink: #eab876; --amber-soft: rgba(224,138,43,.16);
    --pass: #58b487; --pass-soft: rgba(46,125,85,.20);
    --warn: #e0a94e; --warn-soft: rgba(181,118,27,.22);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
    --shadow-lift: 0 2px 6px rgba(0,0,0,.5), 0 22px 48px -18px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --paper: #0a1522; --card: #10243a; --card-2: #142a42;
  --ink: #e7eef5; --ink-soft: #a3b5c7; --ink-faint: #6d8298;
  --line: #21384f; --line-strong: #2d4661; --navy: #0c1c30;
  --amber: #e6a04c; --amber-ink: #eab876; --amber-soft: rgba(224,138,43,.16);
  --pass: #58b487; --pass-soft: rgba(46,125,85,.20);
  --warn: #e0a94e; --warn-soft: rgba(181,118,27,.22);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.6);
  --shadow-lift: 0 2px 6px rgba(0,0,0,.5), 0 22px 48px -18px rgba(0,0,0,.7);
}
:root[data-theme="light"] {
  --paper: #eceff4; --card: #ffffff; --card-2: #f7f9fb;
  --ink: #0f2033; --ink-soft: #4a5c6f; --ink-faint: #73879999;
  --line: #d6dee7; --line-strong: #c2cdd9; --navy: #10243d;
  --amber: #d47f22; --amber-ink: #9a5a12; --amber-soft: #f7ead6;
  --pass: #2e7d55; --pass-soft: #e0efe6;
  --warn: #b5761b; --warn-soft: #f6ead2;
  --shadow: 0 1px 2px rgba(16,36,61,.06), 0 8px 24px -12px rgba(16,36,61,.18);
  --shadow-lift: 0 2px 4px rgba(16,36,61,.08), 0 18px 40px -16px rgba(16,36,61,.28);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--amber) 8%, transparent), transparent 60%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.wrap { max-width: 800px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(16px, 4vw, 32px) 72px; }

/* ---------- top bar ---------- */
.topbar {
  max-width: 800px;
  margin: 0 auto;
  padding: 16px clamp(16px, 4vw, 32px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand .mark {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--navy); color: var(--amber);
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 700; font-size: .95rem;
  flex: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--amber) 40%, transparent);
}
.brand .name { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; line-height: 1; }
.brand .tag { font-size: .72rem; color: var(--ink-soft); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: .86rem;
  padding: 10px 16px; border-radius: 9px; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: var(--shadow);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--amber) 55%, transparent); outline-offset: 2px; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn.amber { background: var(--amber); color: #fff; border-color: var(--amber); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.block { width: 100%; justify-content: center; }

/* ---------- type helpers ---------- */
.eyebrow { font-family: var(--mono); font-size: .70rem; letter-spacing: .18em; text-transform: uppercase; color: var(--amber-ink); margin: 0; font-weight: 600; }
.serif { font-family: var(--serif); }

/* ---------- record header ---------- */
.record { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lift); padding: clamp(22px, 4vw, 38px); overflow: hidden; }
.record::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: linear-gradient(var(--amber), var(--navy)); }
.record h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 5.5vw, 2.7rem); line-height: 1.06; letter-spacing: -.01em; margin: 12px 0 4px; text-wrap: balance; max-width: 16ch; }
.record .sub { color: var(--ink-soft); margin: 0 0 22px; font-size: 1.02rem; max-width: 48ch; }

.stamp { position: absolute; top: clamp(20px, 4vw, 34px); right: clamp(14px, 4vw, 30px); display: grid; place-items: center; padding: 8px 14px 7px; border: 2.5px solid var(--pass); color: var(--pass); border-radius: 8px; transform: rotate(-9deg); font-family: var(--mono); font-weight: 700; font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; line-height: 1; opacity: .92; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pass) 18%, transparent); }
.stamp small { font-size: .52rem; letter-spacing: .1em; font-weight: 600; margin-top: 3px; opacity: .8; }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--line); }
.meta div { background: var(--card-2); padding: 12px 15px; }
.meta dt { font-family: var(--mono); font-size: .62rem; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 3px; }
.meta dd { margin: 0; font-size: .93rem; font-weight: 500; color: var(--ink); }

/* ---------- progress ---------- */
.progress { margin-top: 26px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.progress-top .label { font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.progress-top .pct { font-family: var(--mono); font-weight: 700; font-size: .82rem; color: var(--amber-ink); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--amber), color-mix(in srgb, var(--amber) 60%, var(--pass))); transform-origin: left; animation: grow 1.1s cubic-bezier(.2,.7,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- section head ---------- */
.sec-head { display: flex; align-items: baseline; gap: 12px; margin: 52px 0 18px; }
.sec-head h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.3rem, 3.5vw, 1.6rem); margin: 0; letter-spacing: -.01em; }
.sec-head .rule { flex: 1; height: 1px; background: var(--line-strong); }

/* ---------- next steps ---------- */
.next { background: linear-gradient(180deg, color-mix(in srgb, var(--amber-soft) 70%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line)); border-radius: 14px; box-shadow: var(--shadow); padding: clamp(20px, 4vw, 30px); }
.next h2 { font-family: var(--serif); font-size: 1.35rem; margin: 6px 0 4px; font-weight: 600; }
.next p.lede { margin: 0 0 20px; color: var(--ink-soft); max-width: 54ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 14px; align-items: start; }
.steps .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-family: var(--mono); font-weight: 700; font-size: .85rem; flex: none; }
.steps .txt strong { display: block; font-size: 1rem; }
.steps .txt span { color: var(--ink-soft); font-size: .92rem; }

/* ---------- tiles (commercials) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 22px; position: relative; }
.tile .kicker { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 8px; }
.tile .amt { font-family: var(--serif); font-size: 2rem; font-weight: 600; letter-spacing: -.01em; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile .amt small { font-size: .95rem; color: var(--ink-soft); font-family: var(--sans); font-weight: 500; }
.tile ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: .88rem; color: var(--ink-soft); }
.tile ul li { padding-left: 20px; position: relative; }
.tile ul li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--pass); font-weight: 700; font-size: .82rem; }
.tile .note { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: .8rem; color: var(--ink-faint); }

/* ---------- timeline ---------- */
.timeline { position: relative; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line-strong); }
.stage { position: relative; padding: 0 0 26px 52px; }
.stage:last-child { padding-bottom: 0; }
.node { position: absolute; left: 0; top: 2px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--line-strong); color: var(--ink-faint); font-family: var(--mono); font-weight: 700; font-size: .8rem; z-index: 1; }
.stage.done .node { background: var(--pass); border-color: var(--pass); color: #fff; }
.stage.active .node { background: var(--amber); border-color: var(--amber); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--amber) 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--amber) 22%, transparent); } 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--amber) 6%, transparent); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); }
.stage.active .card { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); box-shadow: var(--shadow-lift); }
.stage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.stage-head h3 { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; margin: 0; letter-spacing: -.005em; }
.stage p { margin: 0; color: var(--ink-soft); font-size: .93rem; }
.stage p + p { margin-top: 8px; }
.eta { margin-top: 10px; font-family: var(--mono); font-size: .74rem; color: var(--ink-faint); letter-spacing: .02em; }
blockquote.said { margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid var(--pass); background: var(--pass-soft); border-radius: 0 8px 8px 0; font-size: .9rem; color: var(--ink); font-style: italic; }
.chip { display: inline-block; font-family: var(--mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--amber-ink); background: var(--amber-soft); border-radius: 6px; padding: 3px 8px; margin-top: 10px; font-weight: 600; }

/* ---------- status pills ---------- */
.pill { font-family: var(--mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.pill.done { background: var(--pass-soft); color: var(--pass); }
.pill.active { background: var(--amber-soft); color: var(--amber-ink); }
.pill.next { background: color-mix(in srgb, var(--navy) 10%, transparent); color: var(--ink); border: 1px solid var(--line-strong); }
.pill.soon { background: transparent; color: var(--ink-faint); border: 1px solid var(--line-strong); }
.pill.paid { background: var(--pass-soft); color: var(--pass); }
.pill.pending { background: var(--warn-soft); color: var(--warn); }
.pill.waiting { background: transparent; color: var(--ink-faint); border: 1px solid var(--line-strong); }

/* ---------- footer ---------- */
footer.site { margin-top: 56px; padding-top: 26px; border-top: 1px solid var(--line-strong); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
footer.site .living { font-family: var(--mono); font-size: .68rem; color: var(--ink-faint); letter-spacing: .04em; text-align: right; max-width: 26ch; }

/* ============================================================
   PORTAL-SPECIFIC
   ============================================================ */

/* login */
.login { max-width: 420px; margin: clamp(30px,8vh,90px) auto 0; }
.login .card { padding: clamp(24px,5vw,34px); box-shadow: var(--shadow-lift); }
.login h1 { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; margin: 14px 0 4px; }
.login p.hint { color: var(--ink-soft); font-size: .92rem; margin: 0 0 22px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-family: var(--mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.field input { font-size: 16px; font-family: var(--sans); padding: 12px 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--card-2); color: var(--ink); }
.field input:focus-visible { outline: 3px solid color-mix(in srgb, var(--amber) 55%, transparent); outline-offset: 1px; border-color: var(--amber); }
.error { background: color-mix(in srgb, #c0392b 12%, var(--card)); border: 1px solid color-mix(in srgb, #c0392b 40%, var(--line)); color: #b23225; font-size: .86rem; padding: 10px 13px; border-radius: 9px; margin-bottom: 16px; }
:root[data-theme="dark"] .error { color: #f0a99f; }

/* download cards */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 14px; }
.dl-card { background: var(--card); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.dl-card .doc-ico { width: 34px; height: 42px; border-radius: 5px; background: var(--amber-soft); border: 1px solid color-mix(in srgb,var(--amber) 40%, var(--line)); display: grid; place-items: center; color: var(--amber-ink); font-family: var(--mono); font-size: .58rem; font-weight: 700; letter-spacing: .05em; margin-bottom: 6px; }
.dl-card h3 { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; margin: 0; }
.dl-card p { margin: 0; font-size: .86rem; color: var(--ink-soft); flex: 1; }
.dl-card .btn { margin-top: 12px; }

/* signing box */
.sign-box { background: linear-gradient(180deg, color-mix(in srgb, var(--amber-soft) 60%, var(--card)), var(--card)); border: 1px solid color-mix(in srgb, var(--amber) 30%, var(--line)); border-radius: 14px; box-shadow: var(--shadow); padding: clamp(20px,4vw,28px); }
.sign-box h3 { font-family: var(--serif); font-size: 1.3rem; margin: 0 0 6px; font-weight: 600; }
.sign-box p { margin: 0 0 16px; color: var(--ink-soft); max-width: 56ch; }
.sign-box .powered { margin-top: 14px; font-family: var(--mono); font-size: .66rem; letter-spacing: .05em; color: var(--ink-faint); }

/* payments table */
.pay { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); }
.pay th, .pay td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.pay thead th { font-family: var(--mono); font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); background: var(--card-2); font-weight: 600; }
.pay tbody tr:last-child td { border-bottom: none; }
.pay td.amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.pay td .desc { display: block; font-size: .78rem; color: var(--ink-faint); font-weight: 400; margin-top: 2px; }
.pay-wrap { overflow-x: auto; }

/* generic callout */
.note-box { background: var(--card-2); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 0 10px 10px 0; padding: 14px 16px; font-size: .88rem; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
@media (max-width: 520px) {
  .stamp { position: static; transform: rotate(-4deg); justify-self: start; margin-bottom: 14px; display: inline-grid; }
  .record h1 { margin-top: 0; }
  .topbar { flex-wrap: wrap; }
}
