:root {
  --brand: #ffa42d;
  --brand-dark: #192e3d;
  --brand-soft: #fff6eb;
  --brand-amber: #fec172;
  --brand-cream: #fddfb7;
  --brand-white: #fcfcfc;
  --ink: #17212b;
  --muted: #64717f;
  --line: #d8dee5;
  --panel: #fcfcfc;
  --page: #f4f6f8;
  --success: #3c8b66;
  --warning: #ffa42d;
  --danger: #d94444;
  --shadow: 0 8px 28px rgba(25, 46, 61, 0.1);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
  padding-bottom: 78px;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--brand-dark);
  border-right: 2px solid var(--brand);
}

.brand-row {
  display: grid;
  grid-template-columns: 38px 1fr 34px;
  align-items: center;
  min-height: 72px;
  padding: 13px 12px;
  background: var(--brand-dark);
  color: var(--brand-white);
  border-bottom: 1px solid rgba(255, 164, 45, 0.45);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.brand-copy strong,
.brand-copy span {
  display: block;
  line-height: 1.2;
}

.brand-copy strong {
  font-size: 19px;
}

.brand-copy span {
  margin-top: 2px;
  color: rgba(252, 252, 252, 0.72);
  font-size: 12px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: currentColor;
  background: transparent;
  border: 0;
}

.search-box {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  height: 46px;
  margin: 0;
  padding: 0 16px;
  background: rgba(252, 252, 252, 0.08);
  border-bottom: 1px solid rgba(252, 252, 252, 0.14);
  color: rgba(252, 252, 252, 0.68);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--brand-white);
  background: transparent;
}

.search-box input::placeholder {
  color: rgba(252, 252, 252, 0.58);
}

.side-steps {
  padding: 18px 0 20px;
}

.side-step {
  display: grid;
  grid-template-columns: 1fr 82px 22px;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 0 13px;
  color: rgba(252, 252, 252, 0.66);
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  text-align: left;
  width: 100%;
}

.side-step span:first-child {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-step.active {
  color: var(--brand-white);
  border-left-color: var(--brand);
  font-weight: 700;
  background: rgba(252, 252, 252, 0.08);
}

.side-step.complete {
  color: rgba(252, 252, 252, 0.86);
}

.side-step.partial .status-dot {
  color: var(--warning);
}

.side-step .rail {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: rgba(252, 252, 252, 0.16);
}

.side-step .rail i {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: var(--brand);
}

.side-step.complete .rail i {
  width: 100%;
}

.side-step .status-dot {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--brand);
}

.side-step .status-dot svg {
  width: 14px;
  height: 14px;
}

.main-panel {
  min-width: 0;
  padding: 28px 42px 38px;
  background: var(--page);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  padding-top: 0;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 700;
  line-height: 1.12;
}

h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.outline-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
}

.outline-button {
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid var(--brand-amber);
}

.is-submitted #saveDraft {
  display: none;
}

.primary-button {
  color: var(--brand-dark);
  background: var(--brand);
  border: 1px solid var(--brand);
}

.primary-button:hover,
.outline-button:hover {
  box-shadow: 0 0 0 3px rgba(255, 164, 45, 0.18);
}

.top-stepper {
  display: grid;
  grid-template-columns: repeat(8, minmax(88px, 1fr));
  align-items: start;
  max-width: 930px;
  margin: 0 auto 28px;
}

.step-node {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 0 4px;
  color: #475569;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius);
  text-align: center;
  font-size: 12px;
  scroll-snap-align: center;
}

.step-node::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 50%;
  width: 100%;
  height: 1px;
  background: #b7c1cc;
  z-index: 0;
}

.step-node:first-child::before {
  display: none;
}

.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--brand-dark);
  background: #fff;
  border: 2px solid var(--brand);
  border-radius: 50%;
}

.step-node.complete .step-dot {
  color: var(--success);
  border-color: var(--success);
}

.step-node.warning .step-dot {
  color: var(--warning);
  border-color: var(--warning);
}

.step-node.active {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 164, 45, 0.14);
  font-weight: 800;
}

.step-node.active .step-dot {
  color: var(--brand-dark);
  background: var(--brand);
  border-color: var(--brand);
}

.step-node span:last-child {
  display: block;
  max-width: 108px;
  line-height: 1.25;
}

.step {
  display: none;
  max-width: 980px;
  margin: 0 auto;
}

.step.active {
  display: block;
}

.form-card {
  margin-bottom: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid var(--brand);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  color: var(--ink);
  background: transparent;
  border: 0;
  font-size: 17px;
  font-weight: 700;
  text-align: left;
}

.card-heading svg {
  color: var(--brand);
  transition: transform 160ms ease;
}

.form-card.collapsed .card-heading svg {
  transform: rotate(180deg);
}

.card-body {
  display: grid;
  gap: 18px;
  padding: 0 20px 20px;
}

.form-card.collapsed .card-body {
  display: none;
}

.consent-card {
  margin-top: 22px;
  border-top-width: 1px;
}

