:root {
  --navy: #1B2A4A;
  --navy-light: #2A3F6B;
  --orange: #E8852A;
  --orange-dark: #C46E1A;
  --green: #2D6B4A;
  --sky: #7EC8E8;
  --parchment: #FAF6EC;
  --parchment-dim: #F1EBDC;
  --page-bg: #373657;
  --sheet-ink: #ffffff;
  --sheet-muted: rgba(255, 255, 255, 0.78);
  --sheet-line: rgba(255, 255, 255, 0.28);
  --field-border: rgba(255, 255, 255, 0.55);
  --sheet-well: rgba(255, 255, 255, 0.08);
  --charcoal: #2A2A28;
  --rule: #D8CFB8;
  --error: #B34A3C;
  --field-radius: 8px;
  --field-control-h: 42px;
  --ink: var(--navy);
  --brass: var(--orange);
  --brass-dark: var(--orange-dark);
  --sage: var(--green);
}

* { box-sizing: border-box; }

body.public-body {
  margin: 0;
  background: var(--page-bg);
  font-family: 'Inter', sans-serif;
  color: var(--sheet-ink);
  padding: 32px 20px 80px;
}

.sheet {
  max-width: 960px;
  margin: 0 auto;
  background: var(--page-bg);
  border: 1px solid var(--sheet-line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 12px 40px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: visible;
}

@media (min-width: 1100px) {
  .sheet { max-width: 1060px; }
  body.public-body { padding: 48px 32px 96px; }
}

.form-header {
  padding: 36px 56px 28px;
  border-bottom: 1px solid var(--sheet-line);
}

.logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(27, 42, 74, 0.15);
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-dark);
  margin-bottom: 10px;
}

h1 {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 32px;
  margin: 0 0 8px;
  color: var(--sheet-ink);
  letter-spacing: -0.01em;
}

.sub {
  font-size: 14.5px;
  color: var(--sheet-muted);
  max-width: 62ch;
  line-height: 1.5;
  margin: 0;
}

form.enroll-form { padding: 0 56px 48px; }

/* ── Multi-step progress (slim) ── */
.step-progress {
  padding: 20px 56px 22px;
  border-bottom: 1px solid var(--sheet-line);
}

.step-bar-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.step-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--orange-dark);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.step-current {
  font-family: 'Lora', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--sheet-ink);
}

.step-track {
  height: 3px;
  background: var(--sheet-well);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}

.step-track-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--navy), var(--orange));
  border-radius: 99px;
  transition: width 0.35s ease;
}

.step-pills {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.step-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: default;
}

.step-pill.done { cursor: pointer; }

.step-pill-node {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.2s, background 0.2s;
}

.step-pill-node > svg,
.step-pill-node > i[data-lucide] {
  width: 13px !important;
  height: 13px !important;
  color: #9A9284;
  stroke: currentColor;
}

.step-pill-check {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
}

.step-pill-check > svg,
.step-pill-check > i[data-lucide] {
  width: 12px !important;
  height: 12px !important;
  color: #fff !important;
  stroke: currentColor;
}

.step-pill-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  line-height: 1.2;
}

.step-pill.active .step-pill-node {
  border-color: var(--orange);
  background: #FFF8EE;
}

.step-pill.active .step-pill-node > svg,
.step-pill.active .step-pill-node > i[data-lucide] { color: var(--orange-dark); }
.step-pill.active .step-pill-label { color: #fff; }

.step-pill.done .step-pill-node { border-color: var(--green); background: #fff; }
.step-pill.done .step-pill-node > svg,
.step-pill.done .step-pill-node > i[data-lucide] { opacity: 0; }
.step-pill.done .step-pill-check { opacity: 1; transform: scale(1); }
.step-pill.done .step-pill-label { color: #9BE3B4; }

.step-pill:not(.active):not(.done) .step-pill-node { background: var(--sheet-well); border-color: var(--sheet-line); }

/* ── Form steps ── */
.form-step {
  display: none;
  padding-top: 28px;
  animation: stepIn 0.25s ease;
}

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

@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section { margin-top: 0; }

.form-step .section-head { display: none; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--orange);
  border: 1px solid var(--orange);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.section-title {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--sheet-ink);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}

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

.field { margin-bottom: 18px; }
.grid .field { margin-bottom: 0; }
.full { grid-column: 1 / -1; }

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sheet-ink);
  margin-bottom: 6px;
}

