:root {
  --orange: #EF8B22;
  --fuchsia: #C8177D;
  --turquoise: #0099CC;
  --ink: #26313a;
  --muted: #697782;
  --line: #dbe2e8;
  --paper: #ffffff;
  --bg: #f4f6f8;
  --shadow: 0 16px 40px rgba(31, 44, 56, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(239,139,34,.11), transparent 30rem),
    radial-gradient(circle at top right, rgba(0,153,204,.09), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: "Nunito", Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

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

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto 64px;
}

.card {
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(201,211,219,.78);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 32px;
  border-top: 6px solid var(--orange);
}

.hero-logo {
  width: 112px;
  height: 112px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow {
  color: var(--fuchsia);
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 4px;
  text-transform: uppercase;
  font-size: .78rem;
}

h1, h2, h3, h4 { margin-top: 0; }

h1 {
  margin-bottom: 6px;
  font-size: clamp(1.7rem, 3vw, 2.45rem);
  line-height: 1.12;
}

.hero p:last-child { margin: 0; color: var(--muted); }

.form-card, .preview-card { padding: 30px 32px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading h2 { margin: 0; font-size: 1.55rem; }

.required-note {
  color: var(--muted);
  font-size: .9rem;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.field { margin-bottom: 18px; }

label {
  display: block;
  font-weight: 800;
  margin-bottom: 7px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #cfd9e1;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input, select {
  min-height: 46px;
  padding: 10px 12px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--turquoise);
  box-shadow: 0 0 0 3px rgba(0,153,204,.13);
}

small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.location-summary {
  margin-top: 4px;
  background: #f7fbfd;
  border-left: 4px solid var(--turquoise);
  padding: 14px 16px;
  border-radius: 0 10px 10px 0;
  color: #41505c;
}

.preview-heading { align-items: center; }

.action-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.btn {
  border: 0;
  border-radius: 9px;
  min-height: 42px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  color: white;
  background: var(--fuchsia);
  box-shadow: 0 7px 18px rgba(200,23,125,.18);
}

.btn-image {
  color: white;
  background: #26313a;
  box-shadow: 0 7px 18px rgba(38,49,58,.16);
}

.btn-secondary { color: white; background: var(--turquoise); }
.btn-ghost { color: #fff; background: var(--orange); }
.btn-small { min-height: 36px; padding: 7px 11px; font-size: .9rem; }

.preview-wrap {
  overflow-x: auto;
  background:
    linear-gradient(45deg, #f7f8f9 25%, transparent 25%),
    linear-gradient(-45deg, #f7f8f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f7f8f9 75%),
    linear-gradient(-45deg, transparent 75%, #f7f8f9 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
}

#signaturePreview {
  min-width: 810px;
  background: white;
  width: fit-content;
  max-width: 100%;
  padding: 14px;
  border-radius: 8px;
}

.collapsible {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  background: #fbfcfd;
}

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

.panel-heading h3 { margin: 0; }

#htmlSource {
  min-height: 310px;
  padding: 14px;
  resize: vertical;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: .83rem;
  line-height: 1.45;
}

.instructions h3 { margin-bottom: 18px; }
.instructions h4 { color: var(--fuchsia); margin: 18px 0 8px; }
.instructions ol { margin-top: 0; }
.tip {
  margin-top: 20px;
  padding: 13px 15px;
  border-radius: 10px;
  background: rgba(239,139,34,.10);
  border-left: 4px solid var(--orange);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  background: #26313a;
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 760px) {
  .page-shell { width: min(100% - 20px, 1120px); margin-top: 10px; }
  .hero { align-items: flex-start; padding: 22px; }
  .hero-logo { width: 84px; height: 84px; }
  .form-card, .preview-card { padding: 22px; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .section-heading, .preview-heading { align-items: flex-start; flex-direction: column; }
  .action-group { justify-content: flex-start; }
  .preview-wrap { padding: 14px; }
}

.tip-png {
  background: rgba(0,153,204,.08);
  border-left-color: var(--turquoise);
}