.consent-card .card-body {
  padding: 18px 20px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

label,
legend {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

label span,
legend span {
  color: var(--warning);
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  margin-top: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
}

textarea {
  min-height: 92px;
  padding-top: 11px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 164, 45, 0.18);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-grid legend {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.choice-grid label {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.choice-grid input {
  width: 16px;
  min-height: auto;
  height: 16px;
  margin: 0;
  accent-color: var(--brand);
}

.choice-grid label:has(input:checked) {
  color: var(--brand-dark);
  background: var(--brand-soft);
  border-color: var(--brand);
}

.custom-schedule {
  display: none;
  gap: 16px;
  padding: 16px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-cream);
  border-radius: var(--radius);
}

.custom-schedule.visible {
  display: grid;
}

.schedule-window {
  display: grid;
  gap: 10px;
}

.day-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.report-confirmation {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
}

.primary-recipient {
  display: grid;
  grid-template-columns: 1.1fr 1.4fr 1fr;
  gap: 10px;
  padding: 13px 14px;
  color: #334155;
  background: var(--brand-soft);
  border: 1px solid var(--brand-cream);
  border-radius: var(--radius);
  font-size: 14px;
}

.primary-recipient b {
  color: var(--ink);
}

.automation-preview {
  display: grid;
  gap: 7px;
  padding: 14px;
  color: #334155;
  background: var(--brand-soft);
  border: 1px solid var(--brand-cream);
  border-radius: var(--radius);
  font-size: 14px;
}

.automation-preview b {
  color: var(--ink);
}

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

.default-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 8px;
  padding: 0 7px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid var(--brand-cream);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.alternate-recipient,
.team-members-panel,
.branch-panel {
  display: none;
}

.alternate-recipient.visible,
.team-members-panel.visible {
  display: block;
  margin-top: 10px;
  padding-top: 8px;
}

.branch-panel.visible {
  display: grid;
  gap: 22px;
  margin-top: 16px;
  padding-top: 10px;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 11px;
  padding: 13px 14px;
  color: #334155;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.checkbox-row input {
  width: 16px;
  height: 16px;
  min-height: auto;
  margin: 1px 0 0;
  accent-color: var(--brand);
}

.checkbox-row span {
  color: #334155;
}

.conditional {
  display: none;
}

.conditional.visible {
  display: block;
}

.muted-state {
  border-top-color: var(--brand-amber);
}

.muted-state.hidden {
  display: none;
}

.empty-copy {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(217, 68, 68, 0.1) !important;
}

.group-invalid {
  padding: 12px;
  border: 1px solid rgba(217, 68, 68, 0.6);
  border-radius: var(--radius);
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.info-note {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 1px solid var(--brand-cream);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.info-note.visible {
  display: block;
}

.info-note.static {
  display: block;
  margin: 0;
}

.review-layout {
  grid-template-columns: 1.2fr 1fr;
  align-items: start;
}

.summary-list {
  display: grid;
  gap: 9px;
}

.summary-item {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.summary-item b {
  color: #475569;
}

.status-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  position: relative;
  padding: 9px 10px 9px 30px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.35;
}

.status-list li::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--brand);
}

.status-list li.warning::before {
  background: var(--warning);
}

.status-list li.ok::before {
  background: var(--success);
}

.terms-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 13px 14px;
  color: #334155;
  background: #fff;
  border: 1px solid #d8e4f1;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.45;
}

.terms-row span {
  color: #334155;
}

.terms-row input {
  width: 16px;
  height: 16px;
  min-height: auto;
  margin: 1px 0 0;
}

.success-panel {
  display: none;
  max-width: 760px;
  margin: 30px auto;
  padding: 42px 28px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.success-panel.visible {
  display: block;
}

.success-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
}

.success-panel h2 {
  font-size: 24px;
}

.success-panel p {
  max-width: 520px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.5;
}

.action-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 292px;
  z-index: 10;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  min-height: 66px;
  padding: 12px 42px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 22px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(10px);
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .main-panel {
    padding-inline: 24px;
  }

  .top-stepper {
    overflow-x: auto;
    grid-template-columns: repeat(8, 110px);
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .review-layout,
  .grid.three {
    grid-template-columns: 1fr 1fr;
  }

  .action-bar {
    left: 238px;
    padding-inline: 24px;
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 2px solid var(--brand);
  }

  .side-steps {
    display: none;
  }

  .brand-row {
    min-height: 62px;
  }

  .main-panel {
    padding: 28px 14px 104px;
  }

  .page-header {
    min-height: unset;
    padding: 0 0 16px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-stepper {
    margin-bottom: 16px;
    grid-template-columns: repeat(8, 128px);
  }

  .grid.two,
  .grid.three,
  .choice-grid,
  .day-grid,
  .primary-recipient,
  .two-choice,
  .review-layout {
    grid-template-columns: 1fr;
  }

  .summary-item {
    grid-template-columns: 1fr;
  }

  .action-bar {
    left: 0;
    padding: 12px 14px;
  }

  .action-bar button {
    flex: 1;
  }
}
