:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #18202a;
  --muted: #657184;
  --border: #dce2ea;
  --accent: #0f3d67;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.container {
  width: min(980px, calc(100% - 28px));
  margin: 28px auto;
}
.narrow { width: min(680px, calc(100% - 28px)); }
.hero {
  text-align: center;
}
.hero h1 {
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 25px rgba(15, 61, 103, 0.05);
}
h2 { margin-top: 0; color: var(--accent); }
h3 { margin-bottom: 6px; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}
.radio {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
  font-weight: 600;
}
.radio input { width: auto; }
.legal-text {
  font-size: 0.96rem;
}
.signature-box {
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 10px;
}
canvas {
  width: 100%;
  height: 220px;
  display: block;
  touch-action: none;
}
button {
  border: 0;
  border-radius: 10px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
}
.primary {
  width: 100%;
  background: var(--accent);
  color: white;
  font-size: 1rem;
}
.secondary {
  background: #e9eef5;
  color: var(--text);
}
@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}

.actions-card h2,
.pdf-preview-card h2 { margin-bottom: 14px; }
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.actions-row.centered { justify-content: center; }
.button,
a.button {
  display: inline-block;
  text-decoration: none;
  border-radius: 10px;
  padding: 13px 18px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}
.primary-link {
  background: var(--accent);
  color: #fff;
}
.secondary-link {
  background: #e9eef5;
  color: var(--text);
}
.email-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 6px;
}
.email-form .muted {
  grid-column: 1 / -1;
  margin: 0;
}
.small { font-size: 0.9rem; }
.muted { color: var(--muted); }
.notice {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
}
.notice.success { background: #e8f6ee; color: #17643a; }
.notice.error { background: #fdecec; color: #8f1d1d; }
.pdf-preview {
  width: 100%;
  height: 78vh;
  min-height: 640px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
@media (max-width: 720px) {
  .email-form { grid-template-columns: 1fr; }
  .actions-row .button { width: 100%; }
  .pdf-preview { height: 70vh; min-height: 520px; }
}
