/* FormSection Molecule - Grouped form fields with optional title + count */
/*
   SPACING CONTRACT:
   - No external margins - parent controls spacing between sections via gap
   - Internal gap between header and content: --space-2 (8px)
   - Content gap between form rows: --space-3 (12px)
*/

.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0;  /* CONTRACT: Parent gap handles spacing between sections */
}

/* Header (title + optional count) */
.form-section-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

/* Title styling */
.form-section-title {
  margin: 0;
  padding: 0;
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

/* Optional muted count next to title */
.form-section-count {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Bordered variant - header has bottom border (was on title) */
.form-section-bordered .form-section-header {
  padding-bottom: var(--space-3);
  border-bottom: var(--border-width-1) solid var(--border-subtle);
}

/* Increase gap after bordered header to account for visual weight */
.form-section-bordered {
  gap: var(--space-4);
}

/* Content container */
.form-section-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Smaller title for non-bordered sections (e.g., h5) */
.form-section:not(.form-section-bordered) .form-section-title {
  font-size: var(--text-base);
}
