:root {
  color-scheme: light;
  --ink: #000000;
  --text: #434345;
  --muted: #737373;
  --line: #dedbd6;
  --panel: #ffffff;
  --page: #f7f6f3;
  --primary: #000000;
  --primary-dark: #434345;
  --navy: #000000;
  --gold: #bca480;
  --accent: #bca480;
  --focus: rgba(188, 164, 128, 0.35);
  --danger-bg: #fff4ed;
  --danger-line: #efb38f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 28px 18px 64px;
}

.brand-mark {
  margin: 0 auto 22px;
  text-align: center;
}

.brand-mark img {
  display: block;
  width: min(230px, 58vw);
  height: auto;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.08);
  padding: clamp(22px, 5vw, 34px);
  margin: 0 auto 18px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding-top: 8px;
  border-top: 4px solid var(--accent);
  color: var(--navy);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

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

h2 {
  color: var(--ink);
  font-size: clamp(1.75rem, 6vw, 2.45rem);
  line-height: 1.08;
  margin-bottom: 12px;
  text-align: center;
  text-transform: uppercase;
  font-weight: 900;
}

.panel > .eyebrow:first-child {
  display: block;
  width: max-content;
  margin-inline: auto;
}

.lead {
  color: var(--muted);
  max-width: 58ch;
  font-size: 1.08rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.progress {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  margin: 0 auto 20px;
  max-width: 620px;
}

.progress li {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--muted);
  font-weight: 850;
  font-size: 0.78rem;
  text-transform: uppercase;
  position: relative;
}

.progress li::before {
  content: attr(data-step-label);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #cbd6df;
  background: #fff;
  color: var(--muted);
  z-index: 1;
}

.progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: #cbd6df;
}

.progress li.is-active,
.progress li.is-complete {
  color: var(--ink);
}

.progress li.is-active::before,
.progress li.is-complete::before {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.progress li.is-complete::after {
  background: var(--primary);
}

.choice-grid {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.choice {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 16px;
  min-height: 104px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  padding: 18px;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button-choice {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 72px;
  padding: 0 22px;
  place-items: center;
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  text-align: center;
  text-transform: uppercase;
}

.button-choice::before {
  display: none;
}

.button-choice:hover,
.button-choice.is-selected {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.12);
}

.choice::before {
  content: "";
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid #c8d3dd;
  background: #fff;
}

.choice:hover,
.choice.is-selected {
  border-color: var(--gold);
  box-shadow: 0 9px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.choice.is-selected::before {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 5px #fff;
  background: var(--gold);
}

.choice span {
  display: block;
  color: var(--ink);
  font-weight: 900;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.choice small {
  color: var(--muted);
  line-height: 1.45;
}

.button-choice span {
  color: #fff;
  margin: 0;
  letter-spacing: 0.02em;
}

.section-divider {
  height: 1px;
  background: var(--line);
  margin: 30px 0 24px;
}

.notice {
  margin-top: 18px;
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  border-radius: 5px;
  padding: 18px;
}

.notice h3 {
  color: var(--ink);
}

.form-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.form-heading h2 {
  text-align: left;
  text-transform: none;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 18px;
  margin: 0 0 18px;
  background: #fff;
}

legend {
  padding: 0 8px;
  color: var(--ink);
  font-weight: 900;
}

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

label {
  display: grid;
  gap: 7px;
  font-weight: 800;
  color: var(--ink);
}

input,
textarea {
  width: 100%;
  border: 1px solid #ccd7e1;
  border-radius: 4px;
  padding: 13px 13px;
  background: #fbfdff;
  color: var(--text);
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

textarea {
  resize: vertical;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 800;
  line-height: 1.4;
}

.check-row input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.field-note {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 14px;
}

.stacked-options {
  display: grid;
  gap: 12px;
}

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

.segmented label {
  display: block;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  place-items: center;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.segmented input:checked + span {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.primary,
.secondary,
.link-button,
.download {
  border: 0;
  border-radius: 2px;
  font-weight: 900;
  min-height: 52px;
  padding: 0 22px;
  cursor: pointer;
  text-decoration: none;
  display: inline-grid;
  place-items: center;
  text-transform: uppercase;
}

.primary {
  background: var(--primary);
  color: #fff;
}

.primary:hover {
  background: var(--gold);
}

.secondary {
  background: #e6edf3;
  color: var(--ink);
}

.link-button {
  background: transparent;
  color: var(--text);
  padding-inline: 8px;
  min-height: 38px;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.signature-box {
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
  margin: 18px 0;
}

.signature-label {
  display: block;
  padding: 12px 14px 0;
  color: var(--ink);
  font-weight: 900;
}

.review-loader {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 16px;
  color: var(--muted);
  font-weight: 800;
}

.packet-frame-wrap {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
  height: min(78vh, 900px);
  min-height: 560px;
}

#packet-preview {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

#signature-pad,
#signature-pad-2 {
  display: block;
  width: 100%;
  height: 220px;
  touch-action: none;
  background:
    linear-gradient(transparent 72%, rgba(23, 50, 77, 0.18) 72%, rgba(23, 50, 77, 0.18) 73%, transparent 73%),
    #fff;
}

.status {
  margin-top: 16px;
  border-radius: 5px;
  padding: 14px;
  background: #e8f6fb;
  color: var(--ink);
  font-weight: 800;
}

.status.is-error {
  background: var(--danger-bg);
  color: #8b2d0d;
}

.download {
  margin-top: 20px;
  background: var(--primary);
  color: #fff;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px 12px 44px;
  }

  .brand-mark {
    margin-bottom: 16px;
  }

  .brand-mark img {
    width: min(190px, 64vw);
  }

  .progress {
    margin-bottom: 14px;
  }

  .progress li {
    font-size: 0.65rem;
  }

  .panel {
    padding: 20px;
  }

  h2 {
    font-size: 1.85rem;
  }

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

  .choice {
    min-height: 96px;
  }

  .packet-frame-wrap {
    height: 72vh;
    min-height: 480px;
  }

  .form-heading {
    display: grid;
  }

  .button-row {
    display: grid;
  }

  .button-row > * {
    width: 100%;
  }
}
