:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --line: #dce6f4;
  --primary: #0b5ad6;
  --primary-dark: #083f98;
  --muted: #64748b;
  --success: #166534;
  --success-bg: #dcfce7;
  --warning: #9a5b00;
  --warning-bg: #fef3c7;
  --text: #18212d;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
}

.topbar {
  padding: 2rem 2rem 1rem;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  border-bottom: 1px solid var(--line);
}

.topbar.compact {
  padding-bottom: 0.75rem;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08rem;
  font-weight: bold;
}

h1, h2, h3 {
  margin: 0 0 0.75rem;
}

.layout,
.signer-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-weight: 600;
  color: var(--text);
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  background: white;
}

textarea {
  resize: vertical;
  min-height: 160px;
}

button {
  border: none;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  background: #edf2ff;
  color: var(--primary-dark);
}

button.secondary:hover {
  background: #dfe9ff;
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.signer-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.preview-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafcff;
  min-height: 220px;
  padding: 1rem;
  line-height: 1.6;
}

.preview-box h1,
.preview-box h2,
.preview-box h3 {
  margin-top: 1rem;
}

.preview-box ul,
.preview-box ol {
  padding-left: 1.2rem;
}

.documents-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.document-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  background: #fbfdff;
}

.document-card-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--warning-bg);
  color: var(--warning);
}

.status-pill.success {
  background: var(--success-bg);
  color: var(--success);
}

.signer-list {
  margin: 0.75rem 0 0;
  padding-left: 1rem;
}

.status-text {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.hidden-box,
.hidden-form {
  display: none;
}

.hidden-box.visible,
.hidden-form.visible {
  display: block;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-direction: row !important;
}

.checkbox-row input {
  width: auto;
}

.success-box {
  background: var(--success-bg);
  color: var(--success);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid rgba(22, 101, 52, 0.18);
}

@media (max-width: 800px) {
  .layout,
  .signer-layout {
    grid-template-columns: 1fr;
  }

  .signer-row {
    grid-template-columns: 1fr;
  }
}
