:root {
  --bg: #f4f2ea;
  --surface: #fffef8;
  --ink: #1d2124;
  --muted: #5f6a72;
  --line: #d8d4c7;
  --brand: #14597a;
  --brand-strong: #0d3f57;
  --ok: #0e7a4c;
  --warn: #9a3f14;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top right, #fdf6dc 0, var(--bg) 55%, #ece7d7 100%);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

h1,
h2,
h3 {
  margin: 0 0 8px;
  font-family: "Fraunces", Georgia, serif;
}

h1 {
  font-size: 1.9rem;
}

p {
  margin: 0 0 10px;
}

.muted {
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid #bcc4c9;
  border-radius: 8px;
  padding: 10px 11px;
  background: #fff;
}

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

button {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  background: var(--brand-strong);
}

button.secondary {
  background: #edf3f6;
  color: #244758;
  border: 1px solid #c6d4db;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.field-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto auto;
  gap: 8px;
  margin-bottom: 8px;
}

.status {
  margin-top: 8px;
  font-weight: 600;
}

.ok {
  color: var(--ok);
}

.warn {
  color: var(--warn);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  padding: 8px 7px;
  font-size: 0.94rem;
}

th {
  color: var(--muted);
  font-weight: 700;
}

.pill {
  display: inline-block;
  background: #e8f3f8;
  border: 1px solid #bfd3de;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.82rem;
}

.error-box {
  border: 1px solid #e6bcb0;
  background: #fcedea;
  color: #7f2a13;
  padding: 10px;
  border-radius: 8px;
  margin: 10px 0;
}

.success-box {
  border: 1px solid #b7ddc8;
  background: #ecf9f0;
  color: #145332;
  padding: 10px;
  border-radius: 8px;
  margin: 10px 0;
}

.signature-pad-wrap {
  border: 1px dashed #7f919d;
  background: #fff;
  border-radius: 8px;
  padding: 8px;
}

canvas#signaturePad {
  width: 100%;
  height: 220px;
  border: 1px solid #d7dfe4;
  border-radius: 6px;
  touch-action: none;
  background: #fff;
}

.small {
  font-size: 0.86rem;
}

.hidden {
  display: none;
}

pre {
  background: #0f1720;
  color: #dae7f2;
  padding: 10px;
  border-radius: 10px;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }

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