.heform {
  max-width: 600px;
  margin: 1em 0;
}
.heform-field {
  margin-bottom: 1em;
  box-sizing: border-box;
}
.heform-field label {
  display: block;
  margin-bottom: 0.25em;
  font-weight: 600;
}
.heform-field input,
.heform-field textarea,
.heform-field select {
  width: 100%;
  padding: 0.5em 0.75em;
  box-sizing: border-box;
}
.heform-options .heform-option {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25em;
  cursor: pointer;
}
.heform-actions {
  margin-top: 1em;
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
}
.heform-submit {
  cursor: pointer;
}
.heform-required {
  color: #e22;
  margin-left: 0.25em;
}
.heform-error {
  color: #d63638;
  font-size: 0.9em;
  margin-top: 0.25em;
}
.heform-success {
  margin-top: 1em;
  color: #155724;
  background: #d4edda;
  border: 1px solid #c3e6cb;
  padding: 0.75em 1em;
  border-radius: 4px;
}

/* Multi-step UI */
.heform-steps-nav {
  margin-bottom: 1em;
}
.heform-steps-tabs {
  list-style: none;
  margin: 0 0 0.5em 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.heform-steps-tabs li {
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-size: 0.9em;
}
.heform-steps-tabs li.active {
  background: #fff;
  border-color: #2a7ae2;
  color: #2a7ae2;
  font-weight: 600;
}
.heform-progress {
  width: 100%;
  height: 5px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}
.heform-progress-bar {
  height: 5px;
  background: #2a7ae2;
  width: 0;
  transition: width 0.2s ease;
}
.heform-step {
  display: none;
}
.heform-step-active {
  display: block;
}
.heform-hidden {
  display: none !important;
}

/* Widths */
.heform-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.heform-step {
  width: 100%;
}
.heform-width-full {
  width: 100%;
}
.heform-width-half {
  width: 48%;
}
.heform-width-third {
  width: 31%;
}
@media (max-width: 700px) {
  .heform-width-half,
  .heform-width-third {
    width: 100%;
  }
}

/* Label positions */
.heform-label-left .heform-label {
  display: inline-block;
  width: 30%;
  vertical-align: top;
  margin-right: 0.5em;
}
.heform-label-left input,
.heform-label-left textarea,
.heform-label-left select {
  width: 68%;
  display: inline-block;
}
.heform-label-hidden .heform-label {
  display: none;
}

/* select / radio / checkbox as buttons */
.he-grid-select .heform-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.he-grid-select .heform-option {
  flex: 1 1 calc(50% - 0.5rem);
  border-radius: 999px;
  border: 1px solid var(--he-border, rgba(0,0,0,0.1));
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  background: var(--he-bg, rgba(255,255,255,0.9));
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.he-grid-select .heform-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* General button-select style */
.he-select-buttons .heform-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.he-select-buttons .heform-option {
  position: relative;
  flex: 1 1 140px;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--he-border, rgba(0,0,0,0.1));
  padding: 0.45rem 1rem;
  cursor: pointer;
  background: var(--he-bg, rgba(255,255,255,0.9));
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.he-select-buttons .heform-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.he-select-buttons .heform-option:hover {
  border-color: var(--he-primary-soft, rgba(0,0,0,0.2));
}
.he-select-buttons .heform-option input:checked ~ span {
  font-weight: 600;
}
.he-select-buttons .heform-option input:checked ~ * {
  background: var(--he-primary, #2a7ae2);
  color: var(--he-on-primary, #ffffff);
  border-color: var(--he-primary, #2a7ae2);
  box-shadow: 0 0 0 1px rgba(42,122,226,0.2);
}

/* Light/dark variables */
:root {
  --he-primary: #2a7ae2;
  --he-on-primary: #ffffff;
  --he-bg: rgba(255,255,255,0.95);
  --he-border: rgba(0,0,0,0.12);
}
body.dark,
body[data-theme="dark"] {
  --he-bg: rgba(20,20,20,0.95);
  --he-border: rgba(255,255,255,0.2);
}

/* Slightly nicer pill inputs */
.he-pill-input input,
.he-pill-input textarea {
  border-radius: 999px !important;
}
.he-pill-input textarea {
  border-radius: 12px !important;
}
