:root {
  --ink: #093666;
  --muted: #5f6f89;
  --line: #dfe7f2;
  --bg: #f7fafc;
  --paper: #ffffff;
  --primary: #0561d9;
  --primary-dark: #093666;
  --primary-soft: #eaf2ff;
  --amber: #e0a100;
  --red: #cf3f3f;
  --shadow: 0 20px 50px rgba(9, 54, 102, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: 0; }
.brand-logo { display: block; width: 168px; height: auto; }
.sidebar .brand-logo { filter: brightness(0) invert(1); }
.navlinks { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: 15px; }
.actions { display: flex; align-items: center; gap: 10px; }
.btn {
  border: 0; border-radius: 8px; padding: 11px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; cursor: pointer; font-weight: 700;
  background: var(--ink); color: #fff;
}
.btn:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn.primary { background: var(--primary); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--red); }
.hero {
  min-height: calc(100vh - 72px);
  display: grid; align-items: center;
  padding: 46px 0 34px;
  background:
    linear-gradient(110deg, rgba(247,250,252,.98), rgba(247,250,252,.76)),
    url("https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=1800&q=82") center/cover;
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 42px; align-items: center; }
.eyebrow { color: var(--primary); font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: .08em; }
h1 { font-size: clamp(42px, 6vw, 72px); line-height: .98; margin: 14px 0 18px; letter-spacing: 0; }
.lead { font-size: 20px; line-height: 1.55; color: #34445d; max-width: 680px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0; }
.pill { border: 1px solid var(--line); background: rgba(255,255,255,.82); border-radius: 999px; padding: 9px 12px; font-weight: 700; color: #31415a; }
.product-shot {
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.shot-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.shot-body { padding: 18px; display: grid; gap: 14px; }
.doc-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.doc-icon { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-dark); font-weight: 900; }
.small { color: var(--muted); font-size: 13px; }
.status { border-radius: 999px; padding: 6px 9px; font-size: 12px; font-weight: 800; background: #eef3fb; color: #37506e; white-space: nowrap; }
.status.signed { background: var(--primary-soft); color: var(--primary-dark); }
.status.pending { background: #fff6dd; color: #8a6100; }
.section { padding: 72px 0; }
.section h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.05; margin: 0 0 14px; letter-spacing: 0; }
.muted { color: var(--muted); line-height: 1.6; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 22px; box-shadow: 0 10px 30px rgba(20,33,61,.05); }
.card h3 { margin: 0 0 8px; font-size: 20px; }
.split-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--primary-dark); color: white; padding: 22px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { color: white; margin-bottom: 26px; }
.side-nav { display: grid; gap: 8px; }
.side-nav a { padding: 11px 12px; border-radius: 8px; color: #d8e4f4; font-weight: 700; }
.side-nav a:hover, .side-nav a.active { background: rgba(255,255,255,.10); color: white; }
.main { padding: 28px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head h1 { font-size: 34px; line-height: 1.1; margin: 0 0 6px; }
.table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.table th, .table td { padding: 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { color: var(--muted); font-size: 13px; background: #fbfdff; }
.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
}
.toolbar input, .toolbar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}
.metric span { color: var(--muted); display: block; font-size: 13px; font-weight: 700; }
.metric strong { display: block; margin-top: 8px; font-size: 28px; line-height: 1; }
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr) minmax(220px, .85fr);
  gap: 14px;
  margin-bottom: 16px;
}
.progress {
  height: 10px;
  border-radius: 999px;
  background: #edf3fa;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--primary);
}
.copy-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.copy-line input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field label { font-weight: 800; font-size: 14px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px 13px; background: white; color: var(--ink);
}
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #f2f7fb; }
.auth-box { width: min(440px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 26px; box-shadow: var(--shadow); }
.validator-box { width: min(760px, 100%); }
.validation-result { margin-top: 18px; }
.validation-list { display: grid; gap: 10px; margin-top: 12px; }
.flash { border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.flash.error { background: #ffecec; color: #a32020; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 54, 102, .48);
  backdrop-filter: blur(5px);
}
.modal-backdrop.is-hidden { display: none; }
.modal-box {
  position: relative;
  width: min(520px, 100%);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(9, 54, 102, .24);
  padding: 28px;
}
.modal-box .brand { margin-bottom: 18px; }
.modal-box h2 { margin: 0 0 12px; font-size: 28px; line-height: 1.12; letter-spacing: 0; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}
.waitlist-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}
.waitlist-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 13px;
}
.sign-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.viewer { background: #dce5ef; padding: 18px; }
.viewer iframe { width: 100%; height: calc(100vh - 36px); border: 0; background: white; border-radius: 8px; }
.sign-panel { background: white; border-left: 1px solid var(--line); padding: 24px; overflow: auto; }
.signature-pad { width: 100%; height: 180px; border: 1px dashed #9eb0c7; border-radius: 8px; background: #fbfdff; touch-action: none; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef3fb; padding: 2px 6px; border-radius: 6px; }
footer { padding: 34px 0; border-top: 1px solid var(--line); color: var(--muted); background: white; }

@media (max-width: 860px) {
  .navlinks { display: none; }
  .hero { min-height: auto; }
  .hero-grid, .grid3, .app-shell, .sign-layout, .metric-grid, .detail-grid, .toolbar { grid-template-columns: 1fr; }
  .waitlist-form { grid-template-columns: 1fr; }
  .split-band { flex-direction: column; align-items: flex-start; padding: 22px; }
  .sidebar { position: static; height: auto; }
  .side-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .main { padding: 18px; }
  .page-head { flex-direction: column; }
  .table { display: block; overflow-x: auto; }
  .sign-panel { border-left: 0; border-top: 1px solid var(--line); }
  .viewer iframe { height: 60vh; }
}