label .opt {
  font-weight: 400;
  color: var(--sheet-muted);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  line-height: 1.4;
  padding: 10px 12px;
  border: 1px solid var(--field-border);
  background: var(--page-bg);
  border-radius: var(--field-radius);
  color: var(--sheet-ink);
  caret-color: #fff;
  color-scheme: dark;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.public-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])::placeholder,
.public-body textarea::placeholder {
  color: rgba(255, 255, 255, 0.9);
  opacity: 1;
}

.public-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])::-webkit-input-placeholder,
.public-body textarea::-webkit-input-placeholder {
  color: rgba(255, 255, 255, 0.9);
}

.public-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"])::-moz-placeholder,
.public-body textarea::-moz-placeholder {
  color: rgba(255, 255, 255, 0.9);
  opacity: 1;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):-webkit-autofill,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):-webkit-autofill:hover,
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--page-bg) inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
  transition: background-color 99999s ease-out;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select {
  height: var(--field-control-h);
  min-height: var(--field-control-h);
  padding-top: 0;
  padding-bottom: 0;
}

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

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.public-body .cedf-custom-trigger {
  background: var(--page-bg);
  border-color: var(--field-border);
  color: var(--sheet-ink);
}

.public-body .cedf-custom-trigger:focus,
.public-body .cedf-custom-select.is-open .cedf-custom-trigger,
.public-body .cedf-custom-date.is-open .cedf-custom-trigger,
.public-body .cedf-custom-time.is-open .cedf-custom-trigger {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.public-body .cedf-custom-value.is-placeholder {
  color: rgba(255, 255, 255, 0.9) !important;
}

.public-body .cedf-custom-arrow {
  color: #fff;
  opacity: 0.7;
}

.error-msg {
  font-size: 12px;
  color: #FFB4A8;
  margin-top: 5px;
  display: none;
}

.field.invalid .error-msg { display: block; }
.field.invalid input,
.field.invalid select,
.field.invalid textarea,
.field.invalid .cedf-custom-trigger { border-color: var(--error) !important; }

.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--page-bg);
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  margin-top: 16px;
  cursor: pointer;
}

.checkline input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--orange); flex-shrink: 0; }
.checkline p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--sheet-muted); }
.checkline.invalid { border-color: var(--error); background: rgba(179, 74, 60, 0.22); }

