/* ─────────────────────────────────────────────────────────────────────────
   Forms Engine · Phase B styles
   Self-contained .aku-form / .aku-field / .aku-scale / .aku-epa selectors so
   we can pull the engine out cleanly if needed. Uses existing CSS variables
   (--surface, --border, --accent, --text, --muted) so themes flow through.
   ───────────────────────────────────────────────────────────────────────── */

.aku-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px;
}
.aku-form__title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.aku-form__description {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.aku-form__section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.aku-form__section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.aku-form__section-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.aku-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aku-field__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.aku-field__help {
  font-size: 12px;
  color: var(--muted);
  margin-top: -2px;
}
.aku-field__error {
  font-size: 12px;
  color: #ef4444;
  font-weight: 500;
}
.aku-field--error .aku-input,
.aku-field--error .aku-textarea,
.aku-field--error .aku-select {
  border-color: #ef4444;
}

.aku-input,
.aku-textarea,
.aku-select {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface2, var(--surface));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.aku-input:focus,
.aku-textarea:focus,
.aku-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-bg);
}
.aku-textarea { resize: vertical; min-height: 64px; }

/* Scale: 1..N pressable buttons + optional UC */
.aku-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.aku-scale__btn {
  min-width: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--surface2, var(--surface));
  color: var(--text);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.aku-scale__btn:hover:not(:disabled) {
  border-color: var(--accent);
}
.aku-scale__btn--active,
.aku-scale__btn--active:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.aku-scale__btn--uc { font-size: 12px; min-width: 44px; opacity: .8; }
.aku-scale__btn--uc.aku-scale__btn--active { opacity: 1; }
.aku-scale__btn:disabled { opacity: .5; cursor: not-allowed; }
.aku-scale__anchors {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* EPA: stacked rows with full descriptions */
.aku-epa {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aku-epa__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface2, var(--surface));
}
.aku-epa__row:hover { border-color: var(--accent); }
.aku-epa__row input { margin-top: 4px; accent-color: var(--accent); }
.aku-epa__row span { font-size: 13px; color: var(--text); line-height: 1.4; }

.aku-boolean {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.aku-boolean input { width: 16px; height: 16px; accent-color: var(--accent); }

.aku-multiselect {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aku-multiselect__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: var(--surface2, var(--surface));
}
.aku-multiselect__row input { accent-color: var(--accent); }

.aku-form__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 8px;
}

@media (max-width: 600px) {
  .aku-form { padding: 8px; gap: 16px; }
  .aku-form__section { padding: 14px; }
  .aku-scale__btn { min-width: 32px; padding: 5px 8px; }
}
