/* ═══════════════════════════════════════════════════════════════════════════
   Zeus Legal — screen redesign prototype. Shared styles.
   System: DESIGN.md (violet). Skeleton: `app screens dated/` (2020 client
   screens) — top navbar, stepper, form-as-document, table portal.
   Local preview only; the app code is untouched.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #FAFAFA; --card: #FFFFFF; --surface: #F3F4F6;
  --border: #E5E7EB; --border-control: #8A9099;
  --text: #111827; --text-2: #4B5563; --text-3: #6B7280;
  --violet: #7C3AED; --violet-bright: #8B5CF6; --violet-ink: #6D28D9;
  --violet-tint: #F5F3FF; --violet-tint-2: #EDE9FE;
  --red: #EF4444; --red-ink: #B91C1C; --red-tint: #FEF2F2;
  --orange: #F97316; --orange-ink: #C2410C; --orange-tint: #FFF7ED;
  --blue: #3B82F6; --blue-ink: #1D4ED8; --blue-tint: #EFF6FF;
  --r-card: 16px; --r-control: 8px; --r-pill: 9999px;
  --pad: 24px; --gap: 16px;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --shadow: 0 1px 2px rgba(17,24,39,.04), 0 8px 24px rgba(17,24,39,.05);
  --shadow-lift: 0 2px 4px rgba(17,24,39,.05), 0 18px 44px rgba(17,24,39,.10);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 4px; }

/* ── type ─────────────────────────────────────────────────────────────── */
.display-md { font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
.title { font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin: 0; }
.body-md { font-size: 15px; margin: 0; }
.body-sm { font-size: 13px; line-height: 1.55; margin: 0; color: var(--text-2); }
.label { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--text-2); }

/* ── top navbar (skeleton: screen 2–9 header) ─────────────────────────── */
.topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-in { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -.01em; color: var(--text); text-decoration: none; }
.brand i { width: 28px; height: 28px; border-radius: 9px; background: var(--violet); display: grid; place-items: center; color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 700; font-style: normal; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a { padding: 7px 13px; border-radius: var(--r-pill); color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; transition: background-color 160ms ease, color 160ms ease; }
.topnav a:hover { background: var(--bg); color: var(--text); }
.topnav a[aria-current="page"] { background: var(--violet-tint); color: var(--violet-ink); font-weight: 600; }
.account { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; }
.account i { width: 30px; height: 30px; border-radius: var(--r-pill); background: var(--violet-tint-2); display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--violet-ink); font-style: normal; }
.account svg { width: 14px; height: 14px; color: var(--text-3); }
@media (max-width: 700px) { .topnav { display: none; } }

/* ── page frame + header row (skeleton: title left, actions right) ────── */
.frame { max-width: 1280px; margin: 0 auto; padding: 32px 24px 96px; }
.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.pagehead .actions { display: flex; gap: 10px; }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--r-control); font-family: var(--sans); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-pay { height: 52px; padding: 0 26px; font-size: 15px; } /* paid-path floor */
.btn-primary { background: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-ink); }
.btn-secondary { background: var(--card); color: var(--text); border-color: var(--border-control); }
.btn-secondary:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }

/* ── stepper (skeleton: screens 3–6) ──────────────────────────────────── */
.stepper { display: flex; margin: 4px 0 32px; }
.step { flex: 1; display: flex; flex-direction: column; gap: 10px; position: relative; }
.step::before { content: ""; height: 3px; border-radius: 2px; background: var(--border); margin-right: 8px; }
.step[data-state="done"]::before, .step[data-state="active"]::before { background: var(--violet); }
.step small { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.step b { font-size: 13.5px; font-weight: 600; color: var(--text-3); }
.step[data-state="active"] b, .step[data-state="active"] small { color: var(--violet-ink); }
.step[data-state="done"] b { color: var(--text); }
@media (max-width: 700px) { .step b { font-size: 12px; } }

/* ── panels / cards ───────────────────────────────────────────────────── */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--pad); }
.panel-hover { transition: transform 200ms cubic-bezier(.2,.7,.3,1), box-shadow 200ms cubic-bezier(.2,.7,.3,1); }
.panel-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

/* ── icon squares ─────────────────────────────────────────────────────── */
.isq { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; }
.isq svg { width: 17px; height: 17px; }
.isq-violet { background: var(--violet-tint-2); color: var(--violet-ink); }
.isq-orange { background: var(--orange-tint); color: var(--orange-ink); }
.isq-blue { background: var(--blue-tint); color: var(--blue-ink); }
.isq-red { background: var(--red-tint); color: var(--red-ink); }

/* ── forms (skeleton: form-as-document) ───────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13.5px; font-weight: 600; }
.input { width: 100%; height: 44px; padding: 0 12px; background: var(--card); color: var(--text); border: 1px solid var(--border-control); border-radius: var(--r-control); font-family: var(--sans); font-size: 15px; }
textarea.input { height: auto; min-height: 120px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input::placeholder { color: var(--text-3); }
.input:focus-visible { border-color: var(--violet); }
.hint { font-size: 13px; color: var(--text-3); }
.tpl-block { background: var(--surface); border-radius: var(--r-control); padding: 14px 16px; font-size: 14px; line-height: 1.65; color: var(--text-2); }
.tpl-block b { color: var(--text); }
.addmore { display: inline-flex; align-items: center; gap: 6px; color: var(--violet-ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.addmore:hover { text-decoration: underline; }

/* ── two-column work area: form left, preview rail right ──────────────── */
.split { display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 28px; align-items: start; }
.rail { position: sticky; top: 84px; }
@media (max-width: 980px) { .split { grid-template-columns: 1fr; } .rail { position: static; } }