.submit-row,
.step-nav {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--sheet-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.step-nav-left,
.step-nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-back {
  background: transparent;
  color: var(--sheet-ink);
  border: 1px solid var(--sheet-line);
  padding: 12px 22px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.btn-back:hover { border-color: #fff; background: var(--sheet-well); }

.btn-next {
  background: #fff;
  color: var(--page-bg);
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}

.btn-next:hover { background: #EDECF2; }

.submit-row {
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: none;
  padding-top: 0;
}

.btn, button[type="submit"] {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14.5px;
  background: var(--orange);
  color: var(--parchment);
  border: none;
  padding: 13px 32px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s ease, transform .15s ease;
}

.btn:hover, button[type="submit"]:hover { background: var(--orange-dark); }
.btn:active, button[type="submit"]:active { transform: translateY(1px); }

.btn-orange { background: var(--orange); }
.btn-orange:hover { background: var(--orange-dark); }

.btn-outline {
  background: transparent;
  color: var(--sheet-ink);
  border: 1px solid var(--sheet-line);
}

.status {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  display: none;
}

.status.show { display: inline-flex; align-items: center; gap: 6px; }
.status.error { color: var(--error); }

.confirm {
  display: none;
  padding: 64px 56px 72px;
  text-align: center;
}

.confirm.show { display: block; animation: stepIn 0.4s ease; }

.confirm-inner {
  max-width: 520px;
  margin: 0 auto;
}

.confirm .mark {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #3D8B5E);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  box-shadow: 0 8px 24px rgba(45, 107, 74, 0.25);
}

.confirm .mark i[data-lucide] {
  width: 32px !important;
  height: 32px !important;
  color: #fff;
}

.confirm h2 {
  font-family: 'Lora', serif;
  color: var(--sheet-ink);
  margin: 0 0 12px;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.confirm .thank-lead {
  font-family: 'Lora', serif;
  font-size: 18px;
  color: var(--orange-dark);
  margin: 0 0 16px;
  font-style: italic;
}

.confirm p {
  color: var(--sheet-muted);
  font-size: 15px;
  line-height: 1.7;
  max-width: 48ch;
  margin: 0 auto 24px;
}

.confirm-ref-box {
  display: inline-block;
  background: var(--sheet-well);
  border: 1px solid var(--sheet-line);
  border-radius: 10px;
  padding: 16px 28px;
  margin: 8px 0 28px;
}

.confirm-ref-box .ref-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--sheet-muted);
  margin-bottom: 6px;
}

.confirm .ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  color: var(--sheet-ink);
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0;
}

.confirm-next-steps {
  text-align: left;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 20px 24px;
  margin-top: 8px;
}

.confirm-next-steps h3 {
  font-family: 'Lora', serif;
  font-size: 15px;
  color: var(--navy);
  margin: 0 0 12px;
}

.confirm-next-steps ul {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 14px;
  color: #5B5B56;
  line-height: 1.7;
}

.confirm-next-steps li { margin-bottom: 6px; }

.install-sheet { max-width: 520px; }
.install-form { padding: 24px 48px 48px; }

.alert {
  margin: 24px 48px 0;
  padding: 14px 16px;
  border-radius: var(--field-radius);
  font-size: 14px;
}

.alert-success { background: #E8F5EC; color: var(--green); border: 1px solid #B8D9C4; }
.alert-error { background: #FDECEA; color: var(--error); border: 1px solid #F0C4BE; }
.alert-info { background: #E8F4FA; color: var(--navy); border: 1px solid #B8DAEA; }

@media (max-width: 768px) {
  :root { --field-control-h: 40px; }

  body.public-body { padding: 0; }

  .sheet {
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  .form-header {
    padding: 24px 20px 20px;
    text-align: center;
  }

  .logo {
    width: 58px;
    height: 58px;
    margin-left: auto;
    margin-right: auto;
  }

  h1 { font-size: 24px; }

  .sub {
    font-size: 13.5px;
    max-width: none;
  }

  .step-progress { padding: 14px 20px 16px; }
  .step-pill-label { display: none; }
  .step-current { font-size: 15px; }
  .step-bar-head { margin-bottom: 10px; }
  .step-track { margin-bottom: 12px; }

  form.enroll-form { padding-left: 20px; padding-right: 20px; }
  .confirm { padding: 40px 20px 48px; }
  .confirm h2 { font-size: 24px; }
}

@media (max-width: 600px) {
  .grid,
  .grid.grid-3,
  .grid.grid-wide {
    grid-template-columns: 1fr 1fr;
    gap: 14px 12px;
  }

  .grid .field {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .grid .field.pair-sm {
    grid-column: auto;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
  select,
  .cedf-custom-trigger {
    height: var(--field-control-h);
    min-height: var(--field-control-h);
    max-height: var(--field-control-h);
    padding: 0 10px;
    font-size: 14px;
  }

  .cedf-custom-trigger {
    display: flex;
    align-items: center;
  }

  textarea {
    height: auto;
    min-height: 80px;
    max-height: none;
    padding: 9px 10px;
  }

  .form-step { padding-top: 18px; }

  .form-header, form.enroll-form, .install-form { padding-left: 16px; padding-right: 16px; }
  .step-progress { padding-left: 16px; padding-right: 16px; }

  h1 { font-size: 22px; }

  .step-nav {
    margin-top: 28px;
    padding-top: 20px;
    gap: 10px;
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .step-nav-left, .step-nav-right { width: 100%; justify-content: stretch; }
  .btn-back, .btn-next, button[type="submit"] { width: 100%; justify-content: center; }
}
