.form-group {
  margin-bottom: $spacing-base;
  
  &:last-child {
    margin-bottom: 0;
  }
}

.form-label {
  display: block;
  margin-bottom: $spacing-xs;
  font-weight: $font-weight-medium;
  color: $text-color;
}

.form-control {
  @include form-control;
  
  &--sm {
    padding: $spacing-xs $spacing-sm;
    font-size: $font-size-sm;
  }
  
  &--lg {
    padding: $spacing-md $spacing-base;
    font-size: $font-size-lg;
  }
  
  &.is-invalid {
    border-color: $error-color;
    
    &:focus {
      border-color: $error-color;
      box-shadow: 0 0 0 3px rgba($error-color, 0.1);
    }
  }
  
  &.is-valid {
    border-color: $success-color;
    
    &:focus {
      border-color: $success-color;
      box-shadow: 0 0 0 3px rgba($success-color, 0.1);
    }
  }
}

.form-select {
  @include form-control;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right $spacing-sm center;
  background-repeat: no-repeat;
  background-size: 16px 12px;
  padding-right: $spacing-2xl;
  
  &:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%233b82f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  }
}

.form-check {
  display: flex;
  align-items: center;
  margin-bottom: $spacing-sm;
  
  &:last-child {
    margin-bottom: 0;
  }
}

.form-check-input {
  width: 1rem;
  height: 1rem;
  margin-right: $spacing-sm;
  border: 1px solid $border-color;
  @include border-radius($border-radius-sm);
  @include transition();
  
  &[type='checkbox'] {
    &:checked {
      background-color: $primary-color;
      border-color: $primary-color;
      background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-7-7a.5.5 0 0 0-.708 0l-3.5 3.5a.5.5 0 1 0 .708.708L6.5 7.707l6.646-6.647a.5.5 0 0 1 .708.708z'/%3e%3c/svg%3e");
      background-position: center;
      background-repeat: no-repeat;
      background-size: 12px;
    }
  }
  
  &[type='radio'] {
    border-radius: 50%;
    
    &:checked {
      background-color: $primary-color;
      border-color: $primary-color;
      background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
      background-position: center;
      background-repeat: no-repeat;
      background-size: 8px;
    }
  }
  
  &:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba($primary-color, 0.1);
  }
}

.form-check-label {
  font-size: $font-size-base;
  color: $text-color;
  cursor: pointer;
}

.form-text {
  font-size: $font-size-sm;
  color: $text-muted;
  margin-top: $spacing-xs;
}

.invalid-feedback {
  display: block;
  font-size: $font-size-sm;
  color: $error-color;
  margin-top: $spacing-xs;
}

.valid-feedback {
  display: block;
  font-size: $font-size-sm;
  color: $success-color;
  margin-top: $spacing-xs;
}