/* ── the document paper + watermark ───────────────────────────────────── */
.paper { position: relative; background: #fff; border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); padding: 34px 30px; font-family: Georgia, "Times New Roman", serif; font-size: 11.5px; line-height: 1.75; color: #1f2937; overflow: hidden; user-select: none; }
.paper h4 { font-size: 12px; text-align: center; margin: 0 0 12px; letter-spacing: .02em; }
.paper p { margin: 0 0 9px; text-align: justify; }
.paper .b { font-weight: 700; }
.paper .c { text-align: center; font-weight: 700; }
.paper-lg { font-size: 14px; padding: 48px 44px; max-width: 760px; margin: 0 auto; }
.wm { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; overflow: hidden; }
.wm span { transform: rotate(-32deg); font-family: var(--mono); font-weight: 700; font-size: clamp(22px, 4.2vw, 46px); letter-spacing: .18em; color: rgba(124, 58, 237, .14); white-space: nowrap; text-transform: uppercase; border: 3px solid rgba(124, 58, 237, .10); border-radius: 10px; padding: 10px 26px; }
.wm-note { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); }
.wm-note svg { width: 14px; height: 14px; flex: none; color: var(--violet-ink); }

/* ── chips (spec §5 copy, DESIGN.md §7 treatment) ─────────────────────── */
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: var(--r-pill); font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; text-align: left; }
.dot { width: 6px; height: 6px; border-radius: var(--r-pill); flex: none; box-shadow: inset 0 0 0 1.5px currentColor; }
.dot-solid { background: currentColor; box-shadow: none; }
.chip-draft { background: var(--surface); color: var(--text-2); }
.chip-await { background: var(--orange-tint); color: var(--orange-ink); }
.chip-proc { background: var(--blue-tint); color: var(--blue-ink); }
.chip-paid { background: var(--violet-tint); color: var(--violet-ink); }
.chip-ready { background: var(--violet); color: #fff; }
.chip-fail { background: var(--red-tint); color: var(--red-ink); position: relative; padding-left: 15px; }
.chip-fail::before { content: ""; position: absolute; left: 5px; top: 50%; transform: translateY(-50%); width: 3px; height: 11px; background: currentColor; border-radius: 2px; }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

/* ── portal table (skeleton: screen 7) ────────────────────────────────── */
.tablewrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.scroll { overflow-x: auto; }
table.docs { border-collapse: collapse; width: 100%; min-width: 860px; font-size: 14px; }
table.docs th { text-align: left; font-family: var(--mono); font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 14px 16px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--card); }
table.docs td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.docs tbody tr { position: relative; transition: background-color 140ms ease; }
table.docs tbody tr:hover { background: var(--violet-tint); }
table.docs tbody tr:last-child td { border-bottom: 0; }
td.stripe { padding: 0; width: 4px; }
td.stripe i { display: block; width: 4px; height: 30px; border-radius: 2px; }
.filters td { padding: 8px 16px 12px; border-bottom: 1px solid var(--border); }
.filters .input { height: 34px; font-size: 13px; }
.rowactions { display: flex; gap: 6px; justify-content: flex-end; }
.iconbtn { width: 32px; height: 32px; border-radius: var(--r-control); border: 1px solid transparent; background: transparent; color: var(--text-3); display: grid; place-items: center; cursor: pointer; text-decoration: none; transition: background-color 140ms ease, color 140ms ease; }
.iconbtn:hover { background: var(--card); color: var(--violet-ink); border-color: var(--border); }
.iconbtn svg { width: 16px; height: 16px; }
.tfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager a { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-control); color: var(--text-2); text-decoration: none; font-family: var(--mono); font-size: 12px; }
.pager a:hover { background: var(--surface); }
.pager a[aria-current="page"] { background: var(--violet); color: #fff; }

/* ── tabs (skeleton: screen 8) ────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.tabs a { padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--text-3); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--violet-ink); border-bottom-color: var(--violet); }

/* ── meta strip (detail page summary) ─────────────────────────────────── */
.metastrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; }
.metastrip > div { background: var(--card); padding: 14px 16px; display: flex; flex-direction: column; gap: 5px; }

/* ── misc ─────────────────────────────────────────────────────────────── */
.callout { border-left: 3px solid var(--violet); background: var(--violet-tint); border-radius: var(--r-control); padding: 13px 16px; font-size: 13.5px; color: var(--text-2); }
.callout b { color: var(--violet-ink); }
.proto { position: fixed; bottom: 14px; right: 14px; z-index: 30; background: var(--text); color: #fff; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; padding: 6px 11px; border-radius: var(--r-pill); opacity: .85; }
.rise { opacity: 0; transform: translateY(10px); animation: rise 560ms cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rise { opacity: 1; transform: none; }
}
