:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #5d6875;
  --line: #d9e0e7;
  --panel: #ffffff;
  --page: #f4f7f5;
  --accent: #176b5c;
  --accent-strong: #0f5146;
  --warning: #9b4d16;
  --soft: #eaf3ef;
  --focus: #285bd4;
  --error: #b42318;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

.site-header {
  background: #18322f;
  color: #fff;
  padding: 34px 20px 30px;
}

.header-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.eyebrow,
.step-kicker {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
}

.lede {
  max-width: 720px;
  margin-bottom: 0;
  color: #dfe9e5;
  font-size: 1.08rem;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 28px auto 48px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.progress-panel {
  position: sticky;
  top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.step-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.step-list li::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  flex: 0 0 auto;
}

.step-list li.active {
  color: var(--accent-strong);
}

.step-list li.active::before {
  border-color: var(--accent);
  background: var(--accent);
}

.step-list li.done {
  color: var(--ink);
}

.step-list li.done::before {
  border-color: var(--accent);
  background: var(--soft);
}

.form-panel,
.success-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 35px rgb(27 44 53 / 8%);
}

.form-step {
  display: none;
  padding: 28px;
}

.form-step.active {
  display: block;
}

.section-heading {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin-bottom: 6px;
  font-size: 1.7rem;
  line-height: 1.2;
}

.section-heading p:not(.step-kicker) {
  margin-bottom: 0;
  color: var(--muted);
}

label,
fieldset {
  margin: 0 0 18px;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid #b9c4ce;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus), transparent 72%);
  outline-offset: 2px;
  border-color: var(--focus);
}

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

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

.field-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfb;
}

.choice-group legend {
  padding: 0 6px;
  font-weight: 800;
}

.choice-group label,
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 10px 0 0;
  font-weight: 700;
}

.choice-group input,
.check-row input {
  width: auto;
  min-width: 18px;
  height: 18px;
  margin-top: 2px;
}

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

.checkbox-grid legend {
  grid-column: 1 / -1;
}

.nested {
  margin-top: 18px;
}

.reading-block,
.conditional-block,
.sub-block,
.declaration {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.reading-block h3,
.conditional-block h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.reading-block p,
.conditional-block p,
.declaration p {
  color: #34414e;
}

.reading-block ul {
  margin: 0 0 14px;
  padding-left: 22px;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.source-links a {
  color: var(--accent-strong);
  font-weight: 800;
}

.induction-document {
  display: grid;
  min-width: 0;
  width: 100%;
  gap: 18px;
  margin: 0 0 18px;
}

.induction-page {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1076 / 1521;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 22px rgb(27 44 53 / 8%);
}

.permit-checks {
  margin-bottom: 18px;
  padding: 4px 0;
}

.signature-field {
  margin-top: 18px;
}

.signature-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 800;
}

canvas {
  display: block;
  width: 100%;
  height: 180px;
  border: 1px solid #aeb9c5;
  border-radius: 8px;
  background: #fff;
  touch-action: none;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

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

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

.secondary {
  background: #fff;
  color: var(--accent-strong);
  border-color: #9bb8af;
}

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  text-decoration: underline;
}

.error {
  border-color: var(--error) !important;
}

.inline-error {
  margin: -8px 0 16px;
  color: var(--error);
  font-weight: 800;
}

.success-panel {
  grid-column: 2;
  padding: 28px;
}

.success-panel pre {
  max-height: 420px;
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: #101820;
  color: #e7f3ef;
  white-space: pre-wrap;
}

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

  .progress-panel {
    position: static;
  }

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

  .success-panel {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding-top: 28px;
  }

  .shell {
    width: min(100% - 20px, 1120px);
    margin-top: 16px;
  }

  .form-step,
  .success-panel {
    padding: 20px;
  }

  .field-grid.two,
  .field-grid.three,
  .checkbox-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-direction: column-reverse;
  }

  button {
    width: 100%;
  }
}

@media print {
  .site-header,
  .progress-panel,
  .form-panel,
  .actions {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .shell {
    display: block;
    width: 100%;
    margin: 0;
  }

  .success-panel {
    border: 0;
    box-shadow: none;
  }

  .success-panel pre {
    background: #fff;
    color: #000;
    border: 1px solid #999;
  }
}
