.diag-form {
  display: grid;
  gap: 20px;
  padding: 28px;
  background: var(--ld-white);
  border: 1px solid var(--ld-border);
  border-radius: 8px;
  box-shadow: var(--ld-shadow);
}

.diag-form-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.diag-step-count,
.diag-duration {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  color: var(--ld-teal-dark);
  background: var(--ld-mint-soft);
  border: 1px solid rgba(19, 95, 107, 0.12);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.diag-form-head h3 {
  margin: 10px 0 0;
  color: var(--ld-navy);
  font-size: 1.45rem;
  line-height: 1.18;
}

.diag-progress {
  height: 8px;
  overflow: hidden;
  background: #edf5f3;
  border-radius: 999px;
}

.diag-progress span {
  display: block;
  width: 16.66%;
  height: 100%;
  background: linear-gradient(90deg, var(--ld-teal-dark), var(--ld-mint));
  border-radius: inherit;
  transition: width 220ms ease;
}

.diag-step {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.diag-step[hidden] {
  display: none;
}

.diag-step legend {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  color: var(--ld-navy);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1.28;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-grid label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 48px;
  padding: 13px 14px;
  color: var(--ld-text);
  cursor: pointer;
  background: #fbfefd;
  border: 1px solid var(--ld-border);
  border-radius: 8px;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.choice-grid label:hover,
.choice-grid label:focus-within {
  background: var(--ld-white);
  border-color: rgba(19, 95, 107, 0.35);
  box-shadow: 0 0 0 4px rgba(110, 219, 193, 0.13);
}

.choice-grid input,
.diag-form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--ld-teal-dark);
}

.choice-grid span {
  font-size: 0.95rem;
  font-weight: 750;
}

.diag-form input:not([type="checkbox"]),
.diag-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  color: var(--ld-text);
  background: #fbfefd;
  border: 1px solid var(--ld-border);
  border-radius: 8px;
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.diag-form textarea {
  min-height: 150px;
  resize: vertical;
}

.diag-form input:not([type="checkbox"]):focus,
.diag-form textarea:focus {
  background: var(--ld-white);
  border-color: var(--ld-teal-dark);
  box-shadow: 0 0 0 4px rgba(110, 219, 193, 0.2);
  outline: none;
}

.diag-recap {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--ld-mint-soft);
  border: 1px solid rgba(19, 95, 107, 0.14);
  border-radius: 8px;
}

.diag-recap strong {
  color: var(--ld-navy);
}

.diag-recap span {
  color: var(--ld-muted);
}

.diag-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.diag-form-actions .button[hidden] {
  display: none;
}

.diag-form-actions .button[hidden] + [data-next-step] {
  margin-left: auto;
}

@media (max-width: 860px) {
  .diag-form {
    padding: 22px;
  }

  .diag-form-head,
  .diag-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .diag-form-actions .button[hidden] + [data-next-step] {
    margin-left: 0;
  }

  .diag-duration {
    align-self: flex-start;
  }
}

@media (max-width: 560px) {
  .diag-form {
    padding: 20px;
  }

  .choice-grid label {
    padding: 12px;
  }
}
