:root {
  --green: #39ff14;
  --green-soft: rgba(57, 255, 20, 0.12);
  --green-line: rgba(57, 255, 20, 0.22);
  --bg: #070b08;
  --panel: rgba(13, 20, 15, 0.94);
  --panel-2: #0e1510;
  --line: rgba(57, 255, 20, 0.15);
  --line-strong: rgba(57, 255, 20, 0.34);
  --text: #edf5ea;
  --text-dim: #95aa94;
  --text-muted: #5e735d;
  --paper: #fff;
  --paper-text: #1d1d1b;
  --yellow: #ffe66d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "Inter", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 52% -12%, rgba(57, 255, 20, 0.13), transparent 32%),
    linear-gradient(180deg, #081009 0%, #050805 100%);
  overflow-x: hidden;
}
a { color: inherit; }
.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 200;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--green);
  cursor: pointer;
}
.menu-toggle svg { width: 18px; height: 18px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0.65); }
.sidebar-overlay.active { display: block; }
.main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  margin-left: var(--sidebar-w, 220px);
  padding: 28px 30px 42px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  color: var(--text-muted);
  font-size: 12px;
  flex-wrap: wrap;
}
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover, .breadcrumb .current { color: var(--green); }
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(57, 255, 20, 0.08), transparent 52%), var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
}
.eyebrow, .panel-kicker {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero h1 {
  max-width: 760px;
  margin-top: 9px;
  color: #fff;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.04;
  font-weight: 900;
}
.hero h1 span { color: #fff1a3; }
.hero-text {
  max-width: 780px;
  margin-top: 12px;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
}
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 15px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: #041104; border-color: var(--green); }
.btn-secondary { background: #fff1a3; color: #17180d; border-color: #fff1a3; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-small { min-height: 36px; padding: 9px 12px; font-size: 12px; }
.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(500px, 1.1fr);
  gap: 18px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.form-panel, .preview-panel { padding: 22px; }
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.panel-header h2 {
  margin-top: 5px;
  color: #fff;
  font-size: 22px;
  line-height: 1.15;
}
.progress-copy { min-width: 158px; text-align: right; }
.progress-bar {
  width: 158px;
  height: 7px;
  margin-left: auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.progress-bar div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #fff1a3, var(--green));
  transition: width .22s ease;
}
#progressLabel {
  display: inline-block;
  margin-top: 8px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field span {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
}
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  padding: 12px 13px;
  font: 700 13px "Inter", sans-serif;
  outline: none;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(57, 255, 20, 0.08);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-muted); }
.span-2 { grid-column: span 2; }
.model-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}
.model-card strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
}
.model-link {
  flex: 0 0 auto;
  color: #fff1a3;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}
.sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-bottom: 16px;
  background: linear-gradient(180deg, rgba(13, 20, 15, 1), rgba(13, 20, 15, 0.9) 82%, rgba(13, 20, 15, 0));
}
.contract-paper {
  max-height: calc(100vh - 230px);
  min-height: 920px;
  overflow: auto;
  padding: 34px 38px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--paper-text);
  box-shadow: inset 0 0 0 1px #d8d8d8;
}
.preview-loading {
  color: #666;
  font: 700 14px "Inter", sans-serif;
}
.doc-p {
  margin: 0 0 10px;
  color: #1f2428;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12pt;
  line-height: 1.42;
  text-align: justify;
}
.doc-spacer {
  margin: 0 0 6px;
  min-height: 10px;
  font-size: 8pt;
}
.doc-p.center { text-align: center; }
.doc-p.section-title {
  margin: 16px 0 10px;
  font-weight: 700;
}
.doc-p.signature-date {
  margin-top: 28px;
  text-align: center;
}
.fill-yellow {
  background: var(--yellow);
  padding: 0 3px;
  border-radius: 2px;
}
.fill-active {
  outline: 2px solid #39ff14;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(57, 255, 20, 0.16);
  transition: outline-color .18s ease, box-shadow .18s ease;
}
.dark-highlight {
  background: #111;
  color: #f1c40f;
  padding: 1px 3px;
}
.doc-link {
  color: #1768e1;
  text-decoration: underline;
}
.signature-table {
  width: 100%;
  margin: 30px 0 20px;
  border-collapse: collapse;
  table-layout: fixed;
}
.signature-table td {
  width: 50%;
  padding: 10px 18px;
  vertical-align: top;
  text-align: center;
}
.signature-table .doc-p {
  margin-bottom: 6px;
  text-align: center;
}
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(11, 18, 13, 0.97);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; }
  .contract-paper { max-height: none; min-height: auto; }
}
@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; padding: 66px 14px 24px; }
  .hero, .form-panel, .preview-panel { padding: 18px; }
  .hero-actions, .hero-actions .btn { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .panel-header, .model-card { flex-direction: column; align-items: flex-start; }
  .progress-copy, .progress-bar { width: 100%; min-width: 0; text-align: left; }
  .contract-paper { padding: 24px 18px; }
}
@media print {
  body { background: #fff; }
  .sidebar, .menu-toggle, .sidebar-overlay, .breadcrumb, .hero, .form-panel, .toast, .sticky, .btn { display: none !important; }
  .main { margin: 0; padding: 0; }
  .workspace, .preview-panel, .panel { display: block; border: 0; padding: 0; background: transparent; box-shadow: none; }
  .contract-paper { max-height: none; min-height: auto; overflow: visible; padding: 0; border-radius: 0; box-shadow: none; }
}